4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
## Revision 1.2 2003/03/28 03:06:48 joko |
## Revision 1.4 2003/04/06 01:44:52 jonen |
8 |
## enhanced: now aware of "No data." |
## + build links now with help of LinkBuilder class |
9 |
|
## (one id instead of a bunch of variables... ;) |
10 |
## |
## |
11 |
## Revision 1.1 2003/03/27 01:26:18 jonen |
## Revision 1.3 2003/04/05 21:17:16 joko |
12 |
## + initial commit, example of a simple NavigationList |
## moved code to AbstractNavigationList.php |
|
## |
|
|
## Revision 1.1 2003/03/01 22:57:23 cvsmax |
|
|
## + inital commit |
|
13 |
## |
## |
14 |
## |
## |
15 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
16 |
*/ |
*/ |
17 |
|
|
18 |
loadModule('WebExplorer::Module::AbstractGUIModule'); |
loadModule('WebExplorer::Module::AbstractNavigationList'); |
19 |
|
|
20 |
class WebExplorer_Module_NavigationList extends WebExplorer_Module_AbstractGUIModule { |
class WebExplorer_Module_NavigationList extends WebExplorer_Module_AbstractNavigationList { |
21 |
|
|
22 |
function set_gui_object() { |
function propagate() { |
23 |
$this->_gui_object = $this->buildNavList(); |
$linkbuilder = new LinkBuilder(); |
|
} |
|
24 |
|
|
25 |
|
$link_vars = array( |
26 |
function buildNavList() { |
'ap' => "explorer", |
27 |
|
'ecl' => "content", |
28 |
|
'ect' => "data", |
29 |
|
'ecdlk' => "rpc", |
30 |
|
'ecat' => "list", |
31 |
|
); |
32 |
|
|
33 |
// query data |
foreach ($this->result as $value) { |
34 |
$initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) ); |
$alt_caption = "Alle Elemente des Typs '$value' anzeigen."; |
35 |
$proxy = php::mkComponent('DataSource::Generic', $initial_locator, $this->_args['options']['data_locator_meta']); |
|
36 |
$source = $proxy->get_adapter(); |
// V1: hmm...long time ago... |
37 |
$source->do_query(); |
//$url = $_SERVER['PHP_SELF'] . "?" . $this->_control['page_ident_label'] . "=d_list&l_label=" . $value; |
|
|
|
|
// trace |
|
|
//print Dumper($initial_locator); |
|
|
//print Dumper($this->_args); |
|
|
|
|
|
$nav = new VerticalCSSNavTable($this->_args['caption'], "", $width="100%"); |
|
|
|
|
|
// check valid/non-empty result |
|
|
if ($itemCount = $source->get_total_rows()) { |
|
|
$result = $source->_result; |
|
|
|
|
|
// trace |
|
|
//print Dumper($source->_result); |
|
|
|
|
|
//if (is_array($result)) { |
|
|
foreach($result as $value) { |
|
|
$alt_caption = "Alle Elemente des Types $value anzeigen"; |
|
|
//$url = $_SERVER['PHP_SELF'] . "?" . $this->_control['page_ident_label'] . "=d_list&l_label=" . $value; |
|
|
$url = $_SERVER['PHP_SELF'] . "?ap=explorer&ecl=content&ect=data&ecdlk=rpc&ecat=list&ecdid=$value"; |
|
|
$nav->add($url, $value, $alt_caption); |
|
|
} |
|
|
//} |
|
|
|
|
|
} else { |
|
|
|
|
|
// both are valid! (at least - should be...) |
|
|
//$nav->add(pageLink('explorer'), "No data."); |
|
|
$nav->add(topicLink('DataBrowser'), "No data."); |
|
|
|
|
|
} |
|
38 |
|
|
39 |
return $nav; |
// V2: simple add vars to url |
40 |
|
//$url = $_SERVER['PHP_SELF'] . "?ap=explorer&ecl=content&ect=data&ecdlk=rpc&ecat=list&ecdid=$value"; |
41 |
|
|
42 |
|
// V3: use LinkBuilder to save vars at session and get unique id instead |
43 |
|
$link_vars['ecdid'] = $value; |
44 |
|
$link_guid = $linkbuilder->save($link_vars); |
45 |
|
$url = $_SERVER['PHP_SELF'] . "?lbid=" . $link_guid; |
46 |
|
|
47 |
|
$this->nav->add($url, $value, $alt_caption); |
48 |
|
} |
49 |
|
|
50 |
} |
} |
51 |
|
|
52 |
} |
} |
53 |
|
|
54 |
|
|
|
|
|
55 |
?> |
?> |