![]() |
TYPO3
7.6
|
Public Member Functions | |
convert ($json) | |
Protected Member Functions | |
convertToTyposcriptArray (array $elements, array &$parent, $childrenWithParentName=false) | |
getContainer (array $element, array &$parent, $elementCounter, $childrenWithParentName=false) | |
getForm (array $element, array &$parent, $elementCounter) | |
getDefaultElementSetup (array $element, array &$parent, $elementCounter, $childrenWithParentName=false) | |
getContentObjectType (array $element) | |
setConfiguration (array $element, array &$parent, $elementCounter, $childrenWithParentName=false) | |
setAttributes (array $attributes, array &$parent, $elementCounter, $childrenWithParentName=false) | |
setConfirmation ($confirmation, array &$parent, $elementCounter) | |
setFilters (array $filters, array &$parent, $elementCounter) | |
setLabel (array $label, array &$parent, $elementCounter) | |
setLayout (array $element, $value, array &$parent, $elementCounter) | |
setLegend (array $legend, array &$parent, $elementCounter) | |
setOptions (array $element, array $options, array &$parent, $elementCounter) | |
setPostProcessor (array $postProcessors, array &$parent, $elementCounter) | |
setPrefix ($prefix, array &$parent, $elementCounter) | |
setValidationRules (array $element, array $validationRules) | |
setVarious (array $element, array $various, array &$parent, $elementCounter) | |
typoscriptArrayToString (array $typoscriptArray, $addKey= '', $tabCount=-1) | |
Protected Attributes | |
$elementId = 0 | |
$validationRules = array() | |
$validationRulesCounter = 1 | |
Json to Typoscript converter
Takes the incoming Json and converts it to Typoscipt
Definition at line 22 of file JsonToTypoScript.php.
convert | ( | $json | ) |
Convert JSON to TypoScript
First a TypoScript array is constructed, which will be converted to a formatted string
string | $json | Json containing all configuration for the form |
Definition at line 55 of file JsonToTypoScript.php.
References JsonToTypoScript\convertToTyposcriptArray(), and JsonToTypoScript\typoscriptArrayToString().
|
protected |
Converts the JSON array for each element to a TypoScript array and adds this Typoscript array to the parent
array | $elements | The JSON array |
array | $parent | The parent element |
bool | $childrenWithParentName | Indicates if the children use the parent name |
Definition at line 76 of file JsonToTypoScript.php.
References JsonToTypoScript\getContainer(), JsonToTypoScript\getDefaultElementSetup(), and JsonToTypoScript\getForm().
Referenced by JsonToTypoScript\convert(), and JsonToTypoScript\getContainer().
|
protected |
Called for elements are a container for other elements like FORM and FIELDSET
array | $element | The JSON array for this element |
array | $parent | The parent element |
bool | $childrenWithParentName | Indicates if the children use the parent name |
int | $elementCounter | The element counter |
Definition at line 148 of file JsonToTypoScript.php.
References JsonToTypoScript\convertToTyposcriptArray().
Referenced by JsonToTypoScript\convertToTyposcriptArray().
|
protected |
Returns the content object type which is related to the ExtJS xtype
array | $element | The JSON array for this element |
Definition at line 205 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\getDefaultElementSetup().
|
protected |
Called for each element
Adds the content object type to the parent array and starts adding the configuration for the element
array | $element | The JSON array for this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
bool | $childrenWithParentName | Indicates if the children use the parent name |
Definition at line 187 of file JsonToTypoScript.php.
References JsonToTypoScript\getContentObjectType(), and JsonToTypoScript\setConfiguration().
Referenced by JsonToTypoScript\convertToTyposcriptArray().
|
protected |
Only called for the type FORM
Adds the validation rules to the form. In the wizard they are added to each element. In this script the validation rules are stored in a separate array to add them to the form at a later point.
array | $element | The JSON array for this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 167 of file JsonToTypoScript.php.
References JsonToTypoScript\$validationRules.
Referenced by JsonToTypoScript\convertToTyposcriptArray().
|
protected |
Set the attributes for the element
array | $attributes | The JSON array for the attributes of this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
bool | $childrenWithParentName | Indicates if the children use the parent name |
Definition at line 303 of file JsonToTypoScript.php.
References JsonToTypoScript\$elementId.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Iterates over the various configuration settings and calls the appropriate function for each setting
array | $element | The JSON array for this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
bool | $childrenWithParentName | Indicates if the children use the parent name |
Definition at line 251 of file JsonToTypoScript.php.
References JsonToTypoScript\setAttributes(), JsonToTypoScript\setConfirmation(), JsonToTypoScript\setFilters(), JsonToTypoScript\setLabel(), JsonToTypoScript\setLayout(), JsonToTypoScript\setLegend(), JsonToTypoScript\setOptions(), JsonToTypoScript\setPostProcessor(), JsonToTypoScript\setPrefix(), JsonToTypoScript\setValidationRules(), and JsonToTypoScript\setVarious().
Referenced by JsonToTypoScript\getDefaultElementSetup().
|
protected |
Set the confirmation for the element FORM
The confirmation indicates a confirmation screen has to be displayed
bool | $confirmation | TRUE when confirmation screen |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 325 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Set the filters for the element
array | $filters | The JSON array for the filters of this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 338 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Set the label for the element
array | $label | The JSON array for the label of this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 359 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Changes the layout of some elements when this has been set in the wizard
The wizard only uses 'back' or 'front' to set the layout. The TypoScript of the form uses a XML notation for the position of the label to the field.
array | $element | The JSON array for this element |
string | $value | The layout setting, back or front |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 379 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Set the legend for the element
array | $legend | The JSON array for the legend of this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 427 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Set the options for a SELECT
Although other elements like CHECKBOXGROUP and RADIOGROUP are using the option setting as well, they act like containers and are handled differently
array | $element | The JSON array for this element |
array | $options | The JSON array for the options of this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 447 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Set the post processors for the element
array | $postProcessors | The JSON array for the post processors of this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 470 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Set the prefix for the element FORM
The prefix will be used in the names of all elements in the form
string | $prefix | The prefix for all element names |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 493 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Stores the validation rules, set to the elements, in a temporary array
In the wizard the validation rules are added to the element, in TypoScript they are added to the form.
array | $element | The JSON array for this element |
array | $validationRules | The temporary storage array for the rules |
Definition at line 508 of file JsonToTypoScript.php.
References JsonToTypoScript\$elementId, JsonToTypoScript\$validationRulesCounter, and elseif.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Set the various configuration of an element
array | $element | The JSON array for this element |
array | $various | The JSON array for the various options of this element |
array | $parent | The parent element |
int | $elementCounter | The element counter |
Definition at line 533 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setConfiguration().
|
protected |
Converts a TypoScript array to a formatted string
Takes care of indentation, curly brackets and parentheses
array | $typoscriptArray | The TypoScript array |
string | $addKey | Key which has underlying configuration |
int | $tabCount | The amount of tabs for indentation |
Definition at line 560 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\convert().
|
protected |
Definition at line 29 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setAttributes(), and JsonToTypoScript\setValidationRules().
|
protected |
Definition at line 37 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\getForm().
|
protected |
Definition at line 44 of file JsonToTypoScript.php.
Referenced by JsonToTypoScript\setValidationRules().