DoiMenu.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.1  2005-01-04 20:31:52  dankert
00024 // Neues Menue
00025 //
00026 // Revision 1.1  2005/01/04 20:00:12  dankert
00027 // Darstellung eines DHTML-Menues
00028 //
00029 // Revision 1.2  2004/12/28 22:57:56  dankert
00030 // Korrektur Vererbung, "api" ausgebaut
00031 //
00032 // Revision 1.1  2004/10/14 21:15:29  dankert
00033 // Erzeugen und Anzeigen einer Sitemap
00034 //
00035 // ---------------------------------------------------------------------------
00036 
00037 
00038 
00047 class DoiMenu extends Dynamic
00048 {
00053      var $description = 'You *have to* include doiMenuDOM.js in the page!<br/>Put the code below in head section:<br/><tt>&lt;script type="text/javascript" src="{{your-elementname}}.js"&gt;&lt;/script&gt;</tt><br/>The file is distributed with OpenRat';
00054 
00055 
00060      var $parameterFileId = 0;
00061      
00066      var $direction = 'horizontal';
00067 
00068      
00072      function execute()
00073      {
00074           // Erstellen eines Untermenues
00075           
00076           // Ermitteln der aktuellen Seite
00077           $thispage = new Page( $this->getObjectId() );
00078           $thispage->load(); // Seite laden
00079           
00080           $this->outputLn('<script name="javascript" type="text/javascript">');
00081 
00082           $this->outputLn("  var menu = new TMainMenu('menu','".$this->direction."');");
00083 
00084           $ro = new Folder($this->getRootObjectId());
00085           $this->showFolder( $ro );
00086 
00087           if   ( intval( $this->parameterFileId ) != 0 )
00088           {
00089                $f = new File( intval($this->parameterFileId) );
00090                $this->outputLn( $f->loadValue() );
00091           }
00092           
00093           $this->outputLn( '  menu.Build()' );
00094           $this->outputLn( '</script');
00095      }
00096      
00097      
00098      function showFolder( $fo )
00099      {
00100           if   ( $fo->objectid == intval($this->getRootObjectId()) )
00101                $parentMenu = 'menu';
00102           else
00103                $parentMenu = 'menu'.$fo->objectid;
00104 
00105           foreach( $fo->getObjects() as $o )
00106           {
00107                $menu = 'menu'.$o->objectid;
00108 
00109                if   ( $o->isFolder )
00110                {    $nf = new Folder($o->objectid);
00111                     $pl = $nf->getFirstPageOrLink();
00112                     if   ( is_object($pl) )
00113                     {
00114                          $this->outputLn(" var $menu = new TPopMenu('".$o->name."','','a','".$this->pathToObject($pl->objectid)."','".$o->desc."');");
00115                          $this->outputLn(" $parentMenu.Add(menu".$o->objectid.");");
00116                          $this->showFolder( $nf );
00117                     }
00118                }
00119 
00120                if   ( $o->isPage || $o->isPage )
00121                {
00122                     $this->outputLn(" var $menu = new TPopMenu('".$o->name."','','a','".$this->pathToObject($o->objectid)."','".$o->desc."');");
00123                     $this->outputLn(" $parentMenu.Add(menu".$o->objectid.");");
00124                }
00125           }
00126      }
00127 
00128 }
00129 
00130 ?>

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