TeaserList.class.php
gehe zur Dokumentation dieser Datei00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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
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
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
00089 foreach( $folder->getObjects() as $o )
00090 {
00091 if ( $o->isPage )
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 }