Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

optionlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: optionlist.php 6233 2001-07-20 11:42:02Z jakobn $
5 //
6 // Created on: <20-Sep-2000 10:18:33 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 // include_once( "eztrade/classes/ezoption.php" );
38
39 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
40 "kernel/eztrade/admin/intl/", $Language, "optionlist.php" );
41
42 $t->setAllStrings();
43
44 $t->set_file( array(
45 "option_list_tpl" => "optionlist.tpl"
46 ) );
47
48 $t->set_block( "option_list_tpl", "option_tpl", "option" );
49
50 $t->set_var( "site_style", $SiteDesign );
51
52 $product = new eZProduct( $ProductID );
53
54 $t->set_var( "product_name", $product->name() );
55
56 $options = $product->options();
57
58 if ( !$options )
59 {
60 $noitem = new eZINI( "kernel/eztrade/admin/intl/" . $Language . "/optionlist.php.ini", false );
61 $t->set_var( "option", $noitem->variable( "strings", "no_option" ) );
62
63 }
64
65 $i=0;
66 foreach ( $options as $option )
67 {
68 if ( ( $i %2 ) == 0 )
69 $t->set_var( "td_class", "bglight" );
70 else
71 $t->set_var( "td_class", "bgdark" );
72 $t->set_var( "option_name", $option->name() );
73 $t->set_var( "option_id", $option->id() );
74 $t->set_var( "product_id", $ProductID );
75
76 $t->parse( "option", "option_tpl", true );
77 $i++;
78 }
79
80 $t->set_var( "product_id", $ProductID );
81
82 $t->pparse( "output", "option_list_tpl" );
83
84 ?>
eZINI
Reads and writes .ini style configuration files.
eZProduct
Definition: ezproduct.php:71
eZTemplate
Definition: eztemplate.php:107
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$options
$options
Definition: optionlist.php:56
$t
$t
Definition: optionlist.php:39
$product
$product
Definition: optionlist.php:52
$Language
$Language
Definition: optionlist.php:33
$ini
$ini
Definition: optionlist.php:32
$i
if(! $options) $i
Definition: optionlist.php:65
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.