pi1/class.tx_ameosformidable_pi1.php

'Ameos Formidable'

 

Files: 1
Total filesizes: 33 Kbytes
Functions and classes: 41

pi1/class.tx_ameosformidable_pi1.php

'Ameos Formidable'

class tx_ameosformidable_pi1

FORMidable initialization

function init(&$oParent, $xmlPath)

function _initDataHandler()

function _initRenderer()

function _initRenderlets()

function _loadXmlConf()

function _loadDeclaredDataHandlers()

function _loadDeclaredRenderlets()

function _loadDeclaredRenderers()

function _loadDeclaredValidators()

function _loadDeclaredActionlets()

function _checkConf()

function _navConf($path, $aConf = -1)

Rendering functions

function _render()

function _renderElementsByPath($path)

function _renderElement($elementname)

Renderlet, Renderer, DataHandler and Validator instanciation functions

function _getDataHandlerForType($type)

function _getRendererForType($type)

function _getRenderletForType($type)

function _getValidatorForType($type)

function _getActionletForType($type)

function _makeDataHandler($extkey)

function _makeRenderer($extkey)

function _makeRenderlet($aElement)

function _makeValidator($extkey)

function _makeActionlet($aElement)

function _validateElementsByPath($path)

function _validateElement($aElement)

function _declareValidationError($elementname, $key, $message)

Renderlet, Renderer, DataHandler and Validator declaration functions

function declareRenderlet($extkey, $type)

function declareRenderer($extkey, $type)

function declareDataHandler($extkey, $type)

function declareValidator($extkey, $type)

function declareActionlet($extkey, $type)

function _executeActionlets($aRendered, $sForm)

function _executeActionlet($aActionlet, $aRendered, $sForm)

Debugging functions

function debug()

function _debug($variable, $name='*variable*', $line='*line*', $file='*file*', $recursiveDepth=6, $debugLevel=E_DEBUG)

function mayday($msg)

Utilitary functions

function _getLLLabel($label)

function _parseTemplate($templatePath, $templateMarker, $aTags = array())

Detailed descriptions:

pi1/class.tx_ameosformidable_pi1.php

'Ameos Formidable'

Filesize: 33 K
Func/Classes: 41
Tags: @author Jérôme Schneider <typo3dev@ameos.com>

class tx_ameosformidable_pi1

Returns:
Total Usage: 0  

function init(&$oParent, $xmlPath)

Standard init function
Initializes :
- api_macmade
- the reference to the parent Extension ( stored in $this->_oParent )
- the XML conf
- the internal collection of Validators
- the internal collection of DataHandlers
- the internal collection of Renderers
- the internal collection of Renderlets
- the Renderer as configured in the XML conf in the /formidable/control/renderer/ section
- the DataHandler as configured in the XML conf in the /formidable/control/datahandler/ section

&$oParent object Parent extension using FORMidable
$xmlPath string Absolute path to the XML configuration file
Returns: void
Total Usage: 11  
  2 mod1/index.php
  9 pi1/class.tx_ameosformidable_pi1.php

function _initDataHandler()

Initializes the DataHandler used for this FORM

Returns: void
  @see tx_ameosformidable_pi1::init()
Total Usage: 3  
  3 pi1/class.tx_ameosformidable_pi1.php

function _initRenderer()

Initializes the Renderer used for this FORM

Returns: void
  @see tx_ameosformidable_pi1::init()
Total Usage: 3  
  3 pi1/class.tx_ameosformidable_pi1.php

function _initRenderlets()

Initializes the Renderlets used for this FORM

Returns: void
  @see tx_ameosformidable_pi1::init()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _loadXmlConf()

Loads the internal _aConf configuration array from the XML file
IMPORTANT NOTE : the root /formidable is deleted, so all path shouldn't start with /formidable

Returns: boolean true if conf is valid, according to tx_ameosformidable_pi1::_checkConf()
  @see tx_ameosformidable_pi1::init()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _loadDeclaredDataHandlers()

Loads the internal collection _aDataHandlers of declared DataHandlers
DataHandlers are declared in DH extension's ext_localconf.php file
using tx_ameosformidable_pi1::declareDataHandler($_EXTKEY, $TYPE)
where $TYPE is the service name of this DataHandler

Returns: void
  @see tx_ameosformidable_pi1::init(), tx_ameosformidable_pi1::declareDataHandler()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _loadDeclaredRenderlets()

