BreadCrumb.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
00040 class BreadCrumb extends Dynamic
00041 {
00046 var $parameters = Array(
00047 'beforeEntry'=>'Chars before an active menu entry'
00048 );
00049
00054 var $description = 'Creates a main menu.';
00055
00056
00060 var $beforeEntry = '»';
00061
00062 var $api;
00063
00067 function execute()
00068 {
00069
00070
00071
00072 $f = new Folder($this->page->parentid);
00073 $parentIds = $f->parentObjectIds(false,true);
00074 $lastoid = 0;
00075
00076 foreach( $parentIds as $oid )
00077 {
00078 $of = new Folder($oid);
00079 $of->languageid = $this->page->languageid;
00080 $of->load();
00081 $pl = $of->getFirstPageOrLink();
00082
00083 $this->output( $this->beforeEntry );
00084
00085 if ( is_object($pl) && $pl->objectid != $this->page->objectid )
00086 $this->output('<a href="'.$this->pathToObject($pl->objectid).'" class="breadcrumb">'.$of->name.'</a>' );
00087 else
00088 $this->output('<span class="breadcrumb">'.$of->name.'</span>' );
00089
00090 if ( is_object($pl) )
00091 $lastoid = $pl->objectid;
00092 }
00093
00094 if ( $lastoid != $this->page->objectid )
00095 {
00096 $this->output( $this->beforeEntry );
00097 $this->output('<span class="breadcrumb">'.$this->page->name.'</span>' );
00098 }
00099
00100 }
00101 }
00102
00103 ?>