Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezarticle/admin/imagelist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: imagelist.php 9753 2003-01-07 13:46:20Z br $
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
33 $ini =& eZINI::instance( 'site.ini' );
34 $Language = $ini->variable( "eZArticleMain", "Language" );
35
36 // include_once( "ezarticle/classes/ezarticlecategory.php" );
37 // include_once( "ezarticle/classes/ezarticle.php" );
38 // include_once( "ezarticle/classes/ezarticletool.php" );
39
40
41 $t = new eZTemplate( "kernel/ezarticle/admin/" . $ini->variable( "eZArticleMain", "AdminTemplateDir" ),
42 "kernel/ezarticle/admin/intl/", $Language, "imagelist.php" );
43
44 $t->setAllStrings();
45
46 $t->set_file( "image_list_page_tpl", "imagelist.tpl" );
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 $article = new eZArticle( $ArticleID );
53
54 $session =& eZSession::globalSession();
55 $session->setVariable( "ImageListReturnTo", $_SERVER['REQUEST_URI'] );
56 $session->setVariable( "SelectImages", "multi" );
57 $session->setVariable( "NameInBrowse", $article->name() );
58
59 $thumbnail = $article->thumbnailImage();
60
61 $t->set_var( "article_name", $article->name() );
62
63 $t->set_var( "site_style", $SiteDesign );
64
65 if ( isset( $AddImages ) )
66 {
67 if ( isset( $ImageArrayID ) && ( $ImageArrayID ) > 0 )
68 {
69 foreach ( $ImageArrayID as $imageID )
70 {
71 $image = new eZImage( $imageID );
72 $article->addImage( $image );
73 }
74 }
75 }
76
77 $images = $article->images( true, "Placement" );
78 // Start Add By kadooz !
79
81 if ( is_numeric( $MoveImageUp ) || is_numeric( $MoveImageDown ) )
82 {
83 if ( is_numeric( $MoveImageUp ) )
84 {
85 $article->moveImageUp( $MoveImageUp );
86 }
87
88 if ( is_numeric( $MoveImageDown ) )
89 {
90 $article->moveImageDown( $MoveImageDown );
91 }
92 eZHTTPTool::header( "Location: /article/articleedit/imagelist/$ArticleID/" );
93 exit();
94 }
95
96 // End Add By kadooz !
97
98 if ( count( $images ) == 0 )
99 {
100 $t->set_var( "image_list", "" );
101 $t->parse( "no_images", "no_images_tpl", true );
102 }
103 else
104 {
105 $t->set_var( "no_images", "" );
106
107 $i=0;
108 foreach ( $images as $image )
109 {
110 $placement = $image["Placement"];
111 $image = $image["Image"];
112
113
114 if ( ( $i % 2 ) == 0 )
115 $t->set_var( "td_class", "bglight" );
116 else
117 $t->set_var( "td_class", "bgdark" );
118
119 $t->set_var( "thumbnail_image_checked", "" );
120 if ( $thumbnail )
121 {
122 if ( $thumbnail->id() == $image->id() )
123 {
124 $t->set_var( "thumbnail_image_checked", "checked" );
125 }
126 }
127
128 $t->set_var( "image_number", $placement );
129
130 if ( $image->caption() == "" )
131 $t->set_var( "image_name", "&nbsp;" );
132 else
133 $t->set_var( "image_name", $image->caption() );
134 $t->set_var( "image_id", $image->id() );
135 $t->set_var( "article_id", $ArticleID );
136
137 $variation =& $image->requestImageVariation( 150, 150 );
138
139 $t->set_var( "image_url", "/" .$variation->imagePath() );
140 $t->set_var( "image_width", $variation->width() );
141 $t->set_var( "image_height",$variation->height() );
142
143 $t->parse( "image", "image_tpl", true );
144
145 $i++;
146 }
147
148 $t->parse( "image_list", "image_list_tpl", true );
149 }
150
151
152 $t->set_var( "article_id", $article->id() );
153
154 $t->pparse( "output", "image_list_page_tpl" );
155
156 ?>
eZArticle
Definition: ezarticle.php:82
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
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/admin/imagelist.php:41
$images
if(isset( $AddImages)) $images
Definition: ezarticle/admin/imagelist.php:77
$article
$article
Definition: ezarticle/admin/imagelist.php:52
$thumbnail
$thumbnail
Definition: ezarticle/admin/imagelist.php:59
$i
$i
Definition: ezarticle/admin/imagelist.php:107
$Language
$Language
Definition: ezarticle/admin/imagelist.php:34
$ini
$ini
Definition: ezarticle/admin/imagelist.php:33
$session
$session
Definition: ezarticle/admin/imagelist.php:54
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$variation
$variation
Definition: ezimagecatalogue/user/menubox.php:55
exit
exit
Definition: folder.php:81
$image
$image
Definition: user/articlelist.php:242
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.