Loading features.module +3 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,9 @@ function features_include($reset = FALSE) { } } // Finally, add ctools eval'd implementations. ctools_features_declare_functions(); // Clear static cache, since we've now included new implementers. module_implements('features_api', FALSE, TRUE); } Loading includes/features.ctools.inc +25 −19 Original line number Diff line number Diff line <?php function ctools_features_declare_functions() { /** * This is a wild hack, but effective. * 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() as $component => $info) { $code = ''; if (!function_exists("{$info['module']}_features_api")) { Loading @@ -16,13 +18,15 @@ foreach (_ctools_features_get_info() as $component => $info) { $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) { return ctools_component_features_export_render("'. $component .'", $module, $data); }'; $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); } } } /** * Implements hook_features_api(). Loading Loading @@ -104,8 +108,10 @@ function ctools_features_export_render($module, $data) { function ctools_component_features_api($module_name) { $api = array(); foreach (_ctools_features_get_info() as $component => $info) { if ($info['module'] == $module_name) { $api[$component] = $info; } } return $api; } Loading Loading
features.module +3 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,9 @@ function features_include($reset = FALSE) { } } // Finally, add ctools eval'd implementations. ctools_features_declare_functions(); // Clear static cache, since we've now included new implementers. module_implements('features_api', FALSE, TRUE); } Loading
includes/features.ctools.inc +25 −19 Original line number Diff line number Diff line <?php function ctools_features_declare_functions() { /** * This is a wild hack, but effective. * 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() as $component => $info) { $code = ''; if (!function_exists("{$info['module']}_features_api")) { Loading @@ -16,13 +18,15 @@ foreach (_ctools_features_get_info() as $component => $info) { $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) { return ctools_component_features_export_render("'. $component .'", $module, $data); }'; $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); } } } /** * Implements hook_features_api(). Loading Loading @@ -104,8 +108,10 @@ function ctools_features_export_render($module, $data) { function ctools_component_features_api($module_name) { $api = array(); foreach (_ctools_features_get_info() as $component => $info) { if ($info['module'] == $module_name) { $api[$component] = $info; } } return $api; } Loading