TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\Controller\Wizard\FormsController Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Controller\Wizard\FormsController:
SC_wizard_forms

Public Member Functions

 __construct ()
 
 main ()
 
 printContent ()
 
 formsWizard ()
 
 getConfigCode (&$row)
 
 getFormHTML ($formCfgArray, $row)
 
 changeFunc ()
 
 cfgArray2CfgString ($cfgArr)
 
 cfgString2CfgArray ($cfgStr)
 
 cleanT ($tArr)
 
 formatCells ($fArr)
 

Public Attributes

 $doc
 
 $content
 
 $attachmentCounter = 0
 
 $xmlStorage = 0
 
 $P
 
 $FORMCFG
 
 $special
 

Protected Member Functions

 init ()
 
 getButtons ()
 
 checkEditAccess ($table, $uid)
 

Detailed Description

API comments:

The form wizard can help you to create forms - it allows you to create almost any kind of HTML form elements and in any order and amount.

The format for the resulting configuration code can be either a line-based configuration. That can look like this:

Your name: | *name=input | (input your name here!) Your Email: | *email=input Your address: | address=textarea,40,10 Your Haircolor: | hair=radio | upload | attachment=file | quoted_printable=hidden | 0 | formtype_mail=submit | Send form | html_enabled=hidden | subject=hidden | This is the subject

Alternatively it can be XML. The same configuration from above looks like this in XML:

<T3FormWizard> <n2> <type>input</type> <label>Your name:</label> <required>1</required> <fieldname>name</fieldname> <size></size> <max></max> <default>(input your name here!)</default> </n2> <n4> <type>input</type> <label>Your Email:</label> <required>1</required> <fieldname>email</fieldname> <size></size> <max></max> <default></default> </n4> <n6> <type>textarea</type> <label>Your address:</label> <fieldname>address</fieldname> <cols>40</cols> <rows>10</rows> <default></default> </n6> <n8> <type>radio</type> <label>Your Haircolor:</label> <fieldname>hair</fieldname> <options></options> </n8> <n10> <type>file</type> <label>upload</label> <fieldname>attachment</fieldname> <size></size> </n10> <n12> <type>hidden</type> <label></label> <fieldname>quoted_printable</fieldname> <default>0</default> </n12> <n2000> <fieldname>formtype_mail</fieldname> <type>submit</type> <default>Send form</default> </n2000> <n2002> <fieldname>html_enabled</fieldname> <type>hidden</type> </n2002> <n2004> <fieldname>subject</fieldname> <type>hidden</type> <default>This is the subject</default> </n2004> <n20> <content></content> </n20> </T3FormWizard>

The XML/phpArray structure is the internal format of the wizard.

Author
Kasper Skårhøj kaspe.nosp@m.rYYY.nosp@m.Y@typ.nosp@m.o3.c.nosp@m.om

Definition at line 110 of file FormsController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::__construct ( )

Constructor

Definition at line 164 of file FormsController.php.

References $GLOBALS, and TYPO3\CMS\Backend\Controller\Wizard\FormsController\init().

Member Function Documentation

◆ cfgArray2CfgString()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::cfgArray2CfgString (   $cfgArr)

Converts the input array to a configuration code string

Parameters
array$cfgArrArray of form configuration (follows the input structure from the form wizard POST form)
Returns
string The array converted into a string with line-based configuration.
See also
cfgString2CfgArray()
Todo:
Define visibility

Definition at line 639 of file FormsController.php.

◆ cfgString2CfgArray()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::cfgString2CfgArray (   $cfgStr)

Converts the input configuration code string into an array

Parameters
string$cfgStrConfiguration code
Returns
array Configuration array
See also
cfgArray2CfgString()
Todo:
Define visibility

Definition at line 748 of file FormsController.php.

◆ changeFunc()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::changeFunc ( )

Detects if a control button (up/down/around/delete) has been pressed for an item and accordingly it will manipulate the internal FORMCFG array

Returns
void private
Todo:
Define visibility

