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 2005-01-04 19:59:55 dankert 00024 // Allgemeine Korrekturen, Erben von "Dynamic"-klasse 00025 // 00026 // Revision 1.1 2004/11/10 22:43:35 dankert 00027 // Beispiele fuer dynamische Templateelemente 00028 // 00029 // --------------------------------------------------------------------------- 00030 00031 00032 00037 class NextPage 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 var $api; 00057 00058 00059 function execute() 00060 { 00061 // Lesen des Ordners 00062 $folder = new Folder( $this->page->parentid ); 00063 00064 $was = false; 00065 00066 // Schleife ueber alle Inhalte des Root-Ordners 00067 foreach( $folder->getObjects() as $o ) 00068 { 00069 if ( $o->isPage || $o->isLink ) // Nur wenn Ordner 00070 { 00071 if ( $o->objectid == $this->page->objectid ) 00072 { 00073 $was = true; 00074 continue; 00075 } 00076 00077 if ( $was ) 00078 { 00079 $this->output( '<a href="'.$this->pathToObject($o->objectid).' class="next">'.$o->name.'</a>' ); 00080 break; 00081 } 00082 } 00083 } 00084 } 00085 }
1.5.8