|
wCMF
3.6
|
Public Member Functions | |
| NodeUtil () | |
| getPath (&$node) | |
| getConnectionToAncestor (&$tplNode, $ancestorType, $nodes=null) | |
| getConnectionToDescendant (&$tplNode, $descendantType, $nodes=null) | |
| getNodeQuery ($nodeType) | |
| getSelfQuery ($nodeType, $oid) | |
| getParentQuery ($parentType, &$childNode) | |
| getChildQuery (&$parentNode, $childType) | |
| getPossibleParents (&$realNode, &$tplNode) | |
| getPossibleChildren (&$realNode, &$tplNode, $resolveManyToMany=true) | |
| getRealSubjectType (&$proxy, $parentType) | |
| getDisplayValueNames (&$node) | |
| getDisplayValue (&$node, $useDisplayType=false, $language=null, $values=null) | |
| getDisplayValues (&$node, $useDisplayType=false, $language=null, $values=null) | |
| getDisplayNameFromType ($type) | |
| getDescriptionFromType ($type) | |
| getInputControl (&$node, $name, $dataType=null, $templateNode=null, $addEmptyValue=false) | |
| getInputControlName (&$node, $name, $dataType=null) | |
| getValueDefFromInputControlName ($name) | |
| completeNode (&$node) | |
| setSortProperties (&$nodeList) | |
| makeNodeUrlsRelative (&$node, $baseUrl, $recursive=true) | |
| makeValueUrlsRelative (&$node, $valueName, $dataType, $baseUrl) | |
| renderValues (&$nodes, $language=null) | |
| renderValue (&$node, $valueName, $dataType, $formUtil) | |
| translateValues (&$nodes, $language=null) | |
| translateValue (&$node, $valueName, $dataType, $formUtil) | |
| removeNonDisplayValues (&$node) | |
Public Attributes | |
| $_formUtil = null | |
NodeUtil provides services for the Node class. All methods are static.
Definition at line 41 of file class.NodeUtil.php.
| NodeUtil::NodeUtil | ( | ) |
Constructor
Definition at line 48 of file class.NodeUtil.php.
Referenced by makeNodeUrlsRelative(), renderValues(), and translateValues().
| NodeUtil::getPath | ( | & | $node | ) |
Get the path to a given Node (from a root node).
| node | The Node to find the path for |
Definition at line 58 of file class.NodeUtil.php.
References BUILDDEPTH_SINGLE, PersistenceFacade\getInstance(), and PersistenceFacade\isValidOID().
Here is the call graph for this function:| NodeUtil::getConnectionToAncestor | ( | & | $tplNode, |
| $ancestorType, | |||
$nodes = null |
|||
| ) |
Get the node types that connect a type to a ancestor type.
| tplNode | The node to start from |
| ancestorType | The type to connect to |
| nodes | Internal use only |
Definition at line 86 of file class.NodeUtil.php.
References PersistenceFacade\getInstance(), and PersistenceFacade\getOIDParameter().
Referenced by StringQuery\buildQuery().
Here is the call graph for this function:| NodeUtil::getConnectionToDescendant | ( | & | $tplNode, |
| $descendantType, | |||
$nodes = null |
|||
| ) |
Get the node types that connect a type to a descendant type.
| tplNode | The node to start from |
| descendantType | The type to connect to |
| nodes | Internal use only |
Definition at line 128 of file class.NodeUtil.php.
References PersistenceFacade\getInstance(), and PersistenceFacade\getOIDParameter().
Referenced by StringQuery\buildQuery().
Here is the call graph for this function:| NodeUtil::getNodeQuery | ( | $nodeType | ) |
Get the query used to select all Nodes of a type.
| nodeType | The Node type |
Definition at line 167 of file class.NodeUtil.php.
References PersistenceFacade\createObjectQuery().
Referenced by AsyncPagingController\getObjects(), and SortController\sortAll().
Here is the call graph for this function:| NodeUtil::getSelfQuery | ( | $nodeType, | |
| $oid | |||
| ) |
Get the query used to select a special Node.
| nodeType | The Node type |
| oid | The object id of the node |
Definition at line 178 of file class.NodeUtil.php.
References PersistenceFacade\createObjectQuery(), PersistenceFacade\decomposeOID(), and PersistenceFacade\getInstance().
Here is the call graph for this function:| NodeUtil::getParentQuery | ( | $parentType, | |
| & | $childNode | ||
| ) |
Get the query used to select all parent Nodes of a given type.
| parentType | The parent type |
| childNode | The Node to select the parents for |
Definition at line 197 of file class.NodeUtil.php.
References PersistenceFacade\createObjectQuery(), and PersistenceFacade\getInstance().
Here is the call graph for this function:| NodeUtil::getChildQuery | ( | & | $parentNode, |
| $childType | |||
| ) |
Get the query used to select all child Nodes of a given type.
| parentNode | The Node to select the children for |
| childType | The child type |
Definition at line 217 of file class.NodeUtil.php.
References PersistenceFacade\createObjectQuery().
Here is the call graph for this function:| NodeUtil::getPossibleParents | ( | & | $realNode, |
| & | $tplNode | ||
| ) |
Get allowed parent types for a Node by comparing the existing parents of realNode with the possible parents of tplNode.
| realNode | A reference to the Node that defines the existing parents (property parentoids must be given) |
| tplNode | A reference to the Node that defines the possible parents (property parentoids must be given) |
Definition at line 242 of file class.NodeUtil.php.
References PersistenceFacade\getInstance(), and PersistenceFacade\getOIDParameter().
Referenced by DisplayController\executeKernel(), and AssociateController\isDirectAssociation().
Here is the call graph for this function:| NodeUtil::getPossibleChildren | ( | & | $realNode, |
| & | $tplNode, | ||
$resolveManyToMany = true |
|||
| ) |
Get allowed child types for a Node by comparing the existing children of realNode with the possible children of tplNode.
| realNode | A reference to the Node that defines the existing children (property childoids must be given) |
| tplNode | A reference to the Node that defines the possible children (children must be included already) |
| resolveManyToMany | True/False wether for all many to many children the real subject types should be returned [default: true] |
Definition at line 292 of file class.NodeUtil.php.
References PersistenceFacade\getInstance(), PersistenceFacade\getOIDParameter(), and getRealSubjectType().
Referenced by DisplayController\executeKernel(), and CopyController\validate().
Here is the call graph for this function:| NodeUtil::getRealSubjectType | ( | & | $proxy, |
| $parentType | |||
| ) |
Get the real subject type for a proxy node, that is a many to many instance. A many to many instance serves as proxy between a client and a real subject, where the client is the parent node in this case and the proxy is the child node.
| proxy | The (many to many) proxy node |
| parentType | The parent type |
Definition at line 349 of file class.NodeUtil.php.
Referenced by getPossibleChildren(), and AsyncPagingController\modifyModel().
| NodeUtil::getDisplayValueNames | ( | & | $node | ) |
Get the display value names of a Node.
| node | The Node instance |
Definition at line 380 of file class.NodeUtil.php.
Referenced by removeNonDisplayValues().
| NodeUtil::getDisplayValue | ( | & | $node, |
$useDisplayType = false, |
|||
$language = null, |
|||
$values = null |
|||
| ) |
Get the display value for a Node defined by the 'display_value' property that may reference values of subnodes. If the 'display_value' is an array ('|' separated strings) the pieces will be put together with ' - '. If search for 'display_value' gives no result the function returns an empty string. Example: 'name|Comment/text' shows the name of the Node together with the text of the first Comment child
| node | A reference to the Node to display |
| useDisplayType | True/False wether to use the display types that are associated with the values which the display value contains [default: false] |
| language | The lanugage if values should be localized. Optional, default is Localization::getDefaultLanguage() |
| values | An assoziative array holding key value pairs that the display node's values should match [maybe null]. |
Definition at line 409 of file class.NodeUtil.php.
References getDisplayValues().
Referenced by SimplePagingController\getDisplayText(), NodeListController\getDisplayText(), TreeViewController\getDisplayText(), Node\getDisplayValue(), SOAPController\soapAdvancedSearch(), and SOAPController\soapSearch().
Here is the call graph for this function:| NodeUtil::getDisplayValues | ( | & | $node, |
$useDisplayType = false, |
|||
$language = null, |
|||
$values = null |
|||
| ) |
Does the same as DefaultValueRenderer::getDisplayValue() but returns the display value as associative array
| node | A reference to the Node to display |
| useDisplayType | True/False wether to use the display types that are associated with the values which the display value contains [default: false] |
| language | The lanugage if values should be localized. Optional, default is Localization::getDefaultLanguage() |
| values | An assoziative array holding key value pairs that the display node's values should match [maybe null]. |
Definition at line 421 of file class.NodeUtil.php.
References $GLOBALS, BUILDDEPTH_SINGLE, ObjectFactory\getInstance(), PersistenceFacade\getInstance(), Localization\getInstance(), PersistenceFacade\isKnownType(), and WCMFException\throwEx().
Referenced by getDisplayValue(), and Node\getDisplayValues().
Here is the call graph for this function:| NodeUtil::getDisplayNameFromType | ( | $type | ) |
Get the display name for a Node type.
| type | The name of the type |
Definition at line 564 of file class.NodeUtil.php.
References BUILDDEPTH_SINGLE, and PersistenceFacade\getInstance().
Here is the call graph for this function:| NodeUtil::getDescriptionFromType | ( | $type | ) |
Get the description for a Node type.
| type | The name of the type |
Definition at line 575 of file class.NodeUtil.php.
References BUILDDEPTH_SINGLE, and PersistenceFacade\getInstance().
Here is the call graph for this function:| NodeUtil::getInputControl | ( | & | $node, |
| $name, | |||
$dataType = null, |
|||
$templateNode = null, |
|||
$addEmptyValue = false |
|||
| ) |
Get a HTML input control for a given node value. The control is defined by the 'input_type' property of the value. The property 'is_editable' is used to determine wether the control should be enabled or not.
| node | A reference to the Node which contains the value |
| name | The name of the value to construct the control for |
| dataType | The type of the value [optional] (if type is omitted the first value of any type that matches will be used) |
| templateNode | A Node which contains the value definition (if not given the definition will be taken from the node parameter) [optional] |
| 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) [optional] |
Definition at line 595 of file class.NodeUtil.php.
References BUILDDEPTH_SINGLE, getInputControlName(), and PersistenceFacade\getInstance().
Here is the call graph for this function:| NodeUtil::getInputControlName | ( | & | $node, |
| $name, | |||
$dataType = null |
|||
| ) |
Get a HTML input control name for a given node value (see FormUtil::getInputControl()).
| node | A reference to the Node which contains the value |
| name | The name of the value to construct the control for |
| dataType | The type of the value [optional] (if type is omitted the first value of any type that matches will be used) |
Definition at line 630 of file class.NodeUtil.php.
References FormUtil\getInputFieldDelimiter().
Referenced by getInputControl().
Here is the call graph for this function:| NodeUtil::getValueDefFromInputControlName | ( | $name | ) |
Get the node value definition from a HTML input control name.
| name | The name of input control in the format defined by getInputControlName |
Definition at line 641 of file class.NodeUtil.php.
References DATATYPE_ATTRIBUTE, and FormUtil\getInputFieldDelimiter().
Referenced by HTMLFormat\deserialize().
Here is the call graph for this function:| NodeUtil::completeNode | ( | & | $node | ) |
Add the missing attributes to a Node. The state remains the same.
| node | A reference to the Node to complete |
Definition at line 669 of file class.NodeUtil.php.
References BUILDDEPTH_SINGLE, DATATYPE_ATTRIBUTE, and PersistenceFacade\getInstance().
Here is the call graph for this function:| NodeUtil::setSortProperties | ( | & | $nodeList | ) |
Sort a list of Nodes and set the sort properties on Nodes of a given list. The two attributes (DATATPE_IGNORE) 'hasSortUp', 'hasSortDown' (values (false,true)) will be added to each Node depending on its list position. If applicable the attributes (DATATPE_IGNORE) 'prevoid' and 'nextoid' resp. will be added to denote the neighboured Nodes. The attributes will only be added if a Node has a sortkey value (DATATPE_IGNORE).
| nodeList | A reference to the list of Nodes |
Definition at line 693 of file class.NodeUtil.php.
References DATATYPE_IGNORE, and Node\sort().
Referenced by NodeListController\modifyModel(), and AsyncPagingController\modifyModel().
Here is the call graph for this function:| NodeUtil::makeNodeUrlsRelative | ( | & | $node, |
| $baseUrl, | |||
$recursive = true |
|||
| ) |
Make all urls matching a given base url in a Node relative.
| node | A reference to the Node the holds the value |
| baseUrl | The baseUrl to which matching urls will be made relative |
| recursive | True/False wether to recurse into child Nodes or not (default: true) |
Definition at line 726 of file class.NodeUtil.php.
References NodeUtil().
Here is the call graph for this function:| NodeUtil::makeValueUrlsRelative | ( | & | $node, |
| $valueName, | |||
| $dataType, | |||
| $baseUrl | |||
| ) |
Make the urls matching a given base url in a Node value relative.
| node | A reference to the Node the holds the value |
| valueName | The name of the value |
| dataType | The dataType of the value |
| baseUrl | The baseUrl to which matching urls will be made relative |
Definition at line 740 of file class.NodeUtil.php.
References StringUtil\getUrls().
Here is the call graph for this function:| NodeUtil::renderValues | ( | & | $nodes, |
$language = null |
|||
| ) |
Render all values in a list of Nodes using the DefaultValueRenderer.
| nodes | A reference to the array of Nodes |
| language | The language code, if the translated values should be localized. Optional, default is Localization::getDefaultLanguage() |
Definition at line 770 of file class.NodeUtil.php.
References NodeUtil().
Referenced by SearchController\modifyModel(), and AsyncPagingController\modifyModel().
Here is the call graph for this function:| NodeUtil::renderValue | ( | & | $node, |
| $valueName, | |||
| $dataType, | |||
| $formUtil | |||
| ) |
Callback to render a Node value
Definition at line 787 of file class.NodeUtil.php.
References DATATYPE_ATTRIBUTE.
| NodeUtil::translateValues | ( | & | $nodes, |
$language = null |
|||
| ) |
Translate all values in a list of Nodes using the DefaultValueRenderer.
| nodes | A reference to the array of Nodes |
| language | The language code, if the translated values should be localized. Optional, default is Localization::getDefaultLanguage() |
Definition at line 814 of file class.NodeUtil.php.
References NodeUtil().
Referenced by DisplayController\executeKernel(), and BatchDisplayController\loadNode().
Here is the call graph for this function:| NodeUtil::translateValue | ( | & | $node, |
| $valueName, | |||
| $dataType, | |||
| $formUtil | |||
| ) |
Callback to translate a Node value
Definition at line 831 of file class.NodeUtil.php.
References DATATYPE_ATTRIBUTE.
| NodeUtil::removeNonDisplayValues | ( | & | $node | ) |
Remove all values from a Node that are not a display value and don't have DATATYPE_IGNORE.
| node | The Node instance |
Definition at line 847 of file class.NodeUtil.php.
References getDisplayValueNames().
Referenced by SearchController\modifyModel(), and AsyncPagingController\modifyModel().
Here is the call graph for this function:| NodeUtil::$_formUtil = null |
Definition at line 43 of file class.NodeUtil.php.