You are here

function hosting_task_status_name in Hosting 7.3

Same name and namespace in other branches
  1. 7.4 task/hosting_task.module \hosting_task_status_name()

Return a machine name for each state.

1 call to hosting_task_status_name()
hosting_task_status_class in task/hosting_task.module
Return a css class from a hosting task status integer value.

File

task/hosting_task.module, line 1820
Web server node type is defined here.

Code

function hosting_task_status_name($hosting_task_status = NULL) {
  $codes = array(
    HOSTING_TASK_SUCCESS => 'success',
    HOSTING_TASK_QUEUED => 'queued',
    HOSTING_TASK_ERROR => 'error',
    HOSTING_TASK_PROCESSING => 'processing',
    HOSTING_TASK_WARNING => 'warning',
  );
  if (!is_null($hosting_task_status) && isset($codes[$hosting_task_status])) {
    return $codes[$hosting_task_status];
  }
  elseif (!is_null($hosting_task_status) && !isset($codes[$hosting_task_status])) {
    return '';
  }
  else {
    return $codes;
  }
}