You are here

function deploy_status_info in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 deploy.module \deploy_status_info()

Helper function to retrieve relevant information about a deployment status.

2 calls to deploy_status_info()
deploy_log in ./deploy.module
Helper function to log deployments.
theme_deploy_ui_overview in modules/deploy_ui/deploy_ui.pages.inc
Theme callback for the overview page.

File

./deploy.module, line 396
Deploy module functions.

Code

function deploy_status_info($status = NULL, $key = NULL) {
  $info = array(
    DEPLOY_STATUS_FAILED => array(
      'title' => t('Failed'),
      'keyed message' => 'Deployment %key failed.',
      'watchdog' => WATCHDOG_ERROR,
      'class' => 'error',
    ),
    DEPLOY_STATUS_STARTED => array(
      'title' => t('Started'),
      'keyed message' => 'Deployment of %key started.',
      'watchdog' => WATCHDOG_INFO,
      'class' => 'warning',
    ),
    DEPLOY_STATUS_PROCESSING => array(
      'title' => t('Processing'),
      'keyed message' => 'Deployment %key is processing.',
      'watchdog' => WATCHDOG_INFO,
      'class' => 'warning',
    ),
    DEPLOY_STATUS_DEPLOYED => array(
      'title' => t('Deployed'),
      'watchdog' => WATCHDOG_INFO,
      'keyed message' => 'Deployment %key was deployed.',
      'class' => 'warning',
    ),
    DEPLOY_STATUS_PUBLISHED => array(
      'title' => t('Published'),
      'keyed message' => 'Deployment %key was published.',
      'watchdog' => WATCHDOG_INFO,
      'class' => 'status',
    ),
  );
  if ($status === NULL && $key === NULL) {
    return $info;
  }
  elseif ($status !== NULL && $status !== FALSE && $key === NULL) {
    if (isset($info[$status])) {
      return $info[$status];
    }
  }
  elseif ($status !== NULL && $status !== FALSE && $key !== NULL && $key !== FALSE) {
    if (isset($info[$status][$key])) {
      return $info[$status][$key];
    }
  }
  return FALSE;
}