function hosting_site_status_codes in Hosting 7.4
Same name and namespace in other branches
- 6.2 site/hosting_site.module \hosting_site_status_codes()
- 7.3 site/hosting_site.module \hosting_site_status_codes()
Define the status type labels and classes.
Parameters
$type: The type of status to return ('label' or 'class').
Return value
array
3 calls to hosting_site_status_codes()
- hosting_site_status_codes_labels in site/
hosting_site.module - Site status codes to human readable label mappings.
- _hosting_site_list_class in site/
hosting_site.module - Define the classes that correspond to the site status.
- _hosting_site_status in site/
hosting_site.module - Define the status types of a site
1 string reference to 'hosting_site_status_codes'
- hosting_site_views_data in site/
includes/ views/ hosting_site.views.inc - Implements hook_views_data().
File
- site/
hosting_site.module, line 648 - Contains hook implementations for Hosting site module.
Code
function hosting_site_status_codes($type = NULL) {
static $codes = array(
HOSTING_SITE_QUEUED => array(
'label' => 'Queued',
'class' => 'hosting-queue',
),
HOSTING_SITE_ENABLED => array(
'label' => 'Enabled',
'class' => 'hosting-success',
),
HOSTING_SITE_DELETED => array(
'label' => 'Deleted',
'class' => 'hosting-error',
),
HOSTING_SITE_DISABLED => array(
'label' => 'Disabled',
'class' => 'hosting-disable',
),
);
if (!is_null($type)) {
// Return just the $type
$return = array();
foreach ($codes as $code => $types) {
$return[$code] = $types[$type];
}
return $return;
}
else {
// Return everything
return $codes;
}
}