Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/formview.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: formview.php 8485 2001-11-16 12:53:06Z jhe $
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
31 // include_once( "ezform/classes/ezform.php" );
32 // include_once( "ezform/classes/ezformelement.php" );
33 // include_once( "ezform/classes/ezformelementtype.php" );
34 // include_once( "ezform/classes/ezformrenderer.php" );
35 // include_once( "ezmail/classes/ezmail.php" );
36
37 $ini =& eZINI::instance( 'site.ini' );
38
39 if( strstr( $_SERVER['HTTP_REFERER'], $ini->variable( "eZFormMain", "FromURL" )) || strstr($_SERVER['HTTP_REFERER'], $ini->variable( "eZFormMain", "FromURL" )) || strstr($HTTP_REFERER, $ini->variable( "eZFormMain", "FromURL2" )) )
40 {
41 //pass-through
42 } else {
43 die('eZFormMain is misconfigured: please check your site.ini');
44 }
45
46 if ( isset( $Cancel ) )
47 {
48 if ( !empty( $redirectTo ) )
49 {
50 eZHTTPTool::header( "Location: $redirectTo" );
51 }
52 else
53 {
54 eZHTTPTool::header( "Location: /" );
55 }
56 exit();
57 }
58
59
60 $ActionValue="process";
61
62 $form = new eZForm( $FormID );
63
64 if ( !( $form->id() > 0 ) )
65 {
66 eZHTTPTool::header( "Location: /" );
67 }
68
69 $errorMessages = array();
70
71 $Language = $ini->variable( "eZFormMain", "Language" );
72
73 // init the section
74 if ( isset( $SectionIDOverride ) )
75 {
76 // include_once( "ezsitemanager/classes/ezsection.php" );
77
78 $sectionObject =& eZSection::globalSectionObject( $SectionIDOverride );
79 $sectionObject->setOverrideVariables();
80 }
81
82 $t = new eZTemplate( "kernel/ezform/user/" . $ini->variable( "eZFormMain", "AdminTemplateDir" ),
83 "kernel/ezform/user/intl/", $Language, "form.php" );
84
85 $t->setAllStrings();
86
87 $t->set_file( "form_view_page_tpl", "formview.tpl" );
88
89 $t->set_block( "form_view_page_tpl", "mail_preview_tpl", "mail_preview" );
90
91 $t->set_var( "error", "" );
92 $t->set_var( "form", "" );
93
94 $t->set_var( "form_id", $FormID );
95 $t->set_var( "form_name", $form->name() );
96 $t->set_var( "form_completed_page", $form->completedPage() );
97 $t->set_var( "form_instruction_page", $form->instructionPage() );
98
99 $renderer = new eZFormRenderer( $form );
100 $output =& $renderer->renderForm( $form );
101 $t->set_var( "form", $output );
102
103 if ( isset( $OK ) )
104 {
105 $output = $renderer->verifyForm();
106 if ( $output == "" )
107 {
108 $renderer->sendForm();
109 }
110 else
111 {
112 $t->set_var( "error", $output );
113 $formElements = $form->formElements();
114 foreach ( $formElements as $element )
115 {
116
117 }
118 }
119 }
120
121 $t->pparse( "output", "form_view_page_tpl" );
122
123 ?>
$sectionObject
$sectionObject
Definition: articleheaderlist.php:49
eZFormRenderer
Definition: ezformrenderer.php:50
eZForm
Definition: ezform.php:42
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZSection\globalSectionObject
static & globalSectionObject( $sectionID)
Definition: ezsection.php:366
eZTemplate
Definition: eztemplate.php:107
exit
exit
Definition: folder.php:81
$element
if(! $parent) $element
Definition: folder.php:64
$form
$form
Definition: user/formview.php:62
$t
if(isset( $SectionIDOverride)) $t
Definition: user/formview.php:82
$output
$output
Definition: user/formview.php:100
$errorMessages
if(!( $form->id() > 0)) $errorMessages
Definition: user/formview.php:69
$Language
$Language
Definition: user/formview.php:71
$renderer
$renderer
Definition: user/formview.php:99
$ini
$ini
Definition: user/formview.php:37
$ActionValue
if(isset( $Cancel)) $ActionValue
Definition: user/formview.php:60
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.