You are here

function ccl_features_export in Custom Contextual Links 7

Same name and namespace in other branches
  1. 8 ccl.features.inc \ccl_features_export()

Implements hook_features_export().

File

./ccl.features.inc, line 22
Integrates Features for Custom Contextual Links.

Code

function ccl_features_export($data, &$export, $module_name = '') {
  $export['dependencies']['features'] = 'features';
  $export['dependencies']['ccl'] = 'ccl';
  foreach (ccl_get_presets() as $preset) {
    $key = $preset->title . '||ID' . $preset->clid;
    if (in_array($key, $data)) {

      // Make the submodule required.
      // A 's' needs to be added to the type for the plural module names.
      if ($preset->type != 'node') {
        $export['dependencies']['ccl_' . $preset->type . 's'] = 'ccl_' . $preset->type . 's';
      }
      $export['features']['ccl'][$key] = $key;
    }
  }
  return $export;
}