Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

currency.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: currency.php 6233 2001-07-20 11:42:02Z jakobn $
5 //
6 // Created on: <23-Feb-2001 16:27:56 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 // include_once( "classes/ezcachefile.php" );
32
33 // include_once( "eztrade/classes/ezproductcurrency.php" );
34
35 $ini =& eZINI::instance( 'site.ini' );
36
37 $Language = $ini->variable( "eZTradeMain", "Language" );
38
39 if ( isset( $Action ) && $Action == "Store" )
40 {
41 $i=0;
42 if ( isset( $CurrencyID ) && count( $CurrencyID ) > 0 )
43 foreach ( $CurrencyID as $id )
44 {
45 $str = "CurrencyPrefix_" . $id;
46 $prefixArray = $$str;
47
48 $currency = new eZProductCurrency( $id );
49 $currency->setName( $CurrencyName[$i] );
50 $currency->setSign( $CurrencySign[$i] );
51 $currency->setValue( $CurrencyValue[$i] );
52
53 if ( $prefixArray[0] == 1 )
54 $currency->setPrefixSign( true );
55 else
56 $currency->setPrefixSign( false );
57
58 $currency->store();
59 $i++;
60 }
61
62 $files = eZCacheFile::files( "kernel/eztrade/cache/", array( array( "productview", "productprint" ),
63 NULL, NULL ),
64 "cache", "," );
65 foreach( $files as $file )
66 {
67 $file->delete();
68 }
69 }
70
71 if ( isset( $Action ) && $Action == "AddCurrency" )
72 {
73 $currency = new eZProductCurrency( );
74 $currency->store();
75 }
76
77
78 if ( isset( $Action ) && $Action == "DeleteSelected" )
79 {
80 foreach ( $DeleteID as $id )
81 {
82 $currency = new eZProductCurrency( $id );
83 $currency->delete();
84 }
85 }
86
87 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
88 "kernel/eztrade/admin/intl/", $Language, "currency.php" );
89
90 $t->setAllStrings();
91
92 $t->set_file( array( "currency_tpl" => "currency.tpl" ) );
93
94 $t->set_block( "currency_tpl", "currency_item_tpl", "currency_item" );
95
96
97
98 $currency = new eZProductCurrency( );
99 $currencies =& $currency->getAll();
100
101 $t->set_var( "currency_item", "" );
102
103 $i=0;
104 foreach ( $currencies as $currency )
105 {
106 $t->set_var( "td_class", ( $i % 2 ) == 0 ? "bglight" : "bgdark" );
107
108 $t->set_var( "currency_id", $currency->id() );
109 $t->set_var( "currency_name", $currency->name() );
110 $t->set_var( "currency_sign", $currency->sign() );
111 $t->set_var( "currency_value", $currency->value() );
112
113 if ( $currency->prefixSign() )
114 {
115 $t->set_var( "currency_prefixed", "checked" );
116 $t->set_var( "currency_not_prefixed", "" );
117 }
118 else
119 {
120 $t->set_var( "currency_prefixed", "" );
121 $t->set_var( "currency_not_prefixed", "checked" );
122 }
123
124 $t->parse( "currency_item", "currency_item_tpl", true );
125 $i++;
126 }
127
128 $t->pparse( "output", "currency_tpl" );
129
130 ?>
$files
$files
Definition: articlepreview.php:91
eZProductCurrency
Definition: ezproductcurrency.php:40
eZTemplate
Definition: eztemplate.php:107
$Action
$Action
Definition: companysearch.php:80
$id
$id
Definition: companytypelist.php:193
$currency
$currency
Definition: currency.php:98
$currencies
$currencies
Definition: currency.php:99
$i
$i
Definition: currency.php:103
$Language
$Language
Definition: currency.php:37
$ini
$ini
Definition: currency.php:35
$t
if(isset( $Action) && $Action=="Store") if(isset( $Action) && $Action=="AddCurrency") if(isset( $Action) && $Action=="DeleteSelected") $t
Definition: currency.php:87
$str
$str
Definition: ezarticle/modules/content.php:30
$file
$file
Definition: ezfilemanager/user/filedownload.php:35
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.