ClassicMenu.class.php

gehe zur Dokumentation dieser Datei
00001 <?php
00002 // ---------------------------------------------------------------------------
00003 // $Id$
00004 // ---------------------------------------------------------------------------
00005 // OpenRat Content Management System
00006 // Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de
00007 //
00008 // This program is free software; you can redistribute it and/or
00009 // modify it under the terms of the GNU General Public License
00010 // as published by the Free Software Foundation; either version 2
00011 // of the License, or (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the Free Software
00020 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021 // ---------------------------------------------------------------------------
00022 // $Log$
00023 // Revision 1.3  2007-11-29 22:09:06  dankert
00024 // Das Men? in der Sprache der zu ver?ffentlichenden Seite erzeugen.
00025 //
00026 // Revision 1.2  2005/01/04 21:01:24  dankert
00027 // Benutzen von CSS-Klassen
00028 //
00029 // Revision 1.1  2005/01/04 19:59:55  dankert
00030 // Allgemeine Korrekturen, Erben von "Dynamic"-klasse
00031 //
00032 // Revision 1.3  2004/12/19 22:35:23  dankert
00033 // Parameter -Angabe
00034 //
00035 // Revision 1.2  2004/12/19 15:19:29  dankert
00036 // Klasse erbt von "Dynamic"
00037 //
00038 // Revision 1.1  2004/11/10 22:43:35  dankert
00039 // Beispiele fuer dynamische Templateelemente
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      // Erstellen des Hauptmenues
00067      function execute()
00068      {
00069           $rootId = $this->getRootObjectId();
00070           // Erstellen eines Untermenues
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           // Schleife ueber alle Objekte im aktuellen Ordner
00084           foreach( $f->getObjects() as $o )
00085           {
00086                $o->languageid = $this->page->languageid;
00087                $o->load();
00088                
00089                // Ordner anzeigen
00090                if ($o->isFolder )
00091                {
00092                     $nf = new Folder($o->objectid);
00093                     $fp = $nf->getFirstPageOrLink();
00094                     
00095                     if   ( is_object($fp) )
00096                     {
00097      
00098                          // Wenn aktuelle Seite, dann markieren, sonst Link
00099                          if ( $this->page->objectid == $fp->objectid )
00100                               // aktuelle Seite
00101                               $this->outputLn( '<li class="'.$this->csspraefix.$level.'"><strong class="'.$this->csspraefix.$level.'">'.$o->name.'</strong><br/>' );
00102                          else
00103                               // Link erzeugen
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                // Seiten und Verknuepfungen anzeigen
00116                if ($o->isPage ||  $o->isLink )
00117                {
00118                     // Wenn aktuelle Seite, dann markieren, sonst Link
00119                     if ( $this->getObjectId() == $o->objectid)
00120                          // aktuelle Seite
00121                          $this->output( '<li class="'.$this->csspraefix.$level.'"><strong class="'.$this->csspraefix.$level.'">'.$o->name.'</strong></li>' );
00122                     else
00123                          // Link erzeugen
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 }

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