Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eztrade/admin/filelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: filelist.php,v 1.9 2001/08/30 07:55:56 bf Exp $
5 //
6 // Created on: <21-Dec-2000 17:43:40 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/ezlocale.php" );
30 include_once( "classes/ezcurrency.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33
34 $Language = $ini->variable( "eZTradeMain", "Language" );
35 $SiteStyle = $ini->variable( "site", "SiteStyle" );
36
37 include_once( "eztrade/classes/ezproductcategory.php" );
38 include_once( "eztrade/classes/ezproduct.php" );
39
40
41 $t = new eZTemplate( "eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
42 "eztrade/admin/intl/", $Language, "filelist.php" );
43
44 $t->setAllStrings();
45
46 $t->set_file( "file_list_page_tpl", "filelist.tpl" );
47
48 $t->set_block( "file_list_page_tpl", "no_files_tpl", "no_files" );
49 $t->set_block( "file_list_page_tpl", "file_list_tpl", "file_list" );
50 $t->set_block( "file_list_tpl", "file_tpl", "file" );
51
52 $product = new eZProduct( $ProductID );
53
54 $session =& eZSession::globalSession();
55 $session->setVariable( "FileListReturnTo", $REQUEST_URI );
56 $session->setVariable( "NameInBrowse", $product->name() );
57
58 if ( isSet ( $AddFiles ) )
59 {
60 if ( count ( $FileArrayID ) > 0 )
61 {
62 foreach( $FileArrayID as $fileID )
63 {
64 $file = new eZVirtualFile( $fileID );
65 if ( $DescriptionArray[$fileID] != $file->description() );
66 $file->setDescription( $DescriptionArray[$fileID] );
67 $file->store();
68 $product->addFile( $file );
69 }
70 }
71 }
72
73 $t->set_var( "product_name", $product->name() );
74
75 $t->set_var( "site_style", $SiteStyle );
76
77 $files =& $product->files();
78 if ( count( $files ) == 0 )
79 {
80 $t->set_var( "file_list", "" );
81 $t->parse( "no_files", "no_files_tpl", true );
82 }
83 else
84 {
85 $t->set_var( "no_files", "" );
86
87 $i=0;
88 $t->set_var( "file", "" );
89 foreach ( $files as $file )
90 {
91 if ( ( $i % 2 ) == 0 )
92 {
93 $t->set_var( "td_class", "bglight" );
94 }
95 else
96 {
97 $t->set_var( "td_class", "bgdark" );
98 }
99
100 $t->set_var( "file_number", $i + 1 );
101 $t->set_var( "file_id", $file->id() );
102 $t->set_var( "file_name", $file->name() );
103 $t->set_var( "file_description", $file->description() );
104
105 $t->parse( "file", "file_tpl", true );
106
107 $i++;
108 }
109
110 $t->parse( "file_list", "file_list_tpl", true );
111 }
112
113
114 $t->set_var( "product_id", $product->id() );
115
116 $t->pparse( "output", "file_list_page_tpl" );
117
118 ?>
eZProduct
Definition: ezproduct.php:71
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZTemplate
Definition: eztemplate.php:107
eZVirtualFile
Definition: ezvirtualfile.php:42
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$t
$t
Definition: eztrade/admin/filelist.php:41
$product
$product
Definition: eztrade/admin/filelist.php:52
$i
$i
Definition: eztrade/admin/filelist.php:87
$Language
$Language
Definition: eztrade/admin/filelist.php:34
$ini
$ini
Definition: eztrade/admin/filelist.php:32
$files
$files
Definition: eztrade/admin/filelist.php:77
$session
$session
Definition: eztrade/admin/filelist.php:54
$SiteStyle
$SiteStyle
Definition: eztrade/admin/filelist.php:35
$REQUEST_URI
$REQUEST_URI
Definition: storestats.php:32
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.