Loads the internal collection _aRenderlets of declared Renderlets
Renderlets are declared in RDT extension's ext_localconf.php file
using tx_ameosformidable_pi1::declareRenderlet($_EXTKEY, $TYPE)
where $TYPE is the service name of this Renderlet

Returns: void
  @see tx_ameosformidable_pi1::init(), tx_ameosformidable_pi1::declareRenderlet()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _loadDeclaredRenderers()

Loads the internal collection _aRenderers of declared Renderers
Renderers are declared in RDR extension's ext_localconf.php file
using tx_ameosformidable_pi1::declareRenderer($_EXTKEY, $TYPE)
where $TYPE is the service name of this Renderer

Returns: void
  @see tx_ameosformidable_pi1::init(), tx_ameosformidable_pi1::declareRenderer()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _loadDeclaredValidators()

Loads the internal collection _aValidators of declared Validators
Validators are declared in VA extension's ext_localconf.php file
using tx_ameosformidable_pi1::declareValidator($_EXTKEY, $TYPE)
where $TYPE is the service name of this Validator

Returns: void
  @see tx_ameosformidable_pi1::init(), tx_ameosformidable_pi1::declareValidator()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _loadDeclaredActionlets()

Loads the internal collection _aActionlets of declared Actionlets
Actionlets are declared in ACTs extension's ext_localconf.php file
using tx_ameosformidable_pi1::declareActionlet($_EXTKEY, $TYPE)
where $TYPE is the service name of this Actionlet

Returns: void
  @see tx_ameosformidable_pi1::init(), tx_ameosformidable_pi1::declareActionlet()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _checkConf()

Checks if the conf given in the XML file is complete and valid

Returns: boolean TRUE if valid, FALSE if not
  @see tx_ameosformidable_pi1::_loadXmlConf()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _navConf($path, $aConf = -1)

Navigates in the XML configuration of FORMidable
Returns the XML section corresponding to the given Xpath

$path string $path: the path of the XML section to return
$aConf = -1 array $aConf: if set, the array to navigate
Returns: mixed mixed if path is valid and XML section found, FALSE if not
Total Usage: 83  
  11 mod1/install/ext/ameos_formidable_act_mail/pi1/class.tx_ameosformidableactmail_pi1.php
  9 mod1/install/ext/ameos_formidable_dh_db/pi1/class.tx_ameosformidabledhdb_pi1.php
  1 mod1/install/ext/ameos_formidable_dh_raw/pi1/class.tx_ameosformidabledhraw_pi1.php
  1 mod1/install/ext/ameos_formidable_rdr_std/pi1/class.tx_ameosformidablerdrstd_pi1.php
  5 mod1/install/ext/ameos_formidable_rdr_template/pi1/class.tx_ameosformidablerdrtemplate_pi1.php
  6 mod1/install/ext/ameos_formidable_rdt_date/pi1/class.tx_ameosformidablerdtdate_pi1.php
  2 mod1/install/ext/ameos_formidable_rdt_file/pi1/class.tx_ameosformidablerdtfile_pi1.php
  1 mod1/install/ext/ameos_formidable_rdt_pwd/pi1/class.tx_ameosformidablerdtpwd_pi1.php
  5 mod1/install/ext/ameos_formidable_va_db/pi1/class.tx_ameosformidablevadb_pi1.php
  1 pi1/class.maindatahandler.php
  1 pi1/class.mainrenderer.php
  12 pi1/class.mainrenderlet.php
  12 pi1/class.mainvalidator.php
  16 pi1/class.tx_ameosformidable_pi1.php

function _render()

Executes the whole rendering process
Validators : Executes the validation process and render the errors
DataHandler : Executes the data process as defined in the DataHandler ; renders nothing
Renderlets : Exexutes the rendering of each Form Field element as defined in section /formidable/elements/ of the XML conf
Renderer : Renders the full layout of the FORM, inserting HTML produced by Validators and Renderlets

Returns: string compiled full HTML FORM
Total Usage: 7  
  7 pi1/class.tx_ameosformidable_pi1.php

function _renderElementsByPath($path)

Render all the Renderlets defined in the corresponding XML conf section

$path string $path: Xpath as used in tx_ameosformidable_pi1::_navConf()
Returns: array Array of rendered elements, structured as $elementname => $renderedHTML
  @see tx_ameosformidable_pi1::_renderElements()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _renderElement($elementname)

Renders the given Renderlet

$elementname array $aElement: details about the Renderlet to render, extracted from XML conf / used in formidable_mainrenderlet::_render()
Returns: string The Rendered HTML
  @see tx_ameosformidable_pi1::_renderElementsByPath()
