function themekey_features_load_rule_childs in ThemeKey 7.3
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 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. The difference compared to themekey_load_rules() is, that database stuff like ids, parent ids and weights are stripped for export.
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 157
Code
function themekey_features_load_rule_childs($module_name = '', $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)
->condition('enabled', 1)
->orderBy('weight', 'ASC')
->execute()) {
foreach ($result as $record) {
// we have to load the rule again using themekey_rule_get() which applies some transformations
// like themekey_complete_path()
$rule = themekey_rule_get($record->id);
if (!empty($module_name)) {
$rule->module = $module_name;
}
// remove the database specific stuff for export
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($module_name, $record->id),
);
}
}
return $rules;
}