Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

fixedvalues.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: fixedvalues.php 7715 2001-10-09 09:04:27Z ce $
5 //
6 // Created on: <12-Jun-2001 13:07:24 pkej>
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/ezhttptool.php" );
30 // include_once( "classes/ezlist.php" );
31
32 // include_once( "ezform/classes/ezform.php" );
33 // include_once( "ezform/classes/ezformelement.php" );
34 // include_once( "ezform/classes/ezformelementtype.php" );
35 // include_once( "ezform/classes/ezformelementfixedvalue.php" );
36
37 $ActionValue = "list";
38 $ini =& eZINI::instance( 'site.ini' );
39
40 $Language = $ini->variable( "eZFormMain", "Language" );
41
42 $element = new eZFormElement( $ElementID );
43
44 if( isset( $AddValue ) )
45 {
46 $value = new eZFormElementFixedValue();
47 $value->store();
48 $element->addValue( $value );
49 }
50
51
52 if( isset( $Store ) || isset ( $AddValue ) || isset ( $DeleteSelected ) || isset ( $OK ) )
53 {
54 $i=0;
55 if ( count ( $ValueID ) > 0 )
56 {
57 foreach( $ValueID as $ID )
58 {
59 $value = new eZFormElementFixedValue( $ID );
60 $value->setValue( $Value[$i] );
61 $value->store();
62 $i++;
63 }
64 }
65 }
66
67 if( isset( $DeleteSelected ) )
68 {
69 foreach( $ValueDeleteID as $ID )
70 {
71 $value = new eZFormElementFixedValue( $ID );
72 $value->delete();
73 }
74 }
75
76 if( isset( $OK ) )
77 {
78 eZHTTPTool::header( "Location: /form/form/edit/$FormID" );
79 exit();
80 }
81
82 $t = new eZTemplate( "kernel/ezform/admin/" . $ini->variable( "eZFormMain", "AdminTemplateDir" ),
83 "kernel/ezform/admin/intl/", $Language, "fixedvalues.php" );
84 $t->setAllStrings();
85
86 $t->set_file( array(
87 "value_list_page_tpl" => "fixedvalues.tpl"
88 ) );
89
90 $t->set_block( "value_list_page_tpl", "no_values_item_tpl", "no_values_item" );
91 $t->set_block( "value_list_page_tpl", "value_list_tpl", "value_list" );
92 $t->set_block( "value_list_tpl", "value_item_tpl", "value_item" );
93
94 $t->set_var( "value_item", "" );
95 $t->set_var( "value_list", "" );
96 $t->set_var( "no_values_item", "" );
97
98 $t->set_var( "element_name", $element->name() );
99 $t->set_var( "element_id", $element->id() );
100
101 $t->set_var( "form_id", $FormID );
102
103 $values =& $element->fixedValues();
104
105 if( count( $values ) == 0 )
106 {
107 $t->parse( "no_values_item", "no_values_item_tpl" );
108 }
109 else
110 {
111 $i = 0;
112 foreach( $values as $value )
113 {
114 if ( ( $i % 2 ) == 0 )
115 {
116 $t->set_var( "td_class", "bglight" );
117 }
118 else
119 {
120 $t->set_var( "td_class", "bgdark" );
121 }
122
123 $t->set_var( "value_id", $value->id() );
124 $t->set_var( "value", $value->value() );
125
126 $t->parse( "value_item", "value_item_tpl", true );
127
128 $i++;
129 }
130
131
132 $t->parse( "value_list", "value_list_tpl" );
133 }
134
135 $t->set_var( "action_value", $ActionValue );
136 $t->set_var( "site_style", $SiteDesign );
137 $t->pparse( "output", "value_list_page_tpl" );
138
139 ?>
$i
$i
Definition: admin/adlist.php:91
eZFormElementFixedValue
Definition: ezformelementfixedvalue.php:42
eZFormElement
Definition: ezformelement.php:44
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$Value
$Value
Definition: ezquestionchoice.php:118
$element
$element
Definition: fixedvalues.php:42
$ActionValue
$ActionValue
Definition: fixedvalues.php:37
$Language
$Language
Definition: fixedvalues.php:40
$ini
$ini
Definition: fixedvalues.php:38
$t
if(isset( $AddValue)) if(isset( $Store)||isset( $AddValue)||isset( $DeleteSelected)||isset( $OK)) if(isset( $DeleteSelected)) if(isset( $OK)) $t
Definition: fixedvalues.php:82
$values
$values
Definition: fixedvalues.php:103
exit
exit
Definition: folder.php:81
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.