ClassicMenu.class.php
gehe zur Dokumentation dieser Datei00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00049 class ClassicMenu extends Dynamic
00050 {
00055 var $description = 'This is a dynamic Menue which contains all pages. Folders are opened when useful. Nice standard menu :-)';
00056
00057
00061 var $beforeEntry = '<li><strong>';
00062 var $afterEntry = '</strong></li>';
00063 var $csspraefix = 'menu';
00064
00065
00066
00067 function execute()
00068 {
00069 $rootId = $this->getRootObjectId();
00070
00071
00072 $f = new Folder( $this->page->parentid );
00073 $this->parentFolders = $f->parentObjectIds(false,true);
00074
00075 $this->showFolder( $rootId,0 );
00076 }
00077
00078 function showFolder( $oid,$level )
00079 {
00080 $this->outputLn('<ul class="'.$this->csspraefix.$level.'">');
00081 $f = new Folder( $oid );
00082
00083
00084 foreach( $f->getObjects() as $o )
00085 {
00086 $o->languageid = $this->page->languageid;
00087 $o->load();
00088
00089
00090 if ($o->isFolder )
00091 {
00092 $nf = new Folder($o->objectid);
00093 $fp = $nf->getFirstPageOrLink();
00094
00095 if ( is_object($fp) )
00096 {
00097
00098
00099 if ( $this->page->objectid == $fp->objectid )
00100
00101 $this->outputLn( '<li class="'.$this->csspraefix.$level.'"><strong class="'.$this->csspraefix.$level.'">'.$o->name.'</strong><br/>' );
00102 else
00103
00104 $this->outputLn( '<li class="'.$this->csspraefix.$level.'"><a class="'.$this->csspraefix.$level.'" href="'.$this->pathToObject($fp->objectid).'">'.$o->name.'</a><br/>' );
00105
00106 if ( in_array($o->objectid,$this->parentFolders) )
00107 {
00108 $this->showFolder($o->objectid,$level+1);
00109 }
00110
00111 $this->outputLn( '</li>' );
00112 }
00113 }
00114
00115
00116 if ($o->isPage || $o->isLink )
00117 {
00118
00119 if ( $this->getObjectId() == $o->objectid)
00120
00121 $this->output( '<li class="'.$this->csspraefix.$level.'"><strong class="'.$this->csspraefix.$level.'">'.$o->name.'</strong></li>' );
00122 else
00123
00124 $this->output( '<li class="'.$this->csspraefix.$level.'"><a class="'.$this->csspraefix.$level.'" href="'.$this->pathToObject($o->objectid).'">'.$o->name.'</a></li>' );
00125 }
00126 }
00127 $this->output('</ul>');
00128 }
00129
00130 }