4 |
## $Id$ |
## $Id$ |
5 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
6 |
## $Log$ |
## $Log$ |
7 |
## Revision 1.2 2003/03/28 03:06:48 joko |
## Revision 1.3 2003/04/05 21:17:16 joko |
8 |
## enhanced: now aware of "No data." |
## moved code to AbstractNavigationList.php |
|
## |
|
|
## Revision 1.1 2003/03/27 01:26:18 jonen |
|
|
## + initial commit, example of a simple NavigationList |
|
|
## |
|
|
## Revision 1.1 2003/03/01 22:57:23 cvsmax |
|
|
## + inital commit |
|
9 |
## |
## |
10 |
## |
## |
11 |
## ----------------------------------------------------------------------------- |
## ----------------------------------------------------------------------------- |
12 |
*/ |
*/ |
13 |
|
|
14 |
loadModule('WebExplorer::Module::AbstractGUIModule'); |
loadModule('WebExplorer::Module::AbstractNavigationList'); |
|
|
|
|
class WebExplorer_Module_NavigationList extends WebExplorer_Module_AbstractGUIModule { |
|
15 |
|
|
16 |
function set_gui_object() { |
class WebExplorer_Module_NavigationList extends WebExplorer_Module_AbstractNavigationList { |
|
$this->_gui_object = $this->buildNavList(); |
|
|
} |
|
17 |
|
|
18 |
|
function propagate() { |
|
function buildNavList() { |
|
19 |
|
|
20 |
// query data |
foreach ($this->result as $value) { |
21 |
$initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) ); |
$alt_caption = "Alle Elemente des Typs '$value' anzeigen."; |
22 |
$proxy = php::mkComponent('DataSource::Generic', $initial_locator, $this->_args['options']['data_locator_meta']); |
//$url = $_SERVER['PHP_SELF'] . "?" . $this->_control['page_ident_label'] . "=d_list&l_label=" . $value; |
23 |
$source = $proxy->get_adapter(); |
$url = $_SERVER['PHP_SELF'] . "?ap=explorer&ecl=content&ect=data&ecdlk=rpc&ecat=list&ecdid=$value"; |
24 |
$source->do_query(); |
$this->nav->add($url, $value, $alt_caption); |
|
|
|
|
// 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."); |
|
|
|
|
25 |
} |
} |
26 |
|
|
|
return $nav; |
|
|
|
|
27 |
} |
} |
28 |
|
|
29 |
} |
} |
30 |
|
|
31 |
|
|
|
|
|
32 |
?> |
?> |