Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticlerenderer.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezarticlerenderer.php 8668 2001-12-03 11:03:45Z kaid $
5 //
6 // Definition of eZArticleRenderer class
7 //
8 // Created on: <18-Oct-2000 16:35:33 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
35 class eZArticleRenderer
36 {
37 function __construct( &$article, $template=false )
38 {
39 $this->Generator = false;
40 $this->Article =& $article;
41 $this->Template = $template;
42
43 $contents =& $this->Article->contents();
44
45 //print( nl2br( htmlspecialchars( $contents ) ) );
46
47 // find the generator used
48 if ( preg_match("/<generator>(.*)<\/generator>/", substr( $contents, 0, 200 ), $regs ) )
49 {
50 $generator = $regs[1];
51
52 switch ( $generator )
53 {
54 case "qdom" :
55 {
56 $this->RendererFile = "ezqdomrenderer.php";
57 $this->RendererClass = "eZQDomRenderer";
58 }
59 break;
60
61 case "tech" :
62 {
63 $this->RendererFile = "eztechrenderer.php";
64 $this->RendererClass = "eZTechRenderer";
65 }
66 break;
67
68 case "ez" :
69 {
70 $this->RendererFile = "ezezrenderer.php";
71 $this->RendererClass = "eZEzRenderer";
72 }
73 break;
74
75 case "flower" :
76 {
77 $this->RendererFile = "ezflowerrenderer.php";
78 $this->RendererClass = "eZFlowerRenderer";
79 }
80 break;
81
82 case "simple" :
83 {
84 $this->RendererFile = "ezsimplerenderer.php";
85 $this->RendererClass = "eZSimpleRenderer";
86 }
87 break;
88
89 default:
90 {
91 $this->RendererFile = "ezsimplerenderer.php";
92 $this->RendererClass = "eZSimpleRenderer";
93 }
94 }
95 }
96 else
97 {
98 print( "<b>Error: eZArticleRenderer::eZArticleRenderer() could not find generator in XML chunk.</b>" );
99 }
100 }
101
105 function &renderIntro( )
106 {
107 $generator =& $this->generator();
108
109 return $generator->renderIntro();
110 }
111
118 function &renderPage( $page=0 )
119 {
120 $generator =& $this->generator();
121 // print( "Using renderer: " . $this->RendererClass . "<br>");
122
123 return $generator->renderPage( $page );
124 }
125
129 function usedImageList()
130 {
131 $generator =& $this->generator();
132
133 return $generator->usedImageList();
134 }
135
140 function &generator()
141 {
142 if ( isset( $this->RendererFile ) && $this->Generator == false )
143 {
144 // include_once( "ezarticle/classes/" . $this->RendererFile );
145 $this->Generator = new $this->RendererClass( $this->Article, $this->Template );
146 }
147
148 return $this->Generator;
149 }
150
151
153 var $Generator;
154
155 var $RendererClass;
156 var $RendererFile;
157 var $Template;
158
159 var $Article;
160 }
161
162 ?>
$article
$article
Definition: articlelog.php:45
Template
Definition: template.inc.php:13
eZArticleRenderer
Definition: ezarticlerenderer.php:36
eZArticleRenderer\$Article
$Article
Definition: ezarticlerenderer.php:159
eZArticleRenderer\usedImageList
usedImageList()
Definition: ezarticlerenderer.php:129
eZArticleRenderer\renderPage
& renderPage( $page=0)
Definition: ezarticlerenderer.php:118
eZArticleRenderer\$RendererClass
$RendererClass
Definition: ezarticlerenderer.php:155
eZArticleRenderer\__construct
__construct(&$article, $template=false)
Definition: ezarticlerenderer.php:37
eZArticleRenderer\$RendererFile
$RendererFile
Definition: ezarticlerenderer.php:156
eZArticleRenderer\$Template
$Template
Definition: ezarticlerenderer.php:157
eZArticleRenderer\$Generator
$Generator
varable to store the generator object
Definition: ezarticlerenderer.php:153
eZArticleRenderer\renderIntro
& renderIntro()
Definition: ezarticlerenderer.php:105
eZArticleRenderer\generator
& generator()
Definition: ezarticlerenderer.php:140
$page
$page
Definition: ezarticle/modules/content.php:28
$contents
$contents
Definition: ezarticle/user/extendedsearch.php:52
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.