Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

pricegroupedit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: pricegroupedit.php 9167 2002-02-07 08:39:29Z jhe $
5 //
6 // Created on: <23-Feb-2001 15:32:27 amos>
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/eztexttool.php" );
31 // include_once( "ezuser/classes/ezusergroup.php" );
32
33 $ini =& eZINI::instance( 'site.ini' );
34
35 $Language = $ini->variable( "eZTradeMain", "Language" );
36
37 // include_once( "eztrade/classes/ezpricegroup.php" );
38
39 $price = new eZPriceGroup( $PriceID );
40
41 if ( isset( $Cancel ) )
42 {
43 // include_once( "classes/ezhttptool.php" );
44 eZHTTPTool::header( "Location: /trade/pricegroups/list" );
45 exit();
46 }
47
48 if ( isset( $OK ) )
49 {
50 $price->setName( $Name );
51 $price->setDescription( $Description );
52 $price->store();
53
54 $price->removeUserGroups();
55 foreach ( $GroupID as $group )
56 {
57 $price->addUserGroup( $group );
58 }
59 // include_once( "classes/ezhttptool.php" );
60 eZHTTPTool::header( "Location: /trade/pricegroups/list" );
61 exit();
62 }
63 else if ( isset( $PriceID ) and is_numeric( $PriceID ) )
64 {
65 $Action = "edit";
66 }
67
68 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
69 "kernel/eztrade/admin/intl/", $Language, "pricegroupedit.php" );
70
71 $t->setAllStrings();
72
73 $t->set_file( "price_group_page", "pricegroupedit.tpl" );
74
75 $t->set_block( "price_group_page", "value_tpl", "value_item" );
76
77 if ( $Action == "edit" )
78 {
79 $Name = $price->name();
80 $Description = $price->description();
81 $GroupID = $price->userGroups( false, false );
82 }
83
84 $t->set_var( "price_id", $PriceID );
85 $t->set_var( "name", eZTextTool::htmlspecialchars( $Name ) );
86 $t->set_var( "description", eZTextTool::htmlspecialchars( $Description ) );
87
88 if ( !isset( $GroupID ) )
89 $GroupID = array();
90
91 $groups = eZUserGroup::getAll();
92 foreach ( $groups as $group )
93 {
94 $t->set_var( "group_id", $group->id() );
95 $t->set_var( "group_name", eZTextTool::htmlspecialchars( $group->name() ) );
96 $t->set_var( "selected", in_array( $group->id(), $GroupID ) ? "selected" : "" );
97 $t->parse( "value_item", "value_tpl", true );
98 }
99
100 $t->pparse( "output", "price_group_page" );
101
102 ?>
$group
$group
Definition: admin/articleedit.php:799
$Description
$Description
Definition: articlelistrss.php:38
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZPriceGroup
Definition: ezpricegroup.php:38
eZTemplate
Definition: eztemplate.php:107
eZTextTool\htmlspecialchars
static htmlspecialchars( $string)
Definition: eztexttool.php:144
eZUserGroup\getAll
static & getAll( $as_object=true)
Definition: ezusergroup.php:197
$Action
$Action
Definition: companysearch.php:80
exit
exit
Definition: folder.php:81
$Name
$Name
Definition: polledit.php:250
$groups
$groups
Definition: pricegroupedit.php:91
$price
$price
Definition: pricegroupedit.php:39
$t
if(isset( $Cancel)) if(isset( $OK)) else if(isset( $PriceID) and is_numeric( $PriceID)) $t
Definition: pricegroupedit.php:68
$Language
$Language
Definition: pricegroupedit.php:35
$ini
$ini
Definition: pricegroupedit.php:33
$GroupID
$GroupID
Definition: rssheadlines.php:51
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.