Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/user/imagelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: imagelist.php 7089 2001-09-07 17:33:55Z fh $
5 //
6 // Created on: <21-Sep-2000 10:32:19 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 $Language = $ini->variable( "eZArticleMain", "Language" );
34
35 // include_once( "ezarticle/classes/ezarticlecategory.php" );
36 // include_once( "ezarticle/classes/ezarticle.php" );
37
38
39 $t = new eZTemplate( "kernel/ezarticle/user/" . $ini->variable( "eZArticleMain", "TemplateDir" ),
40 "kernel/ezarticle/user/intl/", $Language, "imagelist.php" );
41
42 $t->setAllStrings();
43
44 $t->set_file( "image_list_page_tpl", "imagelist.tpl" );
45
46 $t->set_block( "image_list_page_tpl", "no_images_tpl", "no_images" );
47 $t->set_block( "image_list_page_tpl", "image_list_tpl", "image_list" );
48 $t->set_block( "image_list_tpl", "image_tpl", "image" );
49
50 $article = new eZArticle( $ArticleID );
51
52 $session =& eZSession::globalSession();
53 $session->setVariable( "ImageListReturnTo", $REQUEST_URI );
54 $session->setVariable( "SelectImages", "multi" );
55 $session->setVariable( "NameInBrowse", $article->name() );
56
57 $thumbnail = $article->thumbnailImage();
58
59 $t->set_var( "article_name", $article->name() );
60
61 $t->set_var( "site_style", $SiteDesign );
62
63 if ( isset( $AddImages ) )
64 {
65 if ( count( $ImageArrayID ) > 0 )
66 {
67 foreach ( $ImageArrayID as $imageID )
68 {
69 $image = new eZImage( $imageID );
70 $article->addImage( $image );
71 }
72 }
73 }
74
75 $images = $article->images();
76 if ( count( $images ) == 0 )
77 {
78 $t->set_var( "image_list", "" );
79 $t->parse( "no_images", "no_images_tpl", true );
80 }
81 else
82 {
83 $t->set_var( "no_images", "" );
84
85 $i=0;
86 foreach ( $images as $image )
87 {
88 $placement = $image["Placement"];
89 $image = $image["Image"];
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( "thumbnail_image_checked", "" );
101
102 if ( is_object( $thumbnail ) )
103 {
104 if ( $thumbnail->id() == $image->id() )
105 {
106 $t->set_var( "thumbnail_image_checked", "checked" );
107 }
108 }
109
110 $t->set_var( "image_number", $i + 1 );
111
112 if ( $image->caption() == "" )
113 $t->set_var( "image_name", "&nbsp;" );
114 else
115 $t->set_var( "image_name", $image->caption() );
116 $t->set_var( "image_id", $image->id() );
117 $t->set_var( "article_id", $ArticleID );
118
119 $variation =& $image->requestImageVariation( 150, 150 );
120
121 $t->set_var( "image_url", "/" .$variation->imagePath() );
122 $t->set_var( "image_width", $variation->width() );
123 $t->set_var( "image_height",$variation->height() );
124
125 $t->parse( "image", "image_tpl", true );
126
127 $i++;
128 }
129
130 $t->parse( "image_list", "image_list_tpl", true );
131 }
132
133
134 $t->set_var( "article_id", $article->id() );
135
136 $t->pparse( "output", "image_list_page_tpl" );
137
138 ?>
eZArticle
Definition: ezarticle.php:82
eZImage
Definition: ezimage.php:95
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZTemplate
Definition: eztemplate.php:107
$ArticleID
$ArticleID
Definition: export.php:48
$t
$t
Definition: ezarticle/user/imagelist.php:39
$images
if(isset( $AddImages)) $images
Definition: ezarticle/user/imagelist.php:75
$article
$article
Definition: ezarticle/user/imagelist.php:50
$thumbnail
$thumbnail
Definition: ezarticle/user/imagelist.php:57
$i
$i
Definition: ezarticle/user/imagelist.php:85
$Language
$Language
Definition: ezarticle/user/imagelist.php:33
$ini
$ini
Definition: ezarticle/user/imagelist.php:32
$session
$session
Definition: ezarticle/user/imagelist.php:52
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
$REQUEST_URI
$REQUEST_URI
Definition: storestats.php:32
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.