Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticlegenerator.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezarticlegenerator.php 7850 2001-10-15 12:08:50Z jhe $
5 //
6 // Definition of eZArticleGenerator class
7 //
8 // Created on: <18-Oct-2000 15:47:43 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 //
28
31
37 // include_once( "classes/INIFile.php" );
38
39 class eZArticleGenerator
40 {
41 function __construct( $generatorType="" )
42 {
43 if ( $generatorType == "" )
44 {
45 $ini =& eZINI::instance( 'site.ini' );
46
47 $Generator = $ini->variable( "eZArticleMain", "Generator" );
48 $generatorType = $Generator;
49 }
50
51 switch ( $generatorType )
52 {
53 case "qdom" :
54 {
55 $this->GeneratorFile = "ezqdomgenerator.php";
56 $this->GeneratorClass = "eZQDomGenerator";
57 }
58 break;
59
60 case "tech" :
61 {
62 $this->GeneratorFile = "eztechgenerator.php";
63 $this->GeneratorClass = "eZTechGenerator";
64 }
65 break;
66
67 case "ez" :
68 {
69 $this->GeneratorFile = "ezezgenerator.php";
70 $this->GeneratorClass = "eZEzGenerator";
71 }
72 break;
73
74 case "flower" :
75 {
76 $this->GeneratorFile = "ezflowergenerator.php";
77 $this->GeneratorClass = "eZFlowerGenerator";
78 }
79 break;
80
81 case "simple":
82 default :
83 {
84 $this->GeneratorFile = "ezsimplegenerator.php";
85 $this->GeneratorClass = "eZSimpleGenerator";
86 }
87 }
88 }
89
94 function &generateXML( &$contents )
95 {
96 // include_once( "ezarticle/classes/" . $this->GeneratorFile );
97
98 $generator = new $this->GeneratorClass( $contents );
99
100 $ret =& $generator->generateXML();
101
102 $this->PageCount = $generator->pageCount();
103
104 return $ret;
105 }
106
110 function pageCount( )
111 {
112 return $this->PageCount;
113 }
114
115
120 function &decodeXML( &$contents )
121 {
122 // find the generator used
123 if ( preg_match("/<generator>(.*)<\/generator>/", substr( $contents, 0, 200 ), $regs ) )
124 {
125 $generator = $regs[1];
126 switch ( $generator )
127 {
128 case "qdom" :
129 {
130 $this->GeneratorFile = "ezqdomgenerator.php";
131 $this->GeneratorClass = "eZQDomGenerator";
132 }
133 break;
134
135 case "tech" :
136 {
137 $this->GeneratorFile = "eztechgenerator.php";
138 $this->GeneratorClass = "eZTechGenerator";
139 }
140 break;
141
142 case "ez" :
143 {
144 $this->GeneratorFile = "ezezgenerator.php";
145 $this->GeneratorClass = "eZEzGenerator";
146 }
147 break;
148
149 case "flower" :
150 {
151 $this->GeneratorFile = "ezflowergenerator.php";
152 $this->GeneratorClass = "eZFlowerGenerator";
153 }
154 break;
155
156 case "simple" :
157 {
158 $this->GeneratorFile = "ezsimplegenerator.php";
159 $this->GeneratorClass = "eZSimpleGenerator";
160 }
161 break;
162 }
163 }
164 else
165 {
166 print( "<b>Error: eZArticleGenerator::decodeXML() could not find generator in XML chunk.</b>" );
167 }
168
169 // include_once( "ezarticle/classes/" . $this->GeneratorFile );
170
171 $generator = new $this->GeneratorClass( $contents );
172
173 return $generator->decodeXML();
174 }
175
176 var $GeneratorClass;
177 var $GeneratorFile;
178
179 var $PageCount;
180 }
181
182 ?>
eZArticleGenerator
Definition: ezarticlegenerator.php:40
eZArticleGenerator\$GeneratorClass
$GeneratorClass
Definition: ezarticlegenerator.php:176
eZArticleGenerator\$PageCount
$PageCount
Definition: ezarticlegenerator.php:179
eZArticleGenerator\generateXML
& generateXML(&$contents)
Definition: ezarticlegenerator.php:94
eZArticleGenerator\__construct
__construct( $generatorType="")
Definition: ezarticlegenerator.php:41
eZArticleGenerator\pageCount
pageCount()
Definition: ezarticlegenerator.php:110
eZArticleGenerator\$GeneratorFile
$GeneratorFile
Definition: ezarticlegenerator.php:177
eZArticleGenerator\decodeXML
& decodeXML(&$contents)
Definition: ezarticlegenerator.php:120
$ini
$ini
Definition: classes/admin/linklist.php:64
$contents
$contents
Definition: ezarticle/user/extendedsearch.php:52
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.