Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezsitemanager/admin/templatelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: templatelist.php 9330 2002-03-04 12:56:24Z ce $
5 //
6 // Created on: <24-Sep-2001 14:12:07 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/ezfile.php" );
28
29 if ( $filePath == "" )
30 {
31 $filePath = ".";
32 $realPath = str_replace( "-", "/", $filePath );
33 $filePathArray = explode( "-", $filePath );
34
35 $file = eZPBFile::file( $realPath );
36 $dir = eZPBFile::dir( $realPath );
37 $is_file = $file && $dir == false ? true : false;
38 }
39 elseif( str_contains( $filePath, '.-' ) )
40 {
41 $filePath = ".-$filePath";
42 $realPath = str_replace( "-", "/", $filePath );
43 $filePathArray = explode( "-", $filePath );
44
45 $file = eZPBFile::file( $realPath );
46 $dir = eZPBFile::dir( $realPath );
47 $is_file = $file && $dir == false ? true : false;
48 }
49 else
50 {
51 //$filePath = ".-$filePath";
52 $realPath = str_replace( "-", "/", $filePath );
53 $filePathArray = explode( "-", $filePath );
54
55 $file = eZPBFile::file( $realPath );
56 $dir = eZPBFile::dir( $realPath );
57 $is_file = $file && $dir == false ? true : false;
58 }
59
60 $ini =& eZINI::instance( 'site.ini' );
61 $Language = $ini->variable( "eZSiteManagerMain", "Language" );
62
63 $t = new eZTemplate( "kernel/ezsitemanager/admin/" . $ini->variable( "eZSiteManagerMain", "AdminTemplateDir" ),
64 "kernel/ezsitemanager/admin/" . "/intl", $Language, "templatelist.php" );
65 $t->setAllStrings();
66
67 $t->set_file( "template_list_tpl", "templatelist.tpl" );
68
69 $t->set_block( "template_list_tpl", "file_item_tpl", "file_item" );
70 $t->set_var( "file_item", "" );
71
72 if( $is_file )
73 {
74 echo "hit";
75
76 eZHTTPTool::header( "Location: /sitemanager/template/edit/" . $filePath );
77 exit();
78 }
79
80 while ( $is_file == false && $entry = $dir->read() )
81 {
82 if( $entry == ".." )
83 {
84 if( isset( $filePathArray[3] ) )
85 {
86 $t->set_var( "file_name", $entry );
87 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . "-" . $filePathArray[2] );
88 $t->parse( "file_item", "file_item_tpl", true );
89 }
90 elseif( isset( $filePathArray[2] ) )
91 {
92 $t->set_var( "file_name", $entry );
93 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] );
94 $t->parse( "file_item", "file_item_tpl", true );
95 }
96 elseif( isset( $filePathArray[1] ) )
97 {
98 $t->set_var( "file_name", $entry );
99 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] );
100 $t->parse( "file_item", "file_item_tpl", true );
101 }
102 elseif( isset( $filePathArray[0] ) )
103 {
104 $t->set_var( "file_name", $entry );
105 $t->set_var( "file_href", "/sitemanager/template/list/" );
106 $t->parse( "file_item", "file_item_tpl", true );
107 }
108 }
109 elseif( $entry == "." )
110 {
111 }
112 elseif ( isset( $entry ) ) // $entry != "." && $entry != ".." )
113 {
114 if ( count( $filePathArray ) == 1 )
115 {
116 // top level modules
117 if ( preg_match( "#^ez[a-z]+$#", $entry ) )
118 {
119 if( isset( $filePathArray[0] ) )
120 {
121 $t->set_var( "file_name", $entry );
122 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-$entry" );
123 $t->parse( "file_item", "file_item_tpl", true );
124 }
125 elseif( isset( $filePathArray[1] ) )
126 {
127 $t->set_var( "file_name", $entry );
128 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[1] . "-$entry" );
129 $t->parse( "file_item", "file_item_tpl", true );
130 }
131 elseif( isset( $filePathArray[2] ) )
132 {
133 $t->set_var( "file_name", $entry );
134 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . "-$entry" );
135 $t->parse( "file_item", "file_item_tpl", true );
136 }
137 else
138 {
139 $t->set_var( "file_name", $entry );
140 $t->set_var( "file_href", "/sitemanager/template/list/$entry" );
141 $t->parse( "file_item", "file_item_tpl", true );
142 }
143 }
144 else
145 {
146 $t->set_var( "file_name", $entry );
147 $t->set_var( "file_href", "/sitemanager/template/list/$entry" );
148 $t->parse( "file_item", "file_item_tpl", true );
149 }
150 }
151 else if ( count( $filePathArray ) == 2 )
152 {
153 // top level modules
154 if ( isset( $entry ) ) // preg_match( "#^ez[a-z]+$#", $entry ) )
155 {
156 if( isset( $filePathArray[0] ) )
157 {
158 $t->set_var( "file_name", $entry );
159 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . "-$entry" );
160 $t->parse( "file_item", "file_item_tpl", true );
161 }
162 elseif( isset( $filePathArray[2] ) )
163 {
164 $t->set_var( "file_name", $entry );
165 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . $filePathArray[2] . "-$entry" );
166 $t->parse( "file_item", "file_item_tpl", true );
167 }
168 elseif( isset( $filePathArray[1] ) )
169 {
170 $t->set_var( "file_name", $entry );
171 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . $filePathArray[2] . "-$entry" );
172 $t->parse( "file_item", "file_item_tpl", true );
173 }
174 else
175 {
176 $t->set_var( "file_name", $entry );
177 $t->set_var( "file_href", "/sitemanager/template/list/$entry" );
178 $t->parse( "file_item", "file_item_tpl", true );
179 }
180 }
181 else
182 {
183 $t->set_var( "file_name", $entry );
184 $t->set_var( "file_href", "/sitemanager/template/list/$entry" );
185 $t->parse( "file_item", "file_item_tpl", true );
186 }
187 }
188 else if ( count( $filePathArray ) == 3 )
189 {
190 if( isset( $filePathArray[0] ) )
191 {
192 $t->set_var( "file_name", $entry );
193 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . "-" . $filePathArray[2] . "-$entry" );
194 $t->parse( "file_item", "file_item_tpl", true );
195 }
196 elseif( isset( $filePathArray[2] ) )
197 {
198 $t->set_var( "file_name", $entry );
199 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . $filePathArray[2] . "-$entry" );
200 $t->parse( "file_item", "file_item_tpl", true );
201 }
202 elseif( isset( $filePathArray[1] ) )
203 {
204 $t->set_var( "file_name", $entry );
205 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . $filePathArray[2] . "-$entry" );
206 $t->parse( "file_item", "file_item_tpl", true );
207 }
208 elseif ( $entry != "CVS" )
209 {
210 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[1] . "-" . $filePathArray[2] . "-templates" . "-$entry" );
211 $t->set_var( "file_name", $entry );
212
213 $t->parse( "file_item", "file_item_tpl", true );
214 }
215 }
216 else if ( count( $filePathArray ) == 4 )
217 {
218 if( isset( $filePathArray[0] ) )
219 {
220 $t->set_var( "file_name", $entry );
221 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . "-" . $filePathArray[2] . "-" . $filePathArray[3] . "-$entry" );
222 $t->parse( "file_item", "file_item_tpl", true );
223 }
224 elseif( isset( $filePathArray[2] ) )
225 {
226 $t->set_var( "file_name", $entry );
227 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . $filePathArray[2] . "-$entry" );
228 $t->parse( "file_item", "file_item_tpl", true );
229 }
230 elseif( isset( $filePathArray[1] ) )
231 {
232 $t->set_var( "file_name", $entry );
233 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[0] . "-" . $filePathArray[1] . $filePathArray[2] . "-$entry" );
234 $t->parse( "file_item", "file_item_tpl", true );
235 }
236 elseif ( $entry != "CVS" )
237 {
238 $t->set_var( "file_href", "/sitemanager/template/list/" . $filePathArray[1] . "-" . $filePathArray[2] . "-templates" . "-$entry" );
239 $t->set_var( "file_name", $entry );
240
241 $t->parse( "file_item", "file_item_tpl", true );
242 }
243 }
244 else if ( count( $filePathArray ) == 5 )
245 {
246 if ( preg_match( "#[a-z]+\.tpl$#", $entry ) )
247 {
248 $t->set_var( "file_href", "/sitemanager/template/edit/" . $filePathArray[0] . "-" .$filePathArray[1] . "-" . $filePathArray[2] . "-templates" . "-" . $filePathArray[4] . "-$entry" );
249 $t->set_var( "file_name", $entry );
250
251 $t->parse( "file_item", "file_item_tpl", true );
252 }
253 }
254 }
255 }
256
257 $t->pparse( "output", "template_list_tpl" );
258
259 ?>
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZPBFile\file
static file( $filename)
Definition: ezpbfile.php:428
eZPBFile\dir
static dir( $dir, $add_sitedir=true)
Definition: ezpbfile.php:384
eZTemplate
Definition: eztemplate.php:107
$filePath
$filePath
Definition: ezfilemanager/user/filedownload.php:50
$dir
$dir
Definition: ezsitemanager/admin/templatelist.php:56
$t
$t
Definition: ezsitemanager/admin/templatelist.php:63
$is_file
$is_file
Definition: ezsitemanager/admin/templatelist.php:57
$Language
$Language
Definition: ezsitemanager/admin/templatelist.php:61
$ini
$ini
Definition: ezsitemanager/admin/templatelist.php:60
$file
$file
Definition: ezsitemanager/admin/templatelist.php:55
$filePathArray
$filePathArray
Definition: ezsitemanager/admin/templatelist.php:53
exit
exit
Definition: folder.php:81
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.