You are here

function ccl_features_rebuild in Custom Contextual Links 7

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

Implements hook_features_rebuild().

Rebuilds Custom Contextual Links from code defaults.

1 call to ccl_features_rebuild()
ccl_features_revert in ./ccl.features.inc
Implements hook_features_revert().

File

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

Code

function ccl_features_rebuild($module) {
  $presets = module_invoke($module, 'ccl_features_preset');
  foreach ($presets as $key => $preset) {
    $preset = (object) $preset;
    $current_record = current(ccl_get_presets($key));
    if (!empty($current_record)) {
      $preset->clid = $current_record->clid;
      drupal_write_record('ccl', $preset, 'clid');
    }
    else {
      drupal_write_record('ccl', $preset);
    }
  }
}