function hosting_feature in Hostmaster (Aegir) 6
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.
17 calls to hosting_feature()
- hosting_client_access in modules/
hosting/ client/ hosting_client.module - Implementation of hook_access().
- hosting_client_form_alter in modules/
hosting/ client/ hosting_client.module - Implementation of hook_form_alter().
- hosting_client_user in modules/
hosting/ client/ hosting_client.access.inc - Implements hook_user().
- hosting_features_form in modules/
hosting/ hosting.features.inc - The Hosting features form.
- hosting_features_form_submit in modules/
hosting/ hosting.features.inc - Submit callback for the Hosting features form.
File
- modules/
hosting/ 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 = HOSTING_FEATURE_REQUIRED;
}
elseif (isset($features[$feature]['module'])) {
$return = module_exists($features[$feature]['module']) ? HOSTING_FEATURE_ENABLED : HOSTING_FEATURE_DISABLED;
}
else {
$return = variable_get('hosting_feature_' . $feature, $features[$feature]['status']);
}
return $return;
}