Total Usage: 3  
  3 pi1/class.tx_ameosformidable_pi1.php

function _getDataHandlerForType($type)

Returns informations about the DataHandler for the given TYPE

$type string $type: TYPE (SERVICE NAME) for the DataHandler as declared using tx_ameosformidable_pi1::declareDataHandler()
Returns: array informations about the DataHandler for the given TYPE
  @see tx_ameosformidable_pi1::_initDataHandler(), tx_ameosformidable_pi1::declareDataHandler()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _getRendererForType($type)

Returns informations about the Renderer for the given TYPE

$type string $type: TYPE (SERVICE NAME) for the Renderer as declared using tx_ameosformidable_pi1::declareRenderer()
Returns: array informations about the Renderer for the given TYPE
  @see tx_ameosformidable_pi1::_initRenderer(), tx_ameosformidable_pi1::declareRenderer()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _getRenderletForType($type)

Returns informations about the Renderlet for the given TYPE

$type string $type: TYPE (SERVICE NAME) for the Renderlet as declared using tx_ameosformidable_pi1::declareRenderlet()
Returns: array informations about the Renderer for the given TYPE
  @see tx_ameosformidable_pi1::_renderElement(), tx_ameosformidable_pi1::declareRenderlet()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _getValidatorForType($type)

Returns informations about the Validator for the given TYPE

$type string $type: TYPE (SERVICE NAME) for the Validator as declared using tx_ameosformidable_pi1::declareValidator()
Returns: array informations about the Validator for the given TYPE
  @see tx_ameosformidable_pi1::_validateElement(), tx_ameosformidable_pi1::declareValidator()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _getActionletForType($type)

Returns informations about the Actionlet for the given TYPE

$type string $type: TYPE (SERVICE NAME) for the Actionlet as declared using tx_ameosformidable_pi1::declareActionlet()
Returns: array informations about the Validator for the given TYPE
  @see tx_ameosformidable_pi1::_validateElement(), tx_ameosformidable_pi1::declareActionlet()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _makeDataHandler($extkey)

Instanciates and initializes a DataHandler Object for the given $extkey,
as returned in the array returned by tx_ameosformidable_pi1::_getDataHandlerForType()

$extkey string $extkey: the extKey of the Renderer to instanciate
Returns: object
  @see tx_ameosformidable_pi1::_initDataHandler()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _makeRenderer($extkey)

Instanciates and initializes a Renderer Object for the given $extkey,
as returned in the array returned by tx_ameosformidable_pi1::_getRendererForType()

$extkey string $extkey: the extKey of the Renderer to instanciate
Returns: object
  @see tx_ameosformidable_pi1::_initRenderer()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _makeRenderlet($aElement)

Instanciates and initializes a Renderlet Object for the given $extkey,
as returned in the array returned by tx_ameosformidable_pi1::_getRenderletForType()

$aElement string $extkey: the extKey of the Renderlet to instanciate
Returns: object
  @see tx_ameosformidable_pi1::_renderElement()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _makeValidator($extkey)

Instanciates and initializes a Validator Object for the given $extkey,
as returned in the array returned by tx_ameosformidable_pi1::_getValidatorForType()

$extkey string $extkey: the extKey of the Validator to instanciate
Returns: object
  @see tx_ameosformidable_pi1::_validateElement()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _makeActionlet($aElement)

Instanciates and initializes an Actionlet Object for the given $extkey,
as returned in the array returned by tx_ameosformidable_pi1::_getActionletForType()

$aElement string $extkey: the extKey of the Actionlet to instanciate
Returns: object
  @see tx_ameosformidable_pi1::_executeActionlet()
Total Usage: 1  
  1 pi1/class.tx_ameosformidable_pi1.php

function _validateElementsByPath($path)

Validates data returned by all the Renderlets elements defined in the corresponding XML conf section

$path string $path: Xpath as used in tx_ameosformidable_pi1::_navConf()
Returns: void Writes into $this->_aValidationErrors[] using tx_ameosformidable_pi1::_declareValidationError()
  @see tx_ameosformidable_pi1::_validateElements()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _validateElement($aElement)

Validates the given Renderlet element

$aElement array $aElement: details about the Renderlet element to validate, extracted from XML conf / used in formidable_mainvalidator::_doTheMagic()
Returns: void Writes into $this->_aValidationErrors[] using tx_ameosformidable_pi1::_declareValidationError()
  @see tx_ameosformidable_pi1::_validateElementsByPath()