Definition at line 580 of file FormsController.php.

◆ checkEditAccess()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::checkEditAccess (   $table,
  $uid 
)
protected

Checks access for element

Parameters
string$tableTable name
integer$uidRecord uid
Returns
boolean
Todo:
: Refactor to remove duplicate code (see TableController, RteController)

Definition at line 886 of file FormsController.php.

◆ cleanT()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::cleanT (   $tArr)

Removes any "trailing elements" in the array which consists of whitespace (little like trim() does for strings, so this does for arrays)

Parameters
array$tArrSingle dim array
Returns
array Processed array private
Todo:
Define visibility

Definition at line 836 of file FormsController.php.

◆ formatCells()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::formatCells (   $fArr)

Wraps items in $fArr in table cells/rows, displaying them vertically.

Parameters
array$fArrArray of label/HTML pairs.
Returns
string HTML table private
Todo:
Define visibility

Definition at line 855 of file FormsController.php.

◆ formsWizard()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::formsWizard ( )

Draws the form wizard content

Returns
string HTML content for the form.
Todo:
Define visibility

Definition at line 261 of file FormsController.php.

Referenced by TYPO3\CMS\Backend\Controller\Wizard\FormsController\main().

◆ getButtons()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::getButtons ( )
protected

Create the panel of buttons for submitting the form or otherwise perform operations.

Returns
array All available buttons as an assoc. array

Definition at line 229 of file FormsController.php.

References $GLOBALS, TYPO3\CMS\Backend\Utility\BackendUtility\cshItem(), and TYPO3\CMS\Core\Utility\GeneralUtility\sanitizeLocalUrl().

Referenced by TYPO3\CMS\Backend\Controller\Wizard\FormsController\main().

◆ getConfigCode()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::getConfigCode ( $row)

Will get and return the configuration code string Will also save (and possibly redirect/exit) the content if a save button has been pressed

Parameters
array$rowCurrent parent record row (passed by value!)
Returns
array Configuration Array private
Todo:
Define visibility

Definition at line 293 of file FormsController.php.

◆ getFormHTML()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::getFormHTML (   $formCfgArray,
  $row 
)

Creates the HTML for the Form Wizard:

Parameters
string$formCfgArrayForm config array
array$rowCurrent parent record array
Returns
string HTML for the form wizard private
Todo:
Define visibility

Definition at line 355 of file FormsController.php.

◆ init()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::init ( )
protected

◆ main()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::main ( )

◆ printContent()

TYPO3\CMS\Backend\Controller\Wizard\FormsController::printContent ( )

Outputting the accumulated content to screen

Returns
void
Todo:
Define visibility

Definition at line 220 of file FormsController.php.

References TYPO3\CMS\Backend\Controller\Wizard\FormsController\$content.

Member Data Documentation

◆ $attachmentCounter

TYPO3\CMS\Backend\Controller\Wizard\FormsController::$attachmentCounter = 0
Todo:
Define visibility

Definition at line 131 of file FormsController.php.

◆ $content

TYPO3\CMS\Backend\Controller\Wizard\FormsController::$content

◆ $doc

TYPO3\CMS\Backend\Controller\Wizard\FormsController::$doc

Definition at line 119 of file FormsController.php.

◆ $FORMCFG

TYPO3\CMS\Backend\Controller\Wizard\FormsController::$FORMCFG
Todo:
Define visibility

Definition at line 153 of file FormsController.php.

◆ $P

TYPO3\CMS\Backend\Controller\Wizard\FormsController::$P
Todo:
Define visibility

Definition at line 147 of file FormsController.php.

◆ $special

TYPO3\CMS\Backend\Controller\Wizard\FormsController::$special
Todo:
Define visibility

Definition at line 159 of file FormsController.php.

◆ $xmlStorage

TYPO3\CMS\Backend\Controller\Wizard\FormsController::$xmlStorage = 0
Todo:
Define visibility

Definition at line 140 of file FormsController.php.