function hosting_site_status_codes in Hosting 6.2
Same name and namespace in other branches
- 7.4 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').
2 calls to hosting_site_status_codes()
- _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/
views/ hosting_site.views.inc - Implements hook_views_data().
File
- site/
hosting_site.module, line 596
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;
}
}