function units_get_operator_by_sign in Units of Measurement 7.2
Retrieve information about a cTools plugin - units operator.
The search is conducted by sign symbol of all operators.
Parameters
string $operator: Sign of a particular units operator plugin to return. If skipped, an array of all available units operators will be returned
Return value
array Depending on whether $operator is provided it will be either a single array of information about provided $operator units operator plugin or array of information aon all available units operator plugins, keyed by their signs
3 calls to units_get_operator_by_sign()
- units_mathematical_expression_create_from_infix in ./
units.module - Create mathematical expression object from infix notation.
- units_mathematical_expression_create_from_postfix in ./
units.module - Create mathematical expression object from postfix (reverse polish) notation.
- units_mathematical_expression_recreate_stored_functions in ./
units.module - Initialize DB stored functions necessary for the module.
File
- ./
units.module, line 447 - Provide API for managing and converting units of measurement.
Code
function units_get_operator_by_sign($operator = NULL) {
ctools_include('plugins');
$return = array();
foreach (ctools_get_plugins('units', 'operator') as $plugin) {
$return[$plugin['sign']] = $plugin;
}
return isset($operator) ? $return[$operator] : $return;
}