Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eztrade/admin/formlist.php
Go to the documentation of this file.
1 <?
3 //
4 // $Id: formlist.php 7602 2001-10-01 10:27:12Z pkej $
5 //
6 // Created on: <15-Jun-2001 15:02:54 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
31 // include_once( "ezform/classes/ezform.php" );
32 // include_once( "eztrade/classes/ezproductform.php" );
33
34 $ActionValue = "list";
35 $ini =& eZINI::instance( 'site.ini' );
36
37 $Language = $ini->variable( "eZFormMain", "Language" );
38
39 $product = new eZProduct( $ProductID );
40 $selectedForm =& eZProductForm::productHasForm( $product );
41
42 if( isset( $OK ) )
43 {
44 if( $selectedFormID > 0 )
45 {
46 $form =& new eZForm( $selectedFormID );
47 $product->deleteForms();
48 $product->addForm( $form );
49 $product->store();
50 $selectedForm =& $form;
51 }
52
53 eZHTTPTool::header( "Location: /trade/productedit/edit/$ProductID/" );
54 exit();
55 }
56
57 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
58 "kernel/eztrade/admin/intl/", $Language, "formlist.php" );
59 $t->setAllStrings();
60
61 $t->set_file( array(
62 "form_list_page_tpl" => "formlist.tpl"
63 ) );
64
65 $t->set_block( "form_list_page_tpl", "no_forms_item_tpl", "no_forms_item" );
66 $t->set_block( "form_list_page_tpl", "form_list_tpl", "form_list" );
67 $t->set_block( "form_list_tpl", "form_item_tpl", "form_item" );
68
69 $t->set_var( "form_item", "" );
70 $t->set_var( "form_list", "" );
71 $t->set_var( "no_forms_item", "" );
72
73 $totalCount =& eZForm::count();
74 $forms =& eZForm::getAll();
75
76 if( count( $forms ) == 0 )
77 {
78 $t->parse( "no_forms_item", "no_forms_item_tpl" );
79 }
80 else
81 {
82 $i = 0;
83 foreach( $forms as $form )
84 {
85 if ( ( $i % 2 ) == 0 )
86 {
87 $t->set_var( "td_class", "bglight" );
88 }
89 else
90 {
91 $t->set_var( "td_class", "bgdark" );
92 }
93
94 if( $selectedForm->id() == $form->id() )
95 {
96 $t->set_var( "selected", "selected" );
97 }
98 else
99 {
100 $t->set_var( "selected", "" );
101 }
102
103 $t->set_var( "form_id", $form->id() );
104 $t->set_var( "form_name", $form->name() );
105 $t->set_var( "form_receiver", $form->receiver() );
106 $t->parse( "form_item", "form_item_tpl", true );
107
108 $i++;
109 }
110
111
112 $t->parse( "form_list", "form_list_tpl" );
113 }
114
115 $t->set_var( "product_id", $ProductID );
116 $t->set_var( "action_value", $ActionValue );
117 $t->set_var( "site_style", $SiteDesign );
118 $t->pparse( "output", "form_list_page_tpl" );
119
120 ?>
$i
$i
Definition: admin/adlist.php:91
eZForm
Definition: ezform.php:42
eZForm\count
static count()
Definition: ezform.php:243
eZForm\getAll
static & getAll( $offset=0, $limit=20)
Definition: ezform.php:209
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZProductForm\productHasForm
& productHasForm(&$object)
Definition: ezproductform.php:255
eZProduct
Definition: ezproduct.php:71
eZTemplate
Definition: eztemplate.php:107
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$selectedForm
$selectedForm
Definition: eztrade/admin/formlist.php:40
$product
$product
Definition: eztrade/admin/formlist.php:39
$ActionValue
$ActionValue
Definition: eztrade/admin/formlist.php:34
$Language
$Language
Definition: eztrade/admin/formlist.php:37
$forms
$forms
Definition: eztrade/admin/formlist.php:74
$ini
$ini
Definition: eztrade/admin/formlist.php:35
$t
if(isset( $OK)) $t
Definition: eztrade/admin/formlist.php:57
$totalCount
$totalCount
Definition: eztrade/admin/formlist.php:73
exit
exit
Definition: folder.php:81
$form
$form
Definition: formedit.php:46
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.