function _customfilter_globals in Custom filter 6.2
Same name and namespace in other branches
- 6 customfilter.module \_customfilter_globals()
- 7.2 customfilter.module \_customfilter_globals()
- 7 customfilter.module \_customfilter_globals()
Return an object that contains the global variables used during the execution of a rule.
2 calls to _customfilter_globals()
- customfilter_filter in ./
customfilter.module - Implements hook_filter().
- _customfilter_process in ./
customfilter.module
File
- ./
customfilter.module, line 330 - Allow users to define custom filters.
Code
function &_customfilter_globals($op = '') {
$globals =& Vars::staticValue(__FUNCTION__, array());
$index =& Vars::staticValue(__FUNCTION__ . '_index', 0);
if ($op == 'push') {
$globals[++$index] = new stdClass();
}
elseif ($op == 'pop' && $index) {
unset($globals[$index--]);
}
return $globals[$index];
}