Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezsitemanager/admin/filelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: filelist.php 6539 2001-08-22 08:59:45Z th $
5 //
6 // Created on: <11-Jul-2001 15:37:33 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/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezhttptool.php" );
30 // include_once( "classes/ezfile.php" );
31
32 if ( isset( $Delete ) )
33 {
34 foreach ( $FileDeleteArray as $file )
35 {
36 if ( file_exists( "kernel/ezsitemanager/staticfiles/$file" ) )
37 {
38 eZPBFile::unlink( "kernel/ezsitemanager/staticfiles/$file" );
39 }
40 }
41
42 foreach ( $ImageDeleteArray as $file )
43 {
44 if ( file_exists( "kernel/ezsitemanager/staticfiles/images/$file" ) )
45 {
46 eZPBFile::unlink( "kernel/ezsitemanager/staticfiles/images/$file" );
47 }
48 }
49 }
50
51 if ( isset( $Upload ) )
52 {
53 // upload file, if supplied
54 $file = new eZFile();
55 if ( $file->getUploadedFile( "userfile" ) == true )
56 {
57 $file->copy( "kernel/ezsitemanager/staticfiles/" . $file->name() );
58 }
59
60 // upload image, if supplied
61 $image = new eZFile();
62
63 if ( $image->getUploadedFile( "userimage" ) == true )
64 {
65 $image->copy( "kernel/ezsitemanager/staticfiles/images/" . $image->name() );
66 }
67 }
68
69
70 $ini =& eZINI::instance( 'site.ini' );
71 $Language = $ini->variable( "eZSiteManagerMain", "Language" );
72
73 $t = new eZTemplate( "kernel/ezsitemanager/admin/" . $ini->variable( "eZSiteManagerMain", "AdminTemplateDir" ),
74 "kernel/ezsitemanager/admin/" . "/intl", $Language, "filelist.php" );
75 $t->setAllStrings();
76
77 $t->set_file( "file_list_tpl", "filelist.tpl" );
78
79 $t->set_block( "file_list_tpl", "file_tpl", "file" );
80 $t->set_block( "file_list_tpl", "image_tpl", "image" );
81
82 $t->set_var( "file", "" );
83 $t->set_var( "image", "" );
84
85 $t->set_var( "site_style", $SiteDesign );
86
87 $dir = eZPBFile::dir( "kernel/ezsitemanager/staticfiles/" );
88 $ret = array();
89 $i=0;
90
91 while ( $entry = $dir->read() )
92 {
93 if ( $entry != "." && $entry != ".." && $entry != "images" )
94 {
95 if ( ( $i %2 ) == 0 )
96 $t->set_var( "td_class", "bglight" );
97 else
98 $t->set_var( "td_class", "bgdark" );
99
100 $t->set_var( "file_name", $entry );
101 $t->parse( "file", "file_tpl", true );
102 $i++;
103 }
104 }
105
106 $dir = eZPBFile::dir( "kernel/ezsitemanager/staticfiles/images" );
107 $ret = array();
108 while ( $entry = $dir->read() )
109 {
110 if ( $entry != "." && $entry != ".." )
111 {
112 if ( ( $i %2 ) == 0 )
113 $t->set_var( "td_class", "bglight" );
114 else
115 $t->set_var( "td_class", "bgdark" );
116
117 $t->set_var( "file_name", $entry );
118 $t->parse( "image", "image_tpl", true );
119 $i++;
120 }
121 }
122
123 $t->pparse( "output", "file_list_tpl" );
124
125 ?>
eZFile
Tool class which has convencience functions for files and directories.
Definition: ezfile.php:19
eZPBFile\dir
static dir( $dir, $add_sitedir=true)
Definition: ezpbfile.php:384
eZPBFile\unlink
static unlink( $filename)
Definition: ezpbfile.php:352
eZTemplate
Definition: eztemplate.php:107
file_exists
static file_exists( $inifilename)
Definition: eZPBINIFile.php:195
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$t
$t
Definition: ezsitemanager/admin/filelist.php:73
$ini
if(isset( $Delete)) if(isset( $Upload)) $ini
Definition: ezsitemanager/admin/filelist.php:70
$i
$i
Definition: ezsitemanager/admin/filelist.php:89
$Language
$Language
Definition: ezsitemanager/admin/filelist.php:71
$dir
$dir
Definition: ezsitemanager/admin/filelist.php:87
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.