|
eZ Publish
[trunk]
|
Handles unit conversion and display using the operator "si". More...
Public Member Functions | |
| eZTemplateUnitOperator ($name="si") | |
| modify ($tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement) | |
| namedParameterList () | |
| operatorList () | |
| operatorTemplateHints () | |
| operatorTransform ($operatorName, &$node, $tpl, &$resourceData, $element, $lastElement, $elementList, $elementTree, &$parameters) | |
Handles unit conversion and display using the operator "si".
The operator reads two parameters. The first tells the kind of unit type we're dealing with, for instance: byte, length. The second determines the behaviour of prefixes and is optional.
The available units are defined in the settings/unit.ini file. The bases are read from the Base group.
The unit operator supports both traditional 10^n based prefixes as well as binary prefixes(2^n n=10,20..), both old names and new names. See International Systems of Units
// Example of template code {1025|si(byte)} {1025|si(byte,binary)} {1025|si(byte,decimal)} {1025|si(byte,none)} {1025|si(byte,auto)} {1025|si(byte,mebi)}
Definition at line 38 of file eztemplateunitoperator.php.
| eZTemplateUnitOperator::eZTemplateUnitOperator | ( | $ | name = "si" | ) |
Initializes the operator with the name $name, default is "si"
Definition at line 43 of file eztemplateunitoperator.php.
| eZTemplateUnitOperator::modify | ( | $ | tpl, |
| $ | operatorName, | ||
| $ | operatorParameters, | ||
| $ | rootNamespace, | ||
| $ | currentNamespace, | ||
| &$ | operatorValue, | ||
| $ | namedParameters, | ||
| $ | placement | ||
| ) |
Performs unit conversion.
Definition at line 362 of file eztemplateunitoperator.php.
See eZTemplateOperator::namedParameterList
Definition at line 340 of file eztemplateunitoperator.php.
Returns the operators in this class.
Definition at line 52 of file eztemplateunitoperator.php.
Definition at line 57 of file eztemplateunitoperator.php.
| eZTemplateUnitOperator::operatorTransform | ( | $ | operatorName, |
| &$ | node, | ||
| $ | tpl, | ||
| &$ | resourceData, | ||
| $ | element, | ||
| $ | lastElement, | ||
| $ | elementList, | ||
| $ | elementTree, | ||
| &$ | parameters | ||
| ) |
Definition at line 68 of file eztemplateunitoperator.php.