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.2 2004-12-19 15:19:16 dankert 00024 // Klasse erbt von "Dynamic" 00025 // 00026 // Revision 1.1 2004/10/14 21:15:57 dankert 00027 // Erzeugen eines Hauptmenues 00028 // 00029 // --------------------------------------------------------------------------- 00030 00031 00032 00037 class MainMenu extends Dynamic 00038 { 00043 var $parameters = Array( 00044 'arrowChar'=>'String between menu entries, default: "·"' 00045 ); 00046 00047 00048 var $arrowChar = ' · '; 00049 00054 var $description = 'Creates a main menu.'; 00055 var $version = '$Id$'; 00056 00057 // Erstellen des Hauptmenues 00058 function execute() 00059 { 00060 // Lesen des Root-Ordners 00061 $folder = new Folder( $this->getRootObjectId() ); 00062 00063 // Schleife ueber alle Inhalte des Root-Ordners 00064 foreach( $folder->getObjectIds() as $id ) 00065 { 00066 $o = new Object( $id ); 00067 $o->languageid = $this->page->languageid; 00068 $o->load(); 00069 if ( $o->isFolder ) // Nur wenn Ordner 00070 { 00071 $f = new Folder( $id ); 00072 00073 // Ermitteln eines Objektes mit dem Dateinamen index 00074 $oid = $f->getObjectIdByFileName('index'); 00075 if ( is_numeric($oid) && $oid!=0 ) 00076 $this->output( $this->arrowChar.'<a href="'.$this->page->path_to_object($oid).'" title="'.$o->desc.'">'.$o->name.'</a>' ); 00077 } 00078 } 00079 } 00080 }
1.5.8