Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/user/filelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: filelist.php 6491 2001-08-20 11:07:08Z ce $
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( "eZArticleMain", "Language" );
35
36 // include_once( "ezarticle/classes/ezarticlecategory.php" );
37 // include_once( "ezarticle/classes/ezarticle.php" );
38
39
40 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
41 "kernel/ezarticle/user/intl/", $Language, "filelist.php" );
42
43 $t->setAllStrings();
44
45 $t->set_file( array(
46 "file_list_page_tpl" => "filelist.tpl"
47 ) );
48
49 $t->set_block( "file_list_page_tpl", "no_files_tpl", "no_files" );
50 $t->set_block( "file_list_page_tpl", "file_list_tpl", "file_list" );
51 $t->set_block( "file_list_tpl", "file_tpl", "file" );
52
53 $article = new eZArticle( $ArticleID );
54
55 $session = eZSession::globalSession();
56 $session->setVariable( "FileListReturnTo", $REQUEST_URI );
57 $session->setVariable( "NameInBrowse", $article->name() );
58
59 if ( isset ( $AddFiles ) )
60 {
61 if ( count ( $FileArrayID ) > 0 )
62 {
63 foreach( $FileArrayID as $fileID )
64 {
65 $file = new eZVirtualFile( $fileID );
66 $article->addFile( $file );
67 }
68 }
69 }
70
71 $t->set_var( "article_name", $article->name() );
72
73 $t->set_var( "site_style", $SiteDesign );
74
75 $files = $article->files();
76 if ( count( $files ) == 0 )
77 {
78 $t->set_var( "file_list", "" );
79 $t->parse( "no_files", "no_files_tpl", true );
80 }
81 else
82 {
83 $t->set_var( "no_files", "" );
84
85 $i=0;
86 $t->set_var( "file", "" );
87 foreach ( $files as $file )
88 {
89 if ( ( $i % 2 ) == 0 )
90 {
91 $t->set_var( "td_class", "bglight" );
92 }
93 else
94 {
95 $t->set_var( "td_class", "bgdark" );
96 }
97
98 $t->set_var( "file_number", $i + 1 );
99 $t->set_var( "file_id", $file->id() );
100 $t->set_var( "file_name", $file->name() );
101 $t->set_var( "file_description", $file->description() );
102
103 $t->parse( "file", "file_tpl", true );
104
105 $i++;
106 }
107
108 $t->parse( "file_list", "file_list_tpl", true );
109 }
110
111
112 $t->set_var( "article_id", $article->id() );
113
114 $t->pparse( "output", "file_list_page_tpl" );
115
116 ?>
eZArticle
Definition: ezarticle.php:82
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZTemplate
Definition: eztemplate.php:107
eZVirtualFile
Definition: ezvirtualfile.php:42
$ArticleID
$ArticleID
Definition: export.php:48
$t
$t
Definition: ezarticle/user/filelist.php:40
$article
$article
Definition: ezarticle/user/filelist.php:53
$i
$i
Definition: ezarticle/user/filelist.php:85
$Language
$Language
Definition: ezarticle/user/filelist.php:34
$ini
$ini
Definition: ezarticle/user/filelist.php:32
$files
$files
Definition: ezarticle/user/filelist.php:75
$session
$session
Definition: ezarticle/user/filelist.php:55
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
$REQUEST_URI
$REQUEST_URI
Definition: storestats.php:32
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.