Commit a1b2f3d1 authored by Andreas Hennings's avatar Andreas Hennings Committed by Frank Febbraro
Browse files

Issue #1079440 by mpotter, mrf, tobby, acrollet, donquixote: Fixed Module name...

Issue #1079440 by mpotter, mrf, tobby, acrollet, donquixote: Fixed Module name check prevents panels custom content panes export.
parent a098d969
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
  }
+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")) {
@@ -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().
@@ -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;
}