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

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.9

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