function themekey_features_rule_chain_features_export_render in ThemeKey 7.3
Same name and namespace in other branches
- 6.4 themekey_features.module \themekey_features_rule_chain_features_export_render()
- 6.3 themekey_features.module \themekey_features_rule_chain_features_export_render()
- 7 themekey_features.module \themekey_features_rule_chain_features_export_render()
- 7.2 themekey_features.module \themekey_features_rule_chain_features_export_render()
Implements hook_features_export_render().
File
- ./
themekey_features.module, line 55
Code
function themekey_features_rule_chain_features_export_render($module_name, $data, $export = NULL) {
$rules = themekey_features_load_rule_childs($module_name);
$keep_rules = array();
foreach ($rules as $rule) {
if (in_array(themekey_features_get_rule_cascade_string($rule), $data)) {
$keep_rules[] = $rule;
}
}
$code = array();
$code[] = "if (!defined('THEMEKEY_PAGECACHE_UNSUPPORTED')) {\n define('THEMEKEY_PAGECACHE_UNSUPPORTED', 0);\n define('THEMEKEY_PAGECACHE_SUPPORTED', 1);\n define('THEMEKEY_PAGECACHE_TIMEBASED', 2);\n }";
$code[] = '$rules = ' . features_var_export($keep_rules) . ';';
$code[] = '';
$code[] = 'return $rules;';
return array(
'themekey_features_rule_chain' => implode("\n", $code),
);
}