You are here

function hosting_feature in Hosting 7.4

Same name and namespace in other branches
  1. 5 hosting.features.inc \hosting_feature()
  2. 6.2 hosting.features.inc \hosting_feature()
  3. 7.3 hosting.features.inc \hosting_feature()

Determine whether a specific feature of the hosting system is turned on.

Parameters

string $feature: The feature to check the status of, e.g. "client" or "platform".

Return value

bool TRUE if the feature is enabled, FALSE if it is disabled.

18 calls to hosting_feature()
hosting_client_form_site_node_form_alter in client/hosting_client.module
Implements hook_form_FORM_ID_alter().
hosting_client_node_access in client/hosting_client.module
Implements hook_node_access().
hosting_client_user_view in client/hosting_client.access.inc
Implements hook_user_view().
hosting_client_user_XXX in client/hosting_client.access.inc
Implements hook_user_XXX().
hosting_features_form in ./hosting.features.inc
The Hosting features form.

... See full list

File

./hosting.features.inc, line 32
Include for functionality related to Hosting module features.

Code

function hosting_feature($feature) {
  static $features = array();
  if (!count($features)) {
    $features = hosting_get_features();
  }
  if (isset($features[$feature]['status']) && $features[$feature]['status'] == HOSTING_FEATURE_REQUIRED) {
    $return = module_exists($features[$feature]['module']) ? HOSTING_FEATURE_REQUIRED : HOSTING_FEATURE_DISABLED;
  }
  elseif (isset($features[$feature]['module'])) {
    $return = module_exists($features[$feature]['module']) ? HOSTING_FEATURE_ENABLED : HOSTING_FEATURE_DISABLED;
  }
  else {
    $return = variable_get('hosting_feature_' . $feature, !empty($features[$feature]['status']));
  }
  return $return;
}