/[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.4 by jonen, Sun Apr 6 01:44:52 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.4  2003/04/06 01:44:52  jonen
8  ##    + initial commit, example of a simple NavigationList  ##    + build links now with help of LinkBuilder class
9    ##      (one id instead of a bunch of variables... ;)
10  ##  ##
11  ##    Revision 1.1  2003/03/01 22:57:23  cvsmax  ##    Revision 1.3  2003/04/05 21:17:16  joko
12  ##    + inital commit  ##    moved code to AbstractNavigationList.php
13  ##  ##
14  ##  ##
15  ##    -----------------------------------------------------------------------------  ##    -----------------------------------------------------------------------------
16  */  */
17    
18  loadModule('WebExplorer::Module::AbstractGUIModule');  loadModule('WebExplorer::Module::AbstractNavigationList');
19    
20  class WebExplorer_Module_NavigationList extends WebExplorer_Module_AbstractGUIModule {  class WebExplorer_Module_NavigationList extends WebExplorer_Module_AbstractNavigationList {
21    
22    function set_gui_object() {    function propagate() {
23      $this->_gui_object = $this->buildNavList();      $linkbuilder = new LinkBuilder();
24    }  
25        $link_vars = array(
26                                 'ap' => "explorer",
27                                 'ecl' => "content",
28                                 'ect' => "data",
29                                 'ecdlk' => "rpc",
30                                 'ecat' => "list",
31                                 );
32    
33        foreach ($this->result as $value) {
34          $alt_caption = "Alle Elemente des Typs '$value' anzeigen.";
35    
36          // V1: hmm...long time ago...
37          //$url = $_SERVER['PHP_SELF'] . "?" . $this->_control['page_ident_label'] . "=d_list&l_label=" . $value;
38    
39            // V2: simple add vars to url
40    function buildNavList() {        //$url = $_SERVER['PHP_SELF'] . "?ap=explorer&ecl=content&ect=data&ecdlk=rpc&ecat=list&ecdid=$value";
41      print Dumper($this->_args);  
42        $initial_locator = php::mkComponent( 'DataSource::Locator', array( adapter_type => 'phpHtmlLib' ) );        // V3: use LinkBuilder to save vars at session and get unique id instead
43        $proxy = php::mkComponent('DataSource::Generic', $initial_locator, $this->_args['options']['data_locator_meta']);        $link_vars['ecdid'] = $value;
44        $source = $proxy->get_adapter();        $link_guid = $linkbuilder->save($link_vars);
45        $source->do_query();        $url = $_SERVER['PHP_SELF'] . "?lbid=" . $link_guid;
46        $result = $source->_result;  
47              $this->nav->add($url, $value, $alt_caption);
     //print Dumper($source->_result);  
       
     $nav = new VerticalCSSNavTable($this->_args['caption'], "", $width="100%");  
             
     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);  
       }  
48      }      }
49    
     return $nav;      
50    }    }
51    
52  }  }
53    
54    
   
55  ?>  ?>

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

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