You are here

function hosting_feature in Hosting 6.2

Same name and namespace in other branches
  1. 5 hosting.features.inc \hosting_feature()
  2. 7.4 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

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

Return value

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

14 calls to hosting_feature()
hosting_client_access in client/hosting_client.module
Implementation of hook_access().
hosting_client_user in client/hosting_client.access.inc
Implements hook_user().
hosting_features_form in ./hosting.features.inc
The Hosting features form.
hosting_get_site_by_url in site/hosting_site.module
Retrieve a node based on the url
hosting_menu_access in ./hosting.module
Menu access callback for creating a node provided by a Hosting feature.

... See full list

File

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

Code

function hosting_feature($feature) {
  static $features = array();
  if (!sizeof($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;
}