You are here

function features_feature_is_locked in Features 7.2

Returns whether a feature or its component is locked.

Parameters

string $feature: A feature module name.

string|null $component: (optional) A component name, e.g. 'field_instance'.

bool $check_global_component_setting: (optional) If TRUE, the module component is also considered as locked if the component is marked as locked globally.

Return value

bool TRUE, if the feature or component is locked.

6 calls to features_feature_is_locked()
drush_features_revert in ./features.drush.inc
Drush command callback for 'features-revert'.
features_admin_lock in ./features.admin.inc
Page callback to lock or unlock a component.
features_feature_lock_confirm_form in ./features.admin.inc
Form builder for 'admin/structure/features/%feature/lock'.
features_feature_lock_confirm_form_submit in ./features.admin.inc
Submit callback to lock components of a feature.
theme_features_lock_link in theme/theme.inc
Themes a lock link.

... See full list

File

./features.module, line 1455
Main *.module file for the 'features' module.

Code

function features_feature_is_locked($feature, $component = NULL, $check_global_component_setting = TRUE) {
  $locked = variable_get('features_feature_locked', array());
  if ($component) {
    return $check_global_component_setting && features_component_is_locked($component) || !empty($locked[$feature][$component]);
  }
  else {
    return !empty($locked[$feature]['_all']);
  }
}