Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezform/user/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 8485 2001-11-16 12:53:06Z jhe $
5 //
6 // Created on: <23-Oct-2000 17:53:46 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 // include_once( "classes/ezhttptool.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "ezmail/classes/ezmail.php" );
30
31 $eZFormOperation = $url_array[2];
32 $eZFormName = $url_array[3];
33 $eZFormAction = $url_array[3];
34
35 function &errorPage( $PrimaryName, $PrimaryURL, $type )
36 {
37 // $ini =& eZINI::instance( 'site.ini' );
38 $ini =& eZINI::instance( 'site.ini' );
39
40
41 $t = new eZTemplate( "kernel/ezform/admin/" . $ini->variable( "eZFormMain", "TemplateDir" ),
42 "kernel/ezform/admin/intl", $ini->variable( "eZFormMain", "Language" ), "errors.php" );
43
44 $t->set_file( "page", "errormessage.tpl" );
45 $t->set_var( "primary_url", $PrimaryURL );
46 $t->set_var( "primary_url_name", $t->Ini->variable( "strings", $PrimaryName ) );
47
48 $t->set_var( "error_header", $t->Ini->variable( "strings", error_ . $type . _header ) );
49 $t->set_var( "error_1", $t->Ini->variable( "strings", error_ . $type . _1 ) );
50 $t->set_var( "error_2", $t->Ini->variable( "strings", error_ . $type . _2 ) );
51 $t->set_var( "error_3", $t->Ini->variable( "strings", error_ . $type . _3 ) );
52
53 $t->setAllStrings();
54
55 $error = $t->parse( "error", "page" );
56 $Info =& stripslashes( $error );
57 $error =& urlencode( $Info );
58 return $error;
59 }
60
61 // $mailSendTo = "";
62 // $mailSendFrom = "";
63 // $mailSubject = "";
64 // $mailMessage = "";
65 // $redirectTo = "";
66
67 function formProcess( $value, $key )
68 {
69 global $mailSendTo;
70 global $mailSendFrom;
71 global $mailSubject;
72 global $mailMessage;
73 global $redirectTo;
74
75 switch ( $key )
76 {
77 case "submit":
78 {
79 }
80 break;
81
82 case "redirectTo":
83 {
84 $redirectTo = $value;
85 }
86 break;
87
88 case "mailSendTo":
89 {
90 $mailSendTo = $value;
91 }
92 break;
93
94 case "mailSendFrom":
95 {
96 $mailSendFrom = $value;
97 }
98 break;
99
100 case "mailSubject":
101 {
102 $mailSubject = $value;
103 }
104 break;
105
106 default:
107 $mailMessage = $mailMessage . "$key:\n$value\n\n";
108 break;
109 }
110 }
111
112 switch ( $eZFormOperation )
113 {
114 case "form":
115 {
116 $FormID = $url_array[4];
117 $SectionIDOverride = $url_array[5];
118
119 switch ( $eZFormAction )
120 {
121 case "view":
122 case "process":
123 {
124 include( "kernel/ezform/user/formview.php" );
125 }
126 break;
127
128 default:
129 {
130 eZHTTPTool::header( "Location: /error/404" );
131 }
132 }
133
134
135 }
136 break;
137
138 case "simpleprocess":
139 {
140 if ( $HTTP_POST_VARS )
141 {
142 array_walk( $HTTP_POST_VARS, "formProcess" );
143
144 $mail = new eZMail();
145 $mail->setSubject( $mailSubject );
146 $mail->setBody( $mailMessage );
147 $mail->setFrom( $mailSendFrom );
148 $mail->setTo( $mailSendTo );
149 $mail->send();
150 }
151
152 if ( !empty( $redirectTo ) )
153 {
154 eZHTTPTool::header( "Location: $redirectTo" );
155 }
156 else
157 {
158 eZHTTPTool::header( "Location: /" );
159 }
160 }
161 break;
162
163 default:
164 {
165 eZHTTPTool::header( "Location: /error/404" );
166 }
167 break;
168 }
169
170 ?>
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZMail
Definition: ezmail.php:57
eZTemplate
Definition: eztemplate.php:107
$t
foreach( $Modules as $module) if(isset( $ItemInsert)) $t
Definition: classes/admin/linklist.php:168
$ini
$ini
Definition: classes/admin/linklist.php:64
$type
$type
Definition: classes/admin/linkselect.php:220
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$error
$error
Definition: ezarticle/admin/categoryedit.php:51
$mail
$mail
Definition: ezbulkmail/admin/maillist.php:61
formProcess
formProcess( $value, $key)
Definition: ezform/user/datasupplier.php:67
errorPage
& errorPage( $PrimaryName, $PrimaryURL, $type)
Definition: ezform/user/datasupplier.php:35
$eZFormName
$eZFormName
Definition: ezform/user/datasupplier.php:32
$eZFormOperation
$eZFormOperation
Definition: ezform/user/datasupplier.php:31
$eZFormAction
$eZFormAction
Definition: ezform/user/datasupplier.php:33
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.