Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezsimplerenderer.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezsimplerenderer.php 6206 2001-07-19 12:19:22Z jakobn $
5 //
6 // Definition of eZSimpleRenderer class
7 //
8 // Created on: <18-Oct-2000 17:45:32 bf>
9 //
10 // This source file is part of Exponential Basic, publishing software.
11 //
12 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
30
36 // include_once( "classes/eztexttool.php" );
37
38 class eZSimpleRenderer
39 {
43 function __construct( &$article )
44 {
45 $this->Article = $article;
46 }
47
51 function &renderIntro()
52 {
53 $xml = xmltree( $this->Article->contents() );
54
55 if ( !$xml )
56 {
57 print( "<br /><b>Error: eZSimpleRenderer::docodeXML() could not decode XML</b><br />" );
58 }
59 else
60 {
61 $into = "";
62 $body = "";
63
64 $i=0;
65 foreach ( $xml->root->children as $child )
66 {
67 if ( $child->name == "intro" )
68 {
69 $intro = $child->children[0]->content;
70 }
71 }
72
73 $newArticle = eZTextTool::nl2br( $intro );
74 }
75
76 return $newArticle;
77 }
78
82 function &renderPage( $page=0 )
83 {
84 $xml = xmltree( $this->Article->contents() );
85
86 if ( !$xml )
87 {
88 print( "<br /><b>Error: eZSimpleRenderer::docodeXML() could not decode XML</b><br />" );
89 }
90 else
91 {
92 $into = "";
93 $body = "";
94
95 $i=0;
96 foreach ( $xml->root->children as $child )
97 {
98 if ( $child->name == "intro" )
99 {
100 $intro = $child->children[0]->content;
101 }
102
103 if ( $child->name == "body" )
104 {
105 $body = $child->children[0]->content;
106 }
107 }
108
109 $newArticle = eZTextTool::nl2br( $intro ) . "</p><p>". eZTextTool::nl2br( $body );
110 }
111
112 return $newArticle;
113 }
114
115 var $Article;
116 }
117
118 ?>
$i
$i
Definition: admin/adlist.php:91
$article
$article
Definition: articlelog.php:45
eZSimpleRenderer
Definition: ezsimplerenderer.php:39
eZSimpleRenderer\renderPage
& renderPage( $page=0)
Definition: ezsimplerenderer.php:82
eZSimpleRenderer\$Article
$Article
Definition: ezsimplerenderer.php:115
eZSimpleRenderer\renderIntro
& renderIntro()
Definition: ezsimplerenderer.php:51
eZSimpleRenderer\__construct
__construct(&$article)
Definition: ezsimplerenderer.php:43
eZTextTool\nl2br
static nl2br( $string, $xhtml=true)
Definition: eztexttool.php:65
$page
$page
Definition: ezarticle/modules/content.php:28
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.