You are here

function deploy_status_info in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 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.
deploy_ui_plan::view_page in modules/deploy_ui/plugins/export_ui/deploy_ui_plan.class.php
Renders the view deployment plan page.

File

./deploy.module, line 559
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;
}