You are here

function themekey_features_graceful_rule_deletion in ThemeKey 7.2

Same name and namespace in other branches
  1. 7.3 themekey_features.module \themekey_features_graceful_rule_deletion()

Deletes all rules related to this feature, except that the administrator added childs

1 call to themekey_features_graceful_rule_deletion()
themekey_features_rule_chain_features_revert in ./themekey_features.module
Implements hook_features_revert().

File

./themekey_features.module, line 123

Code

function themekey_features_graceful_rule_deletion($module) {
  module_load_include('inc', 'themekey', 'themekey_build');
  $rules = themekey_load_rules();
  $delete = TRUE;
  while ($delete) {
    $delete = FALSE;
    foreach ($rules as $id => $rule) {
      if ($rule['module'] == $module) {
        try {
          themekey_rule_del($id);
          $delete = TRUE;
        } catch (ThemeKeyRuleDeletionException $e) {
          continue;
        }
      }
    }
  }
}