Added more comments, $Id$ keywords etc for the whole core of TYPO3.
[Packages/TYPO3.CMS.git] / typo3 / wizard_forms.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 Kasper Skaarhoj (kasper@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Wizard to help make forms (fx. for tt_content elements) of type "form".
29 *
30 * $Id$
31 *
32 * @author Kasper Skaarhoj <kasper@typo3.com>
33 */
34 /**
35 * [CLASS/FUNCTION INDEX of SCRIPT]
36 *
37 *
38 *
39 * 80: class SC_wizard_forms
40 * 89: function init()
41 * 119: function main()
42 * 135: function printContent()
43 *
44 * SECTION: OTHER FUNCTIONS:
45 * 158: function changeFunc($cArr,$TABLE_c)
46 * 218: function cleanT($tArr)
47 * 235: function formatCells($fArr)
48 * 251: function tableWizard($P)
49 *
50 * TOTAL FUNCTIONS: 7
51 * (This index is automatically created/updated by the extension "extdeveval")
52 *
53 */
54
55
56
57 $BACK_PATH='';
58 require ('init.php');
59 require ('template.php');
60 include ('sysext/lang/locallang_wizards.php');
61
62
63
64
65
66
67
68
69
70
71
72
73 /**
74 * Script Class
75 *
76 * @author Kasper Skaarhoj <kasper@typo3.com>
77 * @package TYPO3
78 * @subpackage core
79 */
80 class SC_wizard_forms {
81 var $include_once=array();
82 var $content;
83 var $P;
84 var $doc;
85
86 /**
87 * @return [type] ...
88 */
89 function init() {
90 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
91
92 $this->P = t3lib_div::GPvar('P',1);
93
94 $this->doc = t3lib_div::makeInstance('mediumDoc');
95 $this->doc->backPath = $BACK_PATH;
96 $this->doc->JScode='
97 <script language="javascript" type="text/javascript">
98 function jumpToUrl(URL,formEl) { /
99 document.location = URL;
100 }
101 </script>
102 ';
103
104 list($rUri) = explode("#",t3lib_div::getIndpEnv("REQUEST_URI"));
105 $this->doc->form ='<form action="'.$rUri.'" method="POST" name="wizardForm">';
106
107 $this->content.=$this->doc->startPage("Table");
108
109 if ($HTTP_POST_VARS["savedok_x"] || $HTTP_POST_VARS["saveandclosedok_x"]) {
110 $this->include_once[]=PATH_t3lib."class.t3lib_tcemain.php";
111 }
112 }
113
114 /**
115 * [Describe function...]
116 *
117 * @return [type] ...
118 */
119 function main() {
120 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
121
122 if ($this->P["table"] && $this->P["field"] && $this->P["uid"]) {
123 $this->content.=$this->doc->section($LANG->getLL("forms_title"),$this->tableWizard($this->P),0,1);
124 } else {
125 $this->content.=$this->doc->section($LANG->getLL("forms_title"),$GLOBALS["TBE_TEMPLATE"]->rfw($LANG->getLL("table_noData")),0,1);
126 }
127 $this->content.=$this->doc->endPage();
128 }
129
130 /**
131 * [Describe function...]
132 *
133 * @return [type] ...
134 */
135 function printContent() {
136 echo $this->content;
137 }
138
139
140
141
142
143
144
145
146
147 /****************************
148 *
149 * OTHER FUNCTIONS:
150 *
151 ***************************/
152
153 /**
154 * @param [type] $cArr: ...
155 * @param [type] $TABLE_c: ...
156 * @return [type] ...
157 */
158 function changeFunc($cArr,$TABLE_c) {
159 if ($TABLE_c["row_remove"]) {
160 $kk = key($TABLE_c["row_remove"]);
161 $cmd="row_remove";
162 } elseif ($TABLE_c["row_add"]) {
163 $kk = key($TABLE_c["row_add"]);
164 $cmd="row_add";
165 } elseif ($TABLE_c["row_top"]) {
166 $kk = key($TABLE_c["row_top"]);
167 $cmd="row_top";
168 } elseif ($TABLE_c["row_bottom"]) {
169 $kk = key($TABLE_c["row_bottom"]);
170 $cmd="row_bottom";
171 } elseif ($TABLE_c["row_up"]) {
172 $kk = key($TABLE_c["row_up"]);
173 $cmd="row_up";
174 } elseif ($TABLE_c["row_down"]) {
175 $kk = key($TABLE_c["row_down"]);
176 $cmd="row_down";
177 }
178
179 if ($cmd && t3lib_div::testInt($kk)) {
180 if (substr($cmd,0,4)=="row_") {
181 switch($cmd) {
182 case "row_remove":
183 unset($cArr[$kk]);
184 break;
185 case "row_add":
186 $cArr[$kk+1]=array();
187 break;
188 case "row_top":
189 $cArr[1]=$cArr[$kk];
190 unset($cArr[$kk]);
191 break;
192 case "row_bottom":
193 $cArr[1000000]=$cArr[$kk];
194 unset($cArr[$kk]);
195 break;
196 case "row_up":
197 $cArr[$kk-3]=$cArr[$kk];
198 unset($cArr[$kk]);
199 break;
200 case "row_down":
201 $cArr[$kk+3]=$cArr[$kk];
202 unset($cArr[$kk]);
203 break;
204 }
205 ksort($cArr);
206 }
207 }
208
209 return $cArr;
210 }
211
212 /**
213 * [Describe function...]
214 *
215 * @param [type] $tArr: ...
216 * @return [type] ...
217 */
218 function cleanT($tArr) {
219 for($a=count($tArr);$a>0;$a--) {
220 if (strcmp($tArr[$a-1],"")) {
221 break;
222 } else {
223 unset($tArr[$a-1]);
224 }
225 }
226 return $tArr;
227 }
228
229 /**
230 * [Describe function...]
231 *
232 * @param [type] $fArr: ...
233 * @return [type] ...
234 */
235 function formatCells($fArr) {
236 reset($fArr);
237 $lines=array();
238 while(list($l,$c)=each($fArr)) {
239 $lines[]='<tr><td nowrap>'.htmlspecialchars($l.":").'&nbsp;</td><td>'.$c.'</td></tr>';
240 }
241 $lines[]='<tr><td nowrap><img src=clear.gif width=70 height=1></td><td></td></tr>';
242 return '<table border=0 cellpadding=0 cellspacing=0>'.implode("",$lines).'</table>';
243 }
244
245 /**
246 * [Describe function...]
247 *
248 * @param [type] $P: ...
249 * @return [type] ...
250 */
251 function tableWizard($P) {
252 global $LANG, $HTTP_POST_VARS;
253
254 $TABLE_c = t3lib_div::GPvar("TABLE",1);
255 $row=t3lib_BEfunc::getRecord($P["table"],$P["uid"]);
256 if (!is_array($row)) {
257 t3lib_BEfunc::typo3PrintError ("Wizard Error","No reference to record",0);
258 exit;
259 }
260
261 $special=t3lib_div::GPvar("special");
262
263 if (isset($TABLE_c["c"])) {
264 $TABLE_c["c"] = $this->changeFunc($TABLE_c["c"],$TABLE_c);
265 $inLines=array();
266
267 reset($TABLE_c["c"]);
268 while(list($a,$vv)=each($TABLE_c["c"])) {
269 if ($vv["content"]) {
270 $inLines[]=trim($vv["content"]);
271 } else {
272 $thisLine=array();
273 // Label:
274 $thisLine[0]=str_replace("|","",$vv["label"]);
275
276 // Type:
277 if ($vv["type"]) {
278 $thisLine[1]=($vv["required"]?"*":"").str_replace(",","",($vv["fieldname"]?$vv["fieldname"]."=":"").$vv["type"]);
279 // Default:
280 $tArr=array("","","","","","");
281 switch((string)$vv["type"]) {
282 case "textarea":
283 if (intval($vv["cols"])) $tArr[0]=intval($vv["cols"]);
284 if (intval($vv["rows"])) $tArr[1]=intval($vv["rows"]);
285 if (trim($vv["extra"])) $tArr[2]=trim($vv["extra"]);
286 break;
287 case "input":
288 case "password":
289 if (intval($vv["size"])) $tArr[0]=intval($vv["size"]);
290 if (intval($vv["max"])) $tArr[1]=intval($vv["max"]);
291 break;
292 case "file":
293 if (intval($vv["size"])) $tArr[0]=intval($vv["size"]);
294 break;
295 case "select":
296 if (intval($vv["size"])) $tArr[0]=intval($vv["size"]);
297 if ($vv["autosize"]) $tArr[0]="auto";
298 if ($vv["multiple"]) $tArr[1]="m";
299 break;
300 }
301 $tArr = $this->cleanT($tArr);
302 if (count($tArr)) $thisLine[1].=",".implode(",",$tArr);
303
304 $thisLine[1]=str_replace("|","",$thisLine[1]);
305
306
307
308 // Default:
309 if ($vv["type"]=="select" || $vv["type"]=="radio") {
310 $thisLine[2]=str_replace(chr(10),", ",str_replace(",","",$vv["options"]));
311 } elseif ($vv["type"]=="check") {
312 if ($vv["checked"]) $thisLine[2]=1;
313 } elseif (strcmp(trim($vv["default"]),"")) {
314 $thisLine[2]=$vv["default"];
315 }
316 if (isset($thisLine[2])) $thisLine[2]=str_replace("|","",$thisLine[2]);
317 }
318 // Compile line:
319 $inLines[]=ereg_replace("[\n\r]*","",implode(" | ",$thisLine));
320 }
321 }
322 $bodyText = implode(chr(10),$inLines);
323 //debug(array($bodyText));
324
325
326
327 if ($HTTP_POST_VARS["savedok_x"] || $HTTP_POST_VARS["saveandclosedok_x"]) {
328 $tce = t3lib_div::makeInstance("t3lib_TCEmain");
329 $tce->stripslashes_values=0;
330 $data=array();
331 $data[$P["table"]][$P["uid"]][$P["field"]]=$bodyText;
332 if ($special=="formtype_mail") {
333 $data[$P["table"]][$P["uid"]]["subheader"]=$TABLE_c["recipient"];
334 }
335
336 //debug($data);
337 $tce->start($data,array());
338 $tce->process_datamap();
339
340 $row=t3lib_BEfunc::getRecord($P["table"],$P["uid"]);
341 if ($HTTP_POST_VARS["saveandclosedok_x"]) {
342 header("Location: ".t3lib_div::locationHeaderUrl($P["returnUrl"]));
343 exit;
344 }
345 }
346 } else {
347 $bodyText = $row["bodytext"];
348 }
349 //$bodyText = $row["bodytext"];
350
351
352 $specParts=array();
353 $hiddenFields=array();
354 $tRows=array();
355 $cells=array(
356 '<strong>'.$LANG->getLL("forms_preview").':</strong>',
357 '<strong>'.$LANG->getLL("forms_element").':</strong>',
358 '<strong>'.$LANG->getLL("forms_config").':</strong>',
359 );
360 $tRows[]='<tr bgColor="'.$this->doc->bgColor2.'"><td>&nbsp;</td><td nowrap>'.implode('</td><td nowrap valign=top>',$cells).'</td></tr>';
361
362 $tLines=explode(chr(10),$bodyText);
363 //debug($tLines);
364 reset($tLines);
365 while(list($k,$v)=each($tLines)) {
366 $cells=array();
367 $confData=array();
368
369 $val=trim($v);
370 $parts = t3lib_div::trimExplode("|",$val);
371
372 if (!trim($val) || strcspn($val,"#/")) { // $val &&
373 // label:
374 $confData["label"] = trim($parts[0]);
375 // field:
376 $fParts = t3lib_div::trimExplode(",",$parts[1]);
377 $fParts[0]=trim($fParts[0]);
378 if (substr($fParts[0],0,1)=="*") {
379 $confData["required"]=1;
380 $fParts[0] = substr($fParts[0],1);
381 }
382 $typeParts = t3lib_div::trimExplode("=",$fParts[0]);
383 $confData["type"] = trim(strtolower(end($typeParts)));
384 if (count($typeParts)==1) {
385 $confData["fieldname"] = substr(ereg_replace("[^a-zA-Z0-9_]","",str_replace(" ","_",trim($parts[0]))),0,30);
386 /* if (strtolower($confData["fieldname"])=="email") {$confData["fieldname"]="email";}
387 // Duplicate fieldnames resolved
388 if (isset($fieldname_hashArray[md5($confData["fieldname"])])) {
389 $confData["fieldname"].="_".$cc;
390 }
391 $fieldname_hashArray[md5($confData["fieldname"])]=$confData["fieldname"];
392 */
393 // Attachment names...
394 if ($confData["type"]=="file") {
395 $confData["fieldname"]="attachment".$attachmentCounter;
396 $attachmentCounter=intval($attachmentCounter)+1;
397 }
398 } else {
399 $confData["fieldname"] = str_replace(" ","_",trim($typeParts[0]));
400 }
401
402 if ($special=="formtype_mail" && t3lib_div::inList("formtype_mail,subject,html_enabled",$confData["fieldname"])) {
403 $specParts[$confData["fieldname"]]=$parts[2];
404 } else {
405 // Render title/field preview
406 $cells[]=$confData["type"]!="hidden" ? '<strong>'.htmlspecialchars($confData["label"]).'</strong>' : '';
407
408 $temp_cells=array();
409 // Field type
410 $opt=array();
411 $opt[]='<option value=""></option>';
412 $types = explode(",","input,textarea,select,check,radio,password,file,hidden,submit");
413 while(list(,$t)=each($types)) {
414 $opt[]='<option value="'.$t.'"'.($confData["type"]==$t?" SELECTED":"").'>'.htmlspecialchars($LANG->getLL("forms_type_".$t)).'</option>';
415 }
416 $temp_cells[$LANG->getLL("forms_type")]='<select name="TABLE[c]['.(($k+1)*2).'][type]">'.implode("",$opt).'</select>';
417 // Title field
418 $temp_cells[$LANG->getLL("forms_label")]='<input type="text"'.$this->doc->formWidth(15).' name="TABLE[c]['.(($k+1)*2).'][label]" value="'.htmlspecialchars($confData["label"]).'">';
419 // Required
420 if (!t3lib_div::inList(",hidden,submit",$confData["type"])) $temp_cells[$LANG->getLL("forms_required")]='<input type="checkbox" name="TABLE[c]['.(($k+1)*2).'][required]" value="1"'.($confData["required"]?" CHECKED":"").t3lib_BEfunc::titleAttrib($LANG->getLL("forms_required"),1).'>';
421
422 $cells[]=$this->formatCells($temp_cells);
423 $temp_cells=array();
424
425 // Fieldname
426 $temp_cells[$LANG->getLL("forms_fieldName")]='<input type="text"'.$this->doc->formWidth(10).' name="TABLE[c]['.(($k+1)*2).'][fieldname]" value="'.htmlspecialchars($confData["fieldname"]).'"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_fieldName"),1).'>';
427 switch((string)$confData["type"]) {
428 case "textarea":
429 $temp_cells[$LANG->getLL("forms_cols")]='<input type="text"'.$this->doc->formWidth(5).' name="TABLE[c]['.(($k+1)*2).'][cols]" value="'.htmlspecialchars($fParts[1]).'"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_cols"),1).'>';
430 $temp_cells[$LANG->getLL("forms_rows")]='<input type="text"'.$this->doc->formWidth(5).' name="TABLE[c]['.(($k+1)*2).'][rows]" value="'.htmlspecialchars($fParts[2]).'"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_rows"),1).'>';
431 $temp_cells[$LANG->getLL("forms_extra")]='<input type="checkbox" name="TABLE[c]['.(($k+1)*2).'][extra]" value="OFF"'.(strtoupper($fParts[3])=="OFF"?" CHECKED":"").t3lib_BEfunc::titleAttrib($LANG->getLL("forms_extra"),1).'>';
432 break;
433 case "input":
434 case "password":
435 $temp_cells[$LANG->getLL("forms_size")]='<input type="text"'.$this->doc->formWidth(5).' name="TABLE[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars($fParts[1]).'"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_size"),1).'>';
436 $temp_cells[$LANG->getLL("forms_max")]='<input type="text"'.$this->doc->formWidth(5).' name="TABLE[c]['.(($k+1)*2).'][max]" value="'.htmlspecialchars($fParts[2]).'"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_max"),1).'>';
437 break;
438 case "file":
439 $temp_cells[$LANG->getLL("forms_size")]='<input type="text"'.$this->doc->formWidth(5).' name="TABLE[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars($fParts[1]).'"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_size"),1).'>';
440 break;
441 case "select":
442 $temp_cells[$LANG->getLL("forms_size")]='<input type="text"'.$this->doc->formWidth(5).' name="TABLE[c]['.(($k+1)*2).'][size]" value="'.htmlspecialchars(intval($fParts[1])?$fParts[1]:"").'"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_size"),1).'>';
443 $temp_cells[$LANG->getLL("forms_autosize")]='<input type="checkbox" name="TABLE[c]['.(($k+1)*2).'][autosize]" value="1"'.(strtolower(trim($fParts[1]))=="auto"?" CHECKED":"").t3lib_BEfunc::titleAttrib($LANG->getLL("forms_autosize"),1).'>';
444 $temp_cells[$LANG->getLL("forms_multiple")]='<input type="checkbox" name="TABLE[c]['.(($k+1)*2).'][multiple]" value="1"'.(strtolower(trim($fParts[2]))=="m"?" CHECKED":"").t3lib_BEfunc::titleAttrib($LANG->getLL("forms_multiple"),1).'>';
445 break;
446 }
447
448 // Default data
449 if ($confData["type"]=="select" || $confData["type"]=="radio") {
450 $temp_cells[$LANG->getLL("forms_options")]='<textarea '.$this->doc->formWidthText(15).' rows="4" name="TABLE[c]['.(($k+1)*2).'][options]"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_options"),1).'>'.t3lib_div::formatForTextarea(implode(chr(10),t3lib_div::trimExplode(",",$parts[2]))).'</textarea>';
451 } elseif ($confData["type"]=="check") {
452 $temp_cells[$LANG->getLL("forms_checked")]='<input type="checkbox" name="TABLE[c]['.(($k+1)*2).'][default]" value="1"'.(trim($parts[2])?" CHECKED":"").t3lib_BEfunc::titleAttrib($LANG->getLL("forms_checked"),1).'>';
453 } elseif ($confData["type"] && $confData["type"]!="file") {
454 $temp_cells[$LANG->getLL("forms_default")]='<input type="text"'.$this->doc->formWidth(15).' name="TABLE[c]['.(($k+1)*2).'][default]" value="'.htmlspecialchars($parts[2]).'"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_default"),1).'>';
455 }
456
457 $cells[]=$confData["type"]?$this->formatCells($temp_cells):"";
458
459 // CTRL panel:
460 $ctrl="";
461 $onClick="document.wizardForm.action+='#ANC_".(($k+1)*2-2)."';";
462 $onClick=' onClick="'.$onClick.'"';
463
464 $brTag=$inputStyle?"":"<BR>";
465 if ($k!=0) {
466 $ctrl.='<input type="image" name="TABLE[row_up]['.(($k+1)*2).']" src="gfx/pil2up.gif" width="12" vspace=2 height="7" hspace=1 border="0"'.$onClick.t3lib_BEfunc::titleAttrib($LANG->getLL("table_up")).'>'.$brTag;
467 } else {
468 $ctrl.='<input type="image" name="TABLE[row_bottom]['.(($k+1)*2).']" src="gfx/turn_up.gif" width="11" vspace=2 height="9" hspace=1 border="0"'.$onClick.t3lib_BEfunc::titleAttrib($LANG->getLL("table_bottom")).'>'.$brTag;
469 }
470 $ctrl.='<input type="image" name="TABLE[row_remove]['.(($k+1)*2).']" src="gfx/garbage.gif" width="11" height="12" border="0"'.$onClick.t3lib_BEfunc::titleAttrib($LANG->getLL("table_removeRow")).'>'.$brTag;
471 if (($k+1)!=count($tLines)) {
472 $ctrl.='<input type="image" name="TABLE[row_down]['.(($k+1)*2).']" src="gfx/pil2down.gif" width="12" vspace=2 height="7" hspace=1 border="0"'.$onClick.t3lib_BEfunc::titleAttrib($LANG->getLL("table_down")).'>'.$brTag;
473 } else {
474 $ctrl.='<input type="image" name="TABLE[row_top]['.(($k+1)*2).']" src="gfx/turn_down.gif" width="11" vspace=2 height="9" hspace=1 border="0"'.$onClick.t3lib_BEfunc::titleAttrib($LANG->getLL("table_top")).'>'.$brTag;
475 }
476 $ctrl.='<input type="image" name="TABLE[row_add]['.(($k+1)*2).']" src="gfx/add.gif" width="12" height="12" border="0"'.$onClick.t3lib_BEfunc::titleAttrib($LANG->getLL("table_addRow")).'>'.$brTag;
477
478 $bgC = $confData["type"]?' bgColor="'.$this->doc->bgColor5.'"':'';
479 $tRows[]='<tr'.$bgC.'><td><a name="ANC_'.(($k+1)*2).'"></a>'.$ctrl.'</td><td bgColor="'.$this->doc->bgColor4.'">'.implode('</td><td valign=top>',$cells).'</td></tr>';
480 }
481 } else {
482 $hiddenFields[]='<input type="hidden" name="TABLE[c]['.(($k+1)*2).'][content]" value="'.htmlspecialchars(trim($v)).'">';
483 }
484 }
485
486 if ($special=="formtype_mail") {
487 //debug($specParts);
488 // SUbject
489 $tRows[]='<tr><td colspan=4>&nbsp;</td></tr>';
490 // SUbject
491 $tRows[]='<tr><td colspan=2 bgColor="'.$this->doc->bgColor2.'">&nbsp;</td><td colspan=2 bgColor="'.$this->doc->bgColor2.'"><strong>'.htmlspecialchars($LANG->getLL("forms_special_eform")).':</strong></td></tr>';
492 // SUbject
493 $tRows[]='<tr bgColor="'.$this->doc->bgColor5.'">
494 <td>&nbsp;</td>
495 <td bgColor="'.$this->doc->bgColor4.'">&nbsp;</td>
496 <td>'.$LANG->getLL("forms_eform_formtype_mail").':</td>
497 <td><input type="hidden" name="TABLE[c]['.(1000*2).'][fieldname]" value="formtype_mail"><input type="hidden" name="TABLE[c]['.(1000*2).'][type]" value="submit"><input type="text"'.$this->doc->formWidth(15).' name="TABLE[c]['.(1000*2).'][default]" value="'.htmlspecialchars($specParts["formtype_mail"]).'"></td>
498 </tr>';
499 $tRows[]='<tr bgColor="'.$this->doc->bgColor5.'">
500 <td>&nbsp;</td>
501 <td bgColor="'.$this->doc->bgColor4.'">&nbsp;</td>
502 <td>'.$LANG->getLL("forms_eform_html_enabled").':</td>
503 <td><input type="hidden" name="TABLE[c]['.(1001*2).'][fieldname]" value="html_enabled"><input type="hidden" name="TABLE[c]['.(1001*2).'][type]" value="hidden"><input type="checkbox" name="TABLE[c]['.(1001*2).'][default]" value="1"'.($specParts["html_enabled"]?" CHECKED":"").'></td>
504 </tr>';
505 $tRows[]='<tr bgColor="'.$this->doc->bgColor5.'">
506 <td>&nbsp;</td>
507 <td bgColor="'.$this->doc->bgColor4.'">&nbsp;</td>
508 <td>'.$LANG->getLL("forms_eform_subject").':</td>
509 <td><input type="hidden" name="TABLE[c]['.(1002*2).'][fieldname]" value="subject"><input type="hidden" name="TABLE[c]['.(1002*2).'][type]" value="hidden"><input type="text"'.$this->doc->formWidth(15).' name="TABLE[c]['.(1002*2).'][default]" value="'.htmlspecialchars($specParts["subject"]).'"></td>
510 </tr>';
511 $tRows[]='<tr bgColor="'.$this->doc->bgColor5.'">
512 <td>&nbsp;</td>
513 <td bgColor="'.$this->doc->bgColor4.'">&nbsp;</td>
514 <td>'.$LANG->getLL("forms_eform_recipient").':</td>
515 <td><input type="text"'.$this->doc->formWidth(15).' name="TABLE[recipient]" value="'.htmlspecialchars($row["subheader"]).'"></td>
516 </tr>';
517 }
518
519
520 //
521 $content = '<table border=0 cellpadding=1 cellspacing=1>'.implode("",$tRows).'</table>';
522
523 $closeUrl = $P["returnUrl"];
524
525 $content.= '<BR>';
526 $content.= '<input type="image" border=0 name="savedok" src="gfx/savedok.gif" hspace=2 width="21" height="16"'.t3lib_BEfunc::titleAttrib($LANG->sL("LLL:EXT:lang/locallang_core.php:rm.saveDoc"),1).' align=top>';
527 $content.= '<input type="image" border=0 name="saveandclosedok" src="gfx/saveandclosedok.gif" hspace=2 width="21" height="16"'.t3lib_BEfunc::titleAttrib($LANG->sL("LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc"),1).' align=top>';
528 $content.= '<a href="#" onClick="jumpToUrl(unescape(\''.rawurlencode($closeUrl).'\')); return false;"><img border=0 src="gfx/closedok.gif" hspace=2 width="21" height="16"'.t3lib_BEfunc::titleAttrib($LANG->sL("LLL:EXT:lang/locallang_core.php:rm.closeDoc"),1).' align=top></a>';
529 $content.= '<input type="image" name="_refresh" src="gfx/refresh_n.gif" width="14" height="14" hspace=10 border="0"'.t3lib_BEfunc::titleAttrib($LANG->getLL("forms_refresh")).'>';
530 $content.= implode("",$hiddenFields);
531
532 return $content;
533 }
534 }
535
536 // Include extension?
537 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_forms.php']) {
538 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/wizard_forms.php']);
539 }
540
541
542
543
544
545
546
547
548
549
550
551
552 // Make instance:
553 $SOBE = t3lib_div::makeInstance('SC_wizard_forms');
554 $SOBE->init();
555
556 // Include files?
557 reset($SOBE->include_once);
558 while(list(,$INC_FILE)=each($SOBE->include_once)) {include_once($INC_FILE);}
559
560 $SOBE->main();
561 $SOBE->printContent();
562 ?>