1 |
joko |
1.1 |
<? |
2 |
|
|
/* |
3 |
|
|
## ----------------------------------------------------------------------------- |
4 |
|
|
## $Id: NavigationList.php,v 1.2 2003/03/28 03:06:48 joko Exp $ |
5 |
|
|
## ----------------------------------------------------------------------------- |
6 |
|
|
## $Log: NavigationList.php,v $ |
7 |
|
|
## Revision 1.2 2003/03/28 03:06:48 joko |
8 |
|
|
## enhanced: now aware of "No data." |
9 |
|
|
## |
10 |
|
|
## Revision 1.1 2003/03/27 01:26:18 jonen |
11 |
|
|
## + initial commit, example of a simple NavigationList |
12 |
|
|
## |
13 |
|
|
## Revision 1.1 2003/03/01 22:57:23 cvsmax |
14 |
|
|
## + inital commit |
15 |
|
|
## |
16 |
|
|
## |
17 |
|
|
## ----------------------------------------------------------------------------- |
18 |
|
|
*/ |
19 |
|
|
|
20 |
|
|
loadModule('WebExplorer::Module::AbstractGUIModule'); |
21 |
|
|
|
22 |
|
|
class WebExplorer_Module_AbstractNavigationList extends WebExplorer_Module_AbstractGUIModule { |
23 |
|
|
|
24 |
|
|
var $source; |
25 |
|
|
var $nav; |
26 |
|
|
var $result; |
27 |
|
|
|
28 |
|
|
function set_gui_object() { |
29 |
|
|
$this->_gui_object = $this->buildNavList(); |
30 |
|
|
} |
31 |
|
|
|
32 |
|
|
|
33 |
|
|
function buildNavList() { |
34 |
|
|
|
35 |
|
|
// query data |
36 |
|
|
$initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) ); |
37 |
|
|
$proxy = php::mkComponent('DataSource::Generic', $initial_locator, $this->_args['options']['data_locator_meta']); |
38 |
|
|
$this->source = $proxy->get_adapter(); |
39 |
|
|
$this->source->do_query(); |
40 |
|
|
|
41 |
|
|
// trace |
42 |
|
|
//print Dumper($initial_locator); |
43 |
|
|
//print Dumper($this->_args); |
44 |
|
|
|
45 |
|
|
$this->nav = new VerticalCSSNavTable($this->_args['caption'], "", $width="100%"); |
46 |
|
|
|
47 |
|
|
// check valid/non-empty result |
48 |
|
|
if ($itemCount = $this->source->get_total_rows()) { |
49 |
|
|
$this->result = $this->source->_result; |
50 |
|
|
|
51 |
|
|
// trace |
52 |
|
|
//print Dumper($source->_result); |
53 |
|
|
|
54 |
|
|
//if (is_array($result)) { |
55 |
|
|
$this->propagate(); |
56 |
|
|
//} |
57 |
|
|
|
58 |
|
|
} else { |
59 |
|
|
|
60 |
|
|
// both are valid! (at least - should be...) |
61 |
|
|
//$nav->add(pageLink('explorer'), "No data."); |
62 |
|
|
$this->nav->add(topicLink('DataBrowser'), "No data."); |
63 |
|
|
|
64 |
|
|
} |
65 |
|
|
|
66 |
|
|
return $this->nav; |
67 |
|
|
|
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
function propagate() { |
71 |
|
|
//print get_class($this) . ": " . "Please implement 'propagate |
72 |
|
|
$this->_abstract_method('propagate', get_class($this)); |
73 |
|
|
} |
74 |
|
|
|
75 |
|
|
} |
76 |
|
|
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
?> |