function config_pages_config_pages_context_value in Config Pages 7
Implements hook_config_pages_context_value().
File
- ./
config_pages.module, line 80 - This module is based on Model module (https://drupal.org/project/model) and most of the comments left untouched but have entity types renamed. Suuport for features added.
Code
function config_pages_config_pages_context_value($key) {
global $language;
// Default value.
$value = NULL;
// Get value for specified context key.
switch ($key) {
case 'language':
$value = $language->language;
break;
case 'host':
$value = $_SERVER['HTTP_HOST'];
break;
case 'domain':
if (module_exists('domain')) {
$domain = domain_get_domain();
$value = $domain['machine_name'];
}
else {
$value = -1;
}
break;
}
return $value;
}