TeaserList.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  2005-01-04 19:59:55  dankert
00024 // Allgemeine Korrekturen, Erben von "Dynamic"-klasse
00025 //
00026 // Revision 1.1  2004/10/14 21:15:43  dankert
00027 // Anzeige einer Nachrichtenliste
00028 //
00029 // ---------------------------------------------------------------------------
00030 
00031 
00032 
00037 class TeaserList extends Dynamic
00038 {
00043      var $parameters  = Array(
00044           'folderid'             =>'Id of the folder whose pages should go into the list, default: the root folder',
00045           'forward_text'         =>'Link text, default: "read more..."',
00046           'title_html_tag'       =>'HTML-Tag for the titles, default: "h2"',
00047           'title_css_class'      =>'CSS-Class to use for title, default: ""',
00048           'description_css_class'=>'CSS-Class to use for description, default: ""',
00049           'link_css_class'       =>'CSS-Class to use for the forward link, default: ""'
00050           );
00051 
00052      var $folderid              = 0;
00053      var $forward_text          = 'read more ...';
00054      var $title_html_tag        = 'h2';
00055      var $title_css_class       = '';
00056      var $description_css_class = '';
00057      var $link_css_class        = '';
00058 
00063      var $description = 'Creates a teaser list of pages in a folder';
00064      var $api;
00065 
00066      // Erstellen des Hauptmenues
00067      function execute()
00068      {
00069           $feed = array();
00070 
00071           if   ( !empty($this->title_css_class) )
00072                $this->title_css_class       = ' class="'.$this->title_css_class.'"';
00073 
00074           if   ( !empty($this->description_css_class) )
00075                $this->description_css_class = ' class="'.$this->description_css_class.'"';
00076 
00077           if   ( !empty($this->link_css_class) )
00078                $this->link_css_class        = ' class="'.$this->link_css_class.'"';
00079 
00080           // Lesen des Root-Ordners
00081           if   ( intval($this->folderid) == 0 )
00082                $folder = new Folder( $this->getRootObjectId() );
00083           else
00084                $folder = new Folder( intval($this->folderid) );
00085 
00086           $folder->load();
00087 
00088           // Schleife ueber alle Inhalte des Root-Ordners
00089           foreach( $folder->getObjects() as $o )
00090           {
00091                if ( $o->isPage ) // Nur wenn Ordner
00092                {
00093                     $p = new Page( $id );
00094                     $p->load();
00095 
00096                     $this->output( '<'.$this->title_html_tag.$this->title_css_class.'>'.$p->name.'</'.$this->title_html_tag.'>' );
00097                     $this->output( '<p'.$this->description_css_class.'>'.$p->desc.'</p>' );
00098                     $this->output( '<p><a href="'.$this->pathToObject($o->objectid).'"'.$this->link_css_class.'>'.$this->forward_text.'</a></p>' );
00099                }
00100           }
00101      }
00102 }

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