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