Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eztrade/admin/imagelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: imagelist.php 6746 2001-08-29 14:31:58Z bf $
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( "eZTradeMain", "Language" );
34
35 // include_once( "eztrade/classes/ezproductcategory.php" );
36 // include_once( "eztrade/classes/ezproduct.php" );
37
38
39 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
40 "kernel/eztrade/admin/intl/", $Language, "imagelist.php" );
41
42 $t->setAllStrings();
43
44 $t->set_file( array(
45 "image_list_page_tpl" => "imagelist.tpl"
46 ) );
47
48 $t->set_block( "image_list_page_tpl", "no_images_tpl", "no_images" );
49 $t->set_block( "image_list_page_tpl", "image_list_tpl", "image_list" );
50 $t->set_block( "image_list_tpl", "image_tpl", "image" );
51
52 $t->set_var( "site_style", $SiteDesign );
53
54 $product = new eZProduct( $ProductID );
55
56 $session =& eZSession::globalSession();
57 $session->setVariable( "ImageListReturnTo", $REQUEST_URI );
58 $session->setVariable( "SelectImages", "multi" );
59 $session->setVariable( "NameInBrowse", $product->name() );
60
61 $thumbnail = $product->thumbnailImage();
62 $main = $product->mainImage();
63
64 $t->set_var( "product_name", $product->name() );
65
66 if ( isset ( $AddImages ) )
67 {
68 if ( count ( $ImageArrayID ) > 0 )
69 {
70 foreach( $ImageArrayID as $imageID )
71 {
72 $image = new eZImage( $imageID );
73 $product->addImage( $image );
74 }
75 }
76
77 }
78
79 $images = $product->images();
80 if ( count( $images ) == 0 )
81 {
82 $t->set_var( "image_list", "" );
83 $t->parse( "no_images", "no_images_tpl", true );
84 }
85 else
86 {
87 $t->set_var( "no_images", "" );
88
89 $i=0;
90 $t->set_var( "image", "" );
91 foreach ( $images as $imageArray )
92 {
93 $image = $imageArray["Image"];
94 $placement = $imageArray["Placement"];
95
96 if ( ( $i % 2 ) == 0 )
97 {
98 $t->set_var( "td_class", "bglight" );
99 }
100 else
101 {
102 $t->set_var( "td_class", "bgdark" );
103 }
104
105 $t->set_var( "main_image_checked", "" );
106 if ( $main != 0 )
107 {
108 if ( $main->id() == $image->id() )
109 {
110 $t->set_var( "main_image_checked", "checked" );
111 }
112 }
113
114 $t->set_var( "thumbnail_image_checked", "" );
115 if ( $thumbnail != 0 )
116 {
117 if ( $thumbnail->id() == $image->id() )
118 {
119 $t->set_var( "thumbnail_image_checked", "checked" );
120 }
121 }
122
123 $t->set_var( "image_number", $placement );
124
125 $t->set_var( "image_name", $image->caption() );
126 $t->set_var( "image_id", $image->id() );
127 $t->set_var( "product_id", $ProductID );
128
129 $variation = $image->requestImageVariation( 150, 150 );
130
131 $t->set_var( "image_url", "/" .$variation->imagePath() );
132 $t->set_var( "image_width", $variation->width() );
133 $t->set_var( "image_height",$variation->height() );
134
135 $t->parse( "image", "image_tpl", true );
136
137 $i++;
138 }
139
140 $t->parse( "image_list", "image_list_tpl", true );
141 }
142
143
144 $t->set_var( "product_id", $product->id() );
145
146 $t->pparse( "output", "image_list_page_tpl" );
147
148 ?>
eZImage
Definition: ezimage.php:95
eZProduct
Definition: ezproduct.php:71
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZTemplate
Definition: eztemplate.php:107
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
$t
$t
Definition: eztrade/admin/imagelist.php:39
$images
if(isset( $AddImages)) $images
Definition: eztrade/admin/imagelist.php:79
$main
$main
Definition: eztrade/admin/imagelist.php:62
$product
$product
Definition: eztrade/admin/imagelist.php:54
$thumbnail
$thumbnail
Definition: eztrade/admin/imagelist.php:61
$i
$i
Definition: eztrade/admin/imagelist.php:89
$Language
$Language
Definition: eztrade/admin/imagelist.php:33
$ini
$ini
Definition: eztrade/admin/imagelist.php:32
$session
$session
Definition: eztrade/admin/imagelist.php:56
$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+.