function themekey_features_load_rule_childs in ThemeKey 7
Same name and namespace in other branches
- 6.4 themekey_features.module \themekey_features_load_rule_childs()
- 6.3 themekey_features.module \themekey_features_load_rule_childs()
- 7.3 themekey_features.module \themekey_features_load_rule_childs()
- 7.2 themekey_features.module \themekey_features_load_rule_childs()
Loads current ThemeKey Rule Chain as array.
Parameters
$parent: internal use in recursion
Return value
serialized ThemeKey Rule Chain as array
2 calls to themekey_features_load_rule_childs()
File
- ./
themekey_features.module, line 114
Code
function themekey_features_load_rule_childs($parent = 0) {
module_load_include('inc', 'themekey', 'themekey_base');
module_load_include('inc', 'themekey', 'themekey_build');
$rules = array();
if ($result = db_select('themekey_properties', 'tp')
->fields('tp', array(
'id',
))
->condition('parent', $parent)
->orderBy('weight', 'ASC')
->execute()) {
foreach ($result as $record) {
// we have to load the rule again using themekey_rule_get() which applies some transformations
$rule = themekey_rule_get($record->id);
if ('drupal:path' != $rule->property) {
themekey_complete_path($rule);
}
unset($rule->id);
unset($rule->parent);
unset($rule->weight);
$rules[] = array(
'rule' => $rule,
'string' => themekey_format_rule_as_string($record->id),
'childs' => themekey_features_load_rule_childs($record->id),
);
}
}
return $rules;
}