wCMF
3.6
|
Public Member Functions | |
FormUtil ($language=null) | |
getInputControl ($name, $inputType, $value, $editable=true, $addEmptyValue=false) | |
translateValue ($value, $inputType, $replaceBR=false, $nodeOid=null) | |
Static Public Member Functions | |
static | getInputFieldDelimiter () |
Public Attributes | |
$_language = null | |
$_controlRenderer = null | |
$_lists = array() | |
Private Member Functions | |
getListMap ($description, $value=null, $nodeOid=null, $addEmptyValue=false) | |
resolveByOid ($oid) | |
FormUtil provides basic support for HTML forms. It's mainly for creating input controls from definition strings.
wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH
Licensed under the terms of any of the following licenses at your choice:
See the license.txt file distributed with this work for additional information.
Definition at line 35 of file class.FormUtil.php.
FormUtil::FormUtil | ( | $language = null | ) |
Constructor
language | The lanugage if FormUtil should be localization aware. Optional, default is Localization::getDefaultLanguage() |
Definition at line 46 of file class.FormUtil.php.
References ObjectFactory\getInstance(), and WCMFException\throwEx().
|
static |
Get the delimiter for HTML input control names to be used if a control name consists of different parts.
Definition at line 65 of file class.FormUtil.php.
References InifileParser\getInstance().
Referenced by DefaultControlRenderer\configure_fileex(), SaveController\executeKernel(), NodeUtil\getInputControlName(), and NodeUtil\getValueDefFromInputControlName().
FormUtil::getInputControl | ( | $name, | |
$inputType, | |||
$value, | |||
$editable = true , |
|||
$addEmptyValue = false |
|||
) |
Get a HTML input control for a given description.
name | The name of the control (HTML name attribute) |
inputType | The description of the control as given in the input_type property of a value The description is of the form type
type[attributes]#list
|
value | The predefined value of the control (maybe comma separated list for list controls) |
editable | True/False if this is set false the function returns only the translated value (processed by translateValue()) [default: true] |
addEmptyValue | True/False if this is set true, an additional empty value is added to the input control (if not given no empty value will be added) [default: false] |
Definition at line 94 of file class.FormUtil.php.
References SessionData\getInstance(), getListMap(), and translateValue().
|
private |
Get a list of key/value pairs defined by description.
description | One of the following strings:
|
value | The selected value (maybe null, default: null) |
nodeOid | Oid of the node containing this value (for determining remote oids) [default: null] |
addEmptyValue | True/False if this is set true, an additional empty value is added to the input control (if not given no empty value will be added) [default: false] |
Definition at line 156 of file class.FormUtil.php.
References $GLOBALS, BUILDDEPTH_SINGLE, PersistenceFacade\composeOID(), PersistenceFacade\decomposeOID(), Message\get(), PersistenceFacade\getInstance(), InifileParser\getInstance(), Localization\getInstance(), PersistenceFacade\isValidOID(), resolveByOid(), and WCMFException\throwEx().
Referenced by getInputControl(), and translateValue().
|
private |
Resolves the DisplayValue of the given oid.
String | $oid | The oid of the requested object. |
Definition at line 328 of file class.FormUtil.php.
References BUILDDEPTH_SINGLE, PersistenceFacade\getInstance(), Localization\getInstance(), and PersistenceFacade\isValidOID().
Referenced by getListMap().
FormUtil::translateValue | ( | $value, | |
$inputType, | |||
$replaceBR = false , |
|||
$nodeOid = null |
|||
) |
Translate a value with use of it's assoziated input type e.g get the location string from a location id. (this is only done when the input type has a list definition).
value | The value to translate (maybe comma separated list for list controls) |
inputType | The description of the control as given in the input_type property of a value (see CMS getInputControl()) |
replaceBR | True/False wether to replace html line breaks with spaces or not [default:false] |
nodeOid | Oid of the node containing this value (for determining remote oids) [default: null] |
Definition at line 361 of file class.FormUtil.php.
References getListMap(), and StringUtil\removeTrailingComma().
Referenced by getInputControl().
FormUtil::$_language = null |
Definition at line 37 of file class.FormUtil.php.
FormUtil::$_controlRenderer = null |
Definition at line 38 of file class.FormUtil.php.
FormUtil::$_lists = array() |
Definition at line 39 of file class.FormUtil.php.