Total Usage: 4  
  4 pi1/class.tx_ameosformidable_pi1.php

function _declareValidationError($elementname, $key, $message)

Declares validation error
Used by Validators Objects

$elementname string $elementname: not used for the moment
$key string $key: not used for the moment
$message string $message: the error message to display
Returns: void Writes into $this->_aValidationErrors[]
Total Usage: 8  
  1 mod1/install/ext/ameos_formidable_va_db/pi1/class.tx_ameosformidablevadb_pi1.php
  4 pi1/class.mainvalidator.php
  3 pi1/class.tx_ameosformidable_pi1.php

function declareRenderlet($extkey, $type)

Declares a Renderlet, associating it's extKey to a unique TYPE ( Renderlet SERVICE NAME )

$extkey string $extkey: the Renderlet's extension key
$type string $type: the TYPE ( SERVICE NAME )
Returns: void
Total Usage: 13  
  1 mod1/install/ext/ameos_formidable_rdt_checkbox/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdt_date/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdt_file/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdt_hidden/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdt_listbox/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdt_pwd/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdt_radio/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdt_submit/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdt_text/ext_localconf.php
  4 pi1/class.tx_ameosformidable_pi1.php

function declareRenderer($extkey, $type)

Declares a Renderer, associating it's extKey to a unique TYPE ( Renderer SERVICE NAME )

$extkey string $extkey: the Renderer's extension key
$type string $type: the TYPE ( SERVICE NAME )
Returns: void
Total Usage: 6  
  1 mod1/install/ext/ameos_formidable_rdr_std/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_rdr_template/ext_localconf.php
  4 pi1/class.tx_ameosformidable_pi1.php

function declareDataHandler($extkey, $type)

Declares a DataHandler, associating it's extKey to a unique TYPE ( DataHandler SERVICE NAME )

$extkey string $extkey: the DataHandler's extension key
$type string $type: the TYPE ( SERVICE NAME )
Returns: void
Total Usage: 7  
  1 mod1/install/ext/ameos_formidable_dh_db/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_dh_raw/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_dh_std/ext_localconf.php
  4 pi1/class.tx_ameosformidable_pi1.php

function declareValidator($extkey, $type)

Declares a Validator, associating it's extKey to a unique TYPE ( Validator SERVICE NAME )

$extkey string $extkey: the Validator's extension key
$type string $type: the TYPE ( SERVICE NAME )
Returns: void
Total Usage: 6  
  1 mod1/install/ext/ameos_formidable_va_std/ext_localconf.php
  1 mod1/install/ext/ameos_formidable_va_db/ext_localconf.php
  4 pi1/class.tx_ameosformidable_pi1.php

function declareActionlet($extkey, $type)

Declares an Actionlet, associating it's extKey to a unique TYPE ( Actionlet SERVICE NAME )

$extkey string $extkey: the Actionlet's extension key
$type string $type: the TYPE ( SERVICE NAME )
Returns: void
Total Usage: 5  
  1 mod1/install/ext/ameos_formidable_act_mail/ext_localconf.php
  4 pi1/class.tx_ameosformidable_pi1.php

function _executeActionlets($aRendered, $sForm)

Execute each actionlet declared for this FORM

$aRendered array $aRendered: array containing the HTML of the rendered renderlets
$sForm string $sForm: the whole FORM html string
Returns: void
  @see tx_ameosformidable_pi1::_render()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _executeActionlet($aActionlet, $aRendered, $sForm)

Executes the specific process for this actionlet

$aActionlet array $aActionlet: details about the Renderlet element to validate, extracted from XML conf / used in formidable_mainvalidator::_doTheMagic()
$aRendered array $aRendered: array containing the HTML of the rendered renderlets
$sForm string $sForm: the whole FORM html string
Returns: void
  @see tx_ameosformidable_pi1::_executeActionlets()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function debug()

Displays a full debug of :
- the XML conf
- the collection of declared DataHandlers
- the collection of declared Renderers
- the collection of declared Renderlets
- the collection of declared Validators

Can be called by the parent Extension, or by FORMidable itselves, if the XML conf sets /formidable/control/debug/ to TRUE

Returns: void
  @see tx_ameosformidable_pi1::mayday(), tx_ameosformidable_pi1::_render()
Total Usage: 2  
  2 pi1/class.tx_ameosformidable_pi1.php

function _debug($variable, $name='*variable*', $line='*line*', $file='*file*', $recursiveDepth=6, $debugLevel=E_DEBUG)

