BreadCrumb.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-30 23:25:25  dankert
00024 // Das Men? in der Sprache der zu ver?ffentlichenden Seite erzeugen.
00025 //
00026 // Revision 1.2  2005/01/04 19:59:55  dankert
00027 // Allgemeine Korrekturen, Erben von "Dynamic"-klasse
00028 //
00029 // Revision 1.1  2004/11/10 22:43:35  dankert
00030 // Beispiele fuer dynamische Templateelemente
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 = '&raquo;';
00061      
00062      var $api;
00063 
00067      function execute()
00068      {
00069           // Erstellen eines Untermenues
00070           
00071           // Ermitteln der aktuellen Seite
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 ?>

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