TreeAction Klassenreferenz

Klassendiagramm für TreeAction:

Inheritance graph
base refererrect $classAction.html 6,7 190,463

Aufstellung aller Elemente

Öffentliche Methoden

 openall ()
 open ()
 close ()
 load ()
 outputElement ($elId, $tiefe, $isLast)
 show ()

Öffentliche Attribute

 $defaultSubAction = 'load'
 $tree


Ausführliche Beschreibung

Definiert in Zeile 77 der Datei TreeAction.class.php.


Dokumentation der Elementfunktionen

TreeAction::close (  ) 

Schlie?en eines Baumelementes

Definiert in Zeile 107 der Datei TreeAction.class.php.

Benutzt Action::callSubAction(), Action::getRequestId(), Session::getTree() und Session::setTree().

00108      {
00109           $this->tree = Session::getTree();
00110           $this->tree->close( $this->getRequestId() );
00111           Session::setTree( $this->tree );
00112 
00113           $this->callSubAction('show');
00114      }

TreeAction::load (  ) 

Neues Laden des Baumes

Definiert in Zeile 120 der Datei TreeAction.class.php.

Benutzt $SESS, Model::getDefaultId(), Language::getDefaultId(), Session::getProject() und Session::setTree().

00121      {
00122           global $SESS;
00123           $project   = Session::getProject();
00124           $projectid = $project->projectid; 
00125 
00126           // Erzeugen des Menue-Baums
00127           //
00128      
00129           if   ( $projectid == -1 )
00130           {
00131                $this->tree = new AdministrationTree();
00132                
00133           }
00134           else
00135           {
00136                $this->tree = new ProjectTree();
00137                $this->tree->projectId = $projectid;
00138 
00139                $SESS[REQ_PARAM_LANGUAGE_ID] = Language::getDefaultId();
00140                $SESS['modelid'   ] = Model::getDefaultId();
00141           }
00142 
00143           Session::setTree( $this->tree );
00144      }

TreeAction::open (  ) 

?ffnen eines Baumelementes

Definiert in Zeile 94 der Datei TreeAction.class.php.

Benutzt Action::callSubAction(), Action::getRequestId(), Session::getTree() und Session::setTree().

00095      {
00096           $this->tree = Session::getTree();
00097           $this->tree->open( $this->getRequestId() );
00098           Session::setTree( $this->tree );
00099 
00100           $this->callSubAction('show');
00101      }

TreeAction::openall (  ) 

?ffnen aller Baumelemente

Definiert in Zeile 86 der Datei TreeAction.class.php.

00087      {
00088      }

TreeAction::outputElement ( elId,
tiefe,
isLast 
)

Liefert ein Array mit allen Zeilen des Baumes.

Ruft sich intern rekursiv auf.

Parameter:
$elId 
$tiefe 
$isLast 
Rückgabe:
unknown_type

Definiert in Zeile 157 der Datei TreeAction.class.php.

Benutzt lang() und Html::url().

Wird benutzt von show().

00158      {
00159           $treeElement = $this->tree->elements[$elId]; 
00160 
00161           $zeilen = array();
00162           $zeile  = array();
00163      
00164           if   ( !isset($tree_last) )
00165                $tree_last=array();
00166      
00167           $zeile['cols'] = array();
00168      
00169           for  ( $i=1; $i<=$tiefe-1; $i++ )
00170           {
00171                if   ( $isLast[$i] )
00172                     $zeile['cols'][] = 'blank';
00173                else
00174                     $zeile['cols'][] = 'line';
00175           }
00176 
00177           if   ( $tiefe == 0 )
00178           {
00179           }
00180           elseif   ( $treeElement->type != "" )
00181           {
00182                if   ( count($treeElement->subElementIds) == 0 )
00183                {
00184                     if   ( $isLast[$tiefe] )
00185                          $zeile['image'] = 'plus_end';
00186                     else $zeile['image'] = 'plus';
00187 
00188                     $zeile['image_url'     ] = Html::url('tree','open',$elId);
00189                     $zeile['image_url_desc'] = lang('TREE_OPEN_ELEMENT');
00190                }
00191                else
00192                {
00193                     if   ( $isLast[$tiefe] )
00194                          $zeile['image'] = 'minus_end';
00195                     else $zeile['image'] = 'minus';
00196 
00197                     $zeile['image_url'     ] = Html::url('tree','close',$elId);
00198                     $zeile['image_url_desc'] = lang('TREE_CLOSE_ELEMENT');
00199                }
00200           }
00201           else
00202           {
00203                if   ( $isLast[$tiefe] )
00204                     $zeile['image'] = 'none_end';
00205                else $zeile['image'] = 'none';
00206           }
00207           
00208 
00209      
00210           $zeile['icon'] = $treeElement->icon;
00211           $zeile['text'] = $treeElement->text;
00212           $zeile['desc'] = $treeElement->description;
00213           $zeile['name'] = $elId;
00214 
00215           // Url setzen
00216           if   ( $treeElement->url != "" )
00217                $zeile['url']  = $treeElement->url;
00218 
00219           // HTML-Target setzen
00220           if   ( $treeElement->target != "" )
00221                $zeile['target'] = $treeElement->target;
00222           else
00223                $zeile['target'] = 'cms_main';
00224           
00225           $zeile['colspan'] = 20 - count( $zeile['cols'] ) - intval(isset($zeile['image']));
00226 
00227           $zeilen[] = $zeile;
00228           // Rekursiv alle Unter-Elemente lesen
00229           $nr = 0;
00230           foreach( $this->tree->elements[$elId]->subElementIds as $subElementId )
00231           {
00232                $nr++;
00233                if   ( $nr == count($this->tree->elements[$elId]->subElementIds) )
00234                     $isLast[$tiefe+1] = true;
00235                else $isLast[$tiefe+1] = false;
00236 
00237                // Rekursiver Aufruf
00238                $zeilen = array_merge( $zeilen,$this->outputElement( $subElementId,$tiefe+1,$isLast ) );
00239           }
00240                
00241           return $zeilen;
00242      }

TreeAction::show (  ) 

Anzeigen des Baumes

Definiert in Zeile 248 der Datei TreeAction.class.php.

Benutzt $SESS, $tree, outputElement() und Action::setTemplateVars().

00249      {
00250           global
00251                $tree,
00252                $SESS,
00253                $tree_last,
00254                $var;
00255 
00256           $var['zeilen'] = array();
00257           $var['zeilen'] = $this->outputElement( 0,0,array() );
00258 
00259           $this->setTemplateVars( $var );
00260      }


Dokumentation der Datenelemente

TreeAction::$defaultSubAction = 'load'

Definiert in Zeile 79 der Datei TreeAction.class.php.

TreeAction::$tree

Definiert in Zeile 80 der Datei TreeAction.class.php.

Wird benutzt von show().


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:

Erzeugt am Thu May 14 00:55:51 2009 für OpenRat von  doxygen 1.5.8