Internal debug function
Calls the TYPO3 debug function if the XML conf sets /formidable/control/debug/ to TRUE

$variable mixed $variable: the variable to dump
$name='*variable*' string $name: title of this debug section
$line='*line*' string $line: PHP code line calling this function ( __LINE__ )
$file='*file*' string $file: PHP script calling this function ( __FILE__ )
$recursiveDepth=6 integer $recursiveDepth: number of levels to debug, if recursive variable
$debugLevel=E_DEBUG string $debugLevel: the sensibility of this warning
Returns: void
Total Usage: 17  
  1 mod1/install/ext/ameos_formidable_act_mail/pi1/class.tx_ameosformidableactmail_pi1.php
  2 mod1/install/ext/ameos_formidable_dh_db/pi1/class.tx_ameosformidabledhdb_pi1.php
  1 mod1/install/ext/ameos_formidable_dh_raw/pi1/class.tx_ameosformidabledhraw_pi1.php
  1 mod1/install/ext/ameos_formidable_dh_std/pi1/class.tx_ameosformidabledhstd_pi1.php
  1 mod1/install/ext/ameos_formidable_rdr_std/pi1/class.tx_ameosformidablerdrstd_pi1.php
  1 mod1/install/ext/ameos_formidable_rdr_template/pi1/class.tx_ameosformidablerdrtemplate_pi1.php
  2 mod1/install/ext/ameos_formidable_rdt_date/pi1/class.tx_ameosformidablerdtdate_pi1.php
  1 mod1/install/ext/ameos_formidable_va_db/pi1/class.tx_ameosformidablevadb_pi1.php
  1 pi1/class.mainrenderlet.php
  4 pi1/class.mainvalidator.php
  2 pi1/class.tx_ameosformidable_pi1.php

function mayday($msg)

Stops Formidable and PHP execution : die() if some critical error appeared

$msg string $msg: the error message
Returns: void
Total Usage: 16  
  2 mod1/install/ext/ameos_formidable_dh_db/pi1/class.tx_ameosformidabledhdb_pi1.php
  2 mod1/install/ext/ameos_formidable_dh_raw/pi1/class.tx_ameosformidabledhraw_pi1.php
  1 pi1/class.mainrenderlet.php
  11 pi1/class.tx_ameosformidable_pi1.php

function _getLLLabel($label)

Returns the translated string for the given LLL path

$label string $label: LLL path
Returns: string The translated string
Total Usage: 24  
  1 mod1/install/ext/ameos_formidable_act_mail/pi1/class.tx_ameosformidableactmail_pi1.php
  3 mod1/install/ext/ameos_formidable_rdt_checkbox/pi1/class.tx_ameosformidablerdtcheckbox_pi1.php
  2 mod1/install/ext/ameos_formidable_rdt_date/pi1/class.tx_ameosformidablerdtdate_pi1.php
  1 mod1/install/ext/ameos_formidable_rdt_file/pi1/class.tx_ameosformidablerdtfile_pi1.php
  3 mod1/install/ext/ameos_formidable_rdt_listbox/pi1/class.tx_ameosformidablerdtlistbox_pi1.php
  2 mod1/install/ext/ameos_formidable_rdt_pwd/pi1/class.tx_ameosformidablerdtpwd_pi1.php
  3 mod1/install/ext/ameos_formidable_rdt_radio/pi1/class.tx_ameosformidablerdtradio_pi1.php
  1 mod1/install/ext/ameos_formidable_rdt_submit/pi1/class.tx_ameosformidablerdtsubmit_pi1.php
  2 mod1/install/ext/ameos_formidable_rdt_text/pi1/class.tx_ameosformidablerdttext_pi1.php
  1 mod1/install/ext/ameos_formidable_va_db/pi1/class.tx_ameosformidablevadb_pi1.php
  1 pi1/class.mainrenderlet.php
  4 pi1/class.mainvalidator.php

function _parseTemplate($templatePath, $templateMarker, $aTags = array())

Parses a template

$templatePath string $templatePath: the path to the template file
$templateMarker string $templateMarker: the marker subpart
$aTags = array() array $aTags: array containing the values to render
Returns: string HTML string with substituted values
Total Usage: 2  
  1 mod1/install/ext/ameos_formidable_act_mail/pi1/class.tx_ameosformidableactmail_pi1.php
  1 mod1/install/ext/ameos_formidable_rdr_template/pi1/class.tx_ameosformidablerdrtemplate_pi1.php