function ctools_features_declare_functions in Features 7
Same name and namespace in other branches
- 7.2 includes/features.ctools.inc \ctools_features_declare_functions()
1 call to ctools_features_declare_functions()
- features_include in ./
features.module - Load includes for any modules that implement the features API and load includes for those provided by features.
File
- includes/
features.ctools.inc, line 3
Code
function ctools_features_declare_functions($reset = FALSE) {
/**
* This is called by Features to ensure ctools component functions are defined
* Dynamically declare functions under a ctools component's namespace if they are not already declared.
*/
if (function_exists('_ctools_features_get_info')) {
foreach (_ctools_features_get_info(NULL, $reset) as $component => $info) {
$code = '';
if (!function_exists("{$info['module']}_features_api")) {
$code .= 'function ' . $info['module'] . '_features_api() { return ctools_component_features_api("' . $info['module'] . '"); }';
}
// ctools component with owner defined as "ctools"
if (!function_exists("{$component}_features_api") && $info['module'] === 'ctools') {
$code .= 'function ' . $component . '_features_api() { return ctools_component_features_api("' . $component . '"); }';
}
if (!function_exists("{$component}_features_export")) {
$code .= 'function ' . $component . '_features_export($data, &$export, $module_name = "") { return ctools_component_features_export("' . $component . '", $data, $export, $module_name); }';
}
if (!function_exists("{$component}_features_export_options")) {
$code .= 'function ' . $component . '_features_export_options() { return ctools_component_features_export_options("' . $component . '"); }';
}
if (!function_exists("{$component}_features_export_render")) {
$code .= 'function ' . $component . '_features_export_render($module, $data, $export = NULL) { return ctools_component_features_export_render("' . $component . '", $module, $data, $export); }';
}
if (!function_exists("{$component}_features_revert")) {
$code .= 'function ' . $component . '_features_revert($module) { return ctools_component_features_revert("' . $component . '", $module); }';
}
eval($code);
}
}
}