/[cvs]/nfo/php/libs/org.netfrag.app/WebExplorer/Module/NavigationList.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.app/WebExplorer/Module/NavigationList.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by joko, Fri Mar 28 03:06:48 2003 UTC revision 1.8 by jonen, Fri Apr 18 13:33:44 2003 UTC
# Line 4  Line 4 
4  ##    $Id$  ##    $Id$
5  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
6  ##    $Log$  ##    $Log$
7  ##    Revision 1.2  2003/03/28 03:06:48  joko  ##    Revision 1.8  2003/04/18 13:33:44  jonen
8  ##    enhanced: now aware of "No data."  ##    CHANGE: link_vars now are passed by contructor arguments
9    ##      (so that the AbstractExplorer could handle these...)
10  ##  ##
11  ##    Revision 1.1  2003/03/27 01:26:18  jonen  ##    Revision 1.7  2003/04/16 16:13:04  joko
12  ##    + initial commit, example of a simple NavigationList  ##    updates to 'function propagate': + minor cosmetic update, ++ special mode: 'tree' if value of node ends with '.xml'
13  ##  ##
14  ##    Revision 1.1  2003/03/01 22:57:23  cvsmax  ##    Revision 1.6  2003/04/08 22:40:06  joko
15  ##    + inital commit  ##    renamed / revamped shortcut to LinkBuilder (now via url::short)
16    ##
17    ##    Revision 1.5  2003/04/06 04:26:43  joko
18    ##    shortcut for LinkBuilder
19    ##
20    ##    Revision 1.4  2003/04/06 01:44:52  jonen
21    ##    + build links now with help of LinkBuilder class
22    ##      (one id instead of a bunch of variables... ;)
23    ##
24    ##    Revision 1.3  2003/04/05 21:17:16  joko
25    ##    moved code to AbstractNavigationList.php
26  ##  ##
27  ##  ##
28  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
29  */  */
30    
31  loadModule('WebExplorer::Module::AbstractGUIModule');  loadModule('WebExplorer::Module::AbstractNavigationList');
32    
33  class WebExplorer_Module_NavigationList extends WebExplorer_Module_AbstractGUIModule {  class WebExplorer_Module_NavigationList extends WebExplorer_Module_AbstractNavigationList {
34    
35    function set_gui_object() {    function propagate() {
     $this->_gui_object = $this->buildNavList();  
   }  
36    
37          // default link arguments to branch to a list
38    function buildNavList() {     //$link_vars = array(
39       //   'ap' => "explorer",
40      // query data     //   'ecl' => "content",
41        $initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) );     //   'ect' => "data",
42        $proxy = php::mkComponent('DataSource::Generic', $initial_locator, $this->_args['options']['data_locator_meta']);     //   'ecdlk' => "rpc",
43        $source = $proxy->get_adapter();     //   'ecat' => "list",
44        $source->do_query();     // );
45      
46      // trace     $link_vars = $this->_args['hidden_items'];
     //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;  
47            
48        // trace      foreach ($this->result as $value) {
49        //print Dumper($source->_result);        $alt_caption = "Alle Elemente unterhalb von '$value' anzeigen.";
50          
51        //if (is_array($result)) {        // V1: hmm...long time ago...
52          foreach($result as $value) {        //$url = $_SERVER['PHP_SELF'] . "?" . $this->_control['page_ident_label'] . "=d_list&l_label=" . $value;
53            $alt_caption = "Alle Elemente des Types $value anzeigen";  
54            //$url = $_SERVER['PHP_SELF'] . "?" . $this->_control['page_ident_label'] . "=d_list&l_label=" . $value;        // V2: simple add vars to url
55            $url = $_SERVER['PHP_SELF'] . "?ap=explorer&ecl=content&ect=data&ecdlk=rpc&ecat=list&ecdid=$value";        //$url = $_SERVER['PHP_SELF'] . "?ap=explorer&ecl=content&ect=data&ecdlk=rpc&ecat=list&ecdid=$value";
56            $nav->add($url, $value, $alt_caption);  
57          }        // V3: use LinkBuilder to save vars at session and get unique id instead
58        //}        $link_vars['ecdid'] = $value;
59      
60      } else {        // modify default link if name of linked node contains '.xml'
61          if (stristr($value, '.xml')) {
62            $link_vars['ecat'] = 'tree';
63          }
64                
65        // both are valid! (at least - should be...)        // encoded links: shorter and more cryptic   ;-)
66        //$nav->add(pageLink('explorer'), "No data.");        // drawback: guid generation might be expensive,
67        $nav->add(topicLink('DataBrowser'), "No data.");        // check out guid-pre-generation into some queue...
68              // V1
69      }        //$link_guid = link::store($link_vars);
70          //$url = $_SERVER['PHP_SELF'] . "?lbid=" . $link_guid;
71          // V2
72          $url = url::short(null, $link_vars);
73    
74      return $nav;            $this->nav->add($url, $value, $alt_caption);
75        }
76    
77    }    }
78    
79  }  }
80    
81    
   
82  ?>  ?>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.8

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed