BlockMenu.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.2  2004-12-25 21:05:14  dankert
00024 // erbt von Klasse Dynamic
00025 //
00026 // Revision 1.1  2004/10/14 21:16:12  dankert
00027 // Erzeugen eines Menues in Bloecken
00028 //
00029 // ---------------------------------------------------------------------------
00030 
00031 
00032 
00037 class BlockMenu extends Dynamic
00038 {
00043      var $parameters  = Array(
00044           'arrowChar'=>'String between menu entries, default: "&middot;"'
00045           );
00046 
00047 
00048      var $arrowChar = ' &middot; ';
00049 
00054      var $description = 'Creates a main menu.';
00055      var $version     = '$Id$';
00056      var $api;
00057 
00058      // Erstellen des Hauptmenues
00059      function execute()
00060      {
00061           // Erstellen des Hauptmenues
00062           
00063           // Lesen des Root-Ordners
00064           $folder = new Folder( $this->getRootObjectId() );
00065           
00066           // Schleife ueber alle Inhalte des Root-Ordners
00067           foreach( $folder->getObjectIds() as $id )
00068           {
00069                $o = new Object( $id );
00070                $o->languageid = $this->page->languageid;
00071                $o->load();
00072                if ( $o->isFolder ) // Nur wenn Ordner
00073                {
00074                     $f = new Folder( $id );
00075                     
00076                     // Ermitteln eines Objektes mit dem Dateinamen index
00077                     $oid = $f->getObjectIdByFileName('index');
00078                     
00079                     if   ( count($f->getLinks())+count($f->getPages()) > 0 )
00080                     {
00081                          $this->output( '
00082                <!-- sidebox -->
00083                <table bgcolor="#000000" border="0" cellpadding="0" cellspacing="0" width="100%">
00084                 <tr>
00085                  <td>
00086                   <table border="0" cellpadding="3" cellspacing="1" width="100%">
00087                    <tr>
00088                     <td bgcolor="#cccccc"><span class="title"> '.$o->name.'</span></a>
00089                     </td>
00090                    </tr>
00091                    <tr>
00092                     <td bgcolor="#ffffff">
00093      ');
00094                          // Untermenue
00095                          // Schleife ber alle Objekte im aktuellen Ordner
00096                          foreach( $f->getObjectIds() as $xid )
00097                         {
00098                               $o = new Object( $xid );
00099                               $o->languageid = $this->page->languageid;
00100                               $o->load();
00101                     
00102                               // Nur Seiten anzeigen
00103                               if (!$o->isPage && !$o->isLink ) continue;
00104                               
00105                               // Wenn aktuelle Seite, dann markieren, sonst Link
00106                               if ( $this->getObjectId() == $xid )
00107                               {
00108                                    // aktuelle Seite
00109                                    $this->output( '            <span class="small">o</span>
00110                                    <strong class="nav">'.$o->name.'</strong>
00111                                    <br />' );
00112                               }
00113                               else
00114                               {
00115                                    $this->output( '            <span class="small">o</span>
00116                                      <a class="nav" href="'.$this->page->path_to_object($xid).'">'.$o->name.'</a>
00117                                      <br />' );
00118                               }
00119                          //Api::output( '<br/>' );
00120                          }
00121                
00122                          $this->output( '
00123                          </td>
00124                         </tr>
00125                        </table>
00126                       </td>
00127                      </tr>
00128                     </table>
00129                     <!-- end sidebox -->
00130                <br />
00131                          ' );
00132                     }
00133                }
00134           }
00135      }
00136 }

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