You are here

function token_custom_features_rebuild in Custom Tokens 7.2

Implements hook_features_rebuild().

1 call to token_custom_features_rebuild()
token_custom_features_revert in ./token_custom.features.inc
Implements hook_features_revert().

File

./token_custom.features.inc, line 66
Features integration for the Custom tokens module.

Code

function token_custom_features_rebuild($module) {
  $items = module_invoke($module, 'token_custom_features_default_settings');
  foreach ($items as $value) {
    try {
      $result = token_custom_features_config_get_machinename($value);
      $new = $result ? FALSE : TRUE;
      drupal_write_record('token_custom', $value, $new ? array() : 'machine_name');
    } catch (Exception $e) {
      watchdog("Error in updating", $e
        ->getMessage(), array(), WATCHDOG_ERROR);
    }
  }
}