Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

boxtypes.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: boxtypes.php,v 1.4 2001/07/20 11:42:01 jakobn Exp $
5 //
6 // Created on: <19-Feb-2001 13:34:10 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
28 // include_once( "classes/INIFile.php" );
29 // include_once( "classes/eztemplate.php" );
30 // include_once( "classes/ezhttptool.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33
34 $Language = $ini->variable( "eZTradeMain", "Language" );
35
36 // include_once( "eztrade/classes/ezboxtype.php" );
37
38
39 if ( isset( $Action ) && $Action == "Store" )
40 {
41 $i =0;
42 foreach ( $BoxID as $id )
43 {
44 $type = new eZBoxType( $BoxID[$i] );
45 $type->setName( $BoxName[$i] );
46 $type->setLength( $Length[$i] );
47 $type->setHeight( $Height[$i] );
48 $type->setWidth( $Width[$i] );
49 $type->store();
50 $i++;
51 }
52 }
53
54 if ( isset( $Action ) && $Action == "Add" )
55 {
56 $type = new eZBoxType();
57 $type->setName( "" );
58 $type->setLength( 0 );
59 $type->setHeight( 0 );
60 $type->setWidth( 0 );
61 $type->store();
62 }
63
64 if ( isset( $Action ) && $Action == "Delete" )
65 {
66 foreach ( $BoxArrayID as $id )
67 {
68 $type = new eZBoxType( $id );
69 $type->delete();
70 }
71 }
72
73 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
74 "kernel/eztrade/admin/intl/", $Language, "boxtypes.php" );
75
76 $t->setAllStrings();
77
78 $t->set_file( array( "box_types_tpl" => "boxtypes.tpl" ) );
79
80 $t->set_block( "box_types_tpl", "box_item_tpl", "box_item" );
81
82
83 $type = new eZBoxType();
84
85 $types =& $type->getAll();
86
87 $i=0;
88 foreach ( $types as $item )
89 {
90 if ( ( $i % 2 ) == 0 )
91 {
92 $t->set_var( "td_class", "bglight" );
93 }
94 else
95 {
96 $t->set_var( "td_class", "bgdark" );
97 }
98
99 $t->set_var( "box_id", $item->id() );
100 $t->set_var( "box_name", $item->name() );
101 $t->set_var( "length", $item->length() );
102 $t->set_var( "width", $item->width() );
103 $t->set_var( "height", $item->height() );
104
105 $t->parse( "box_item", "box_item_tpl", true );
106
107 $i++;
108 }
109
110 if ( count ( $types ) == 0 )
111 $t->set_var( "box_item", "" );
112
113 $t->pparse( "output", "box_types_tpl" );
114
115 ?>
$t
if(isset( $Action) && $Action=="Store") if(isset( $Action) && $Action=="Add") if(isset( $Action) && $Action=="Delete") $t
Definition: boxtypes.php:73
$i
$i
Definition: boxtypes.php:87
$Language
$Language
Definition: boxtypes.php:34
$ini
$ini
Definition: boxtypes.php:32
$types
$types
Definition: boxtypes.php:85
$type
$type
Definition: boxtypes.php:83
eZBoxType
Definition: ezboxtype.php:40
eZTemplate
Definition: eztemplate.php:107
$item
$item
Definition: classes/admin/linklist.php:228
$Action
$Action
Definition: companysearch.php:80
$id
$id
Definition: companytypelist.php:193
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.