1 update.module _update_message_text($msg_type, $msg_reason, $report_link = FALSE, $language = NULL)

Returns the appropriate message text when site is out of date or not secure.

These error messages are shared by both update_requirements() for the site-wide status report at admin/reports/status and in the body of the notification email messages generated by update_cron().

Parameters

$msg_type: String to indicate what kind of message to generate. Can be either 'core' or 'contrib'.

$msg_reason: Integer constant specifying why message is generated.

$report_link: (optional) Boolean that controls if a link to the updates report should be added. Defaults to FALSE.

$language: (optional) A language object to use. Defaults to NULL.

Return value

The properly translated error message for the given key.:

File

core/modules/update/update.module, line 487
Handles update checking for Backdrop core and contributed projects.

Code

function _update_message_text($msg_type, $msg_reason, $report_link = FALSE, $language = NULL) {
  $langcode = isset($language) ? $language->langcode : NULL;
  $text = '';
  switch ($msg_reason) {
    case UPDATE_NOT_SECURE:
      if ($msg_type == 'core') {
        $text = t('There is a security update available for your version of Backdrop. To ensure the security of your server, you should update immediately!', array(), array('langcode' => $langcode));
      }
      else {
        $text = t('There are security updates available for one or more of your modules, themes, or layouts. To ensure the security of your server, you should update immediately!', array(), array('langcode' => $langcode));
      }
      break;

    case UPDATE_REVOKED:
      if ($msg_type == 'core') {
        $text = t('Your version of Backdrop has been revoked and is no longer available for download. Upgrading is strongly recommended!', array(), array('langcode' => $langcode));
      }
      else {
        $text = t('The installed version of at least one of your modules or themes has been revoked and is no longer available for download. Upgrading or disabling is strongly recommended!', array(), array('langcode' => $langcode));
      }
      break;

    case UPDATE_NOT_SUPPORTED:
      if ($msg_type == 'core') {
        $text = t('Your version of Backdrop CMS is no longer supported. Upgrading is strongly recommended!', array(), array('langcode' => $langcode));
      }
      else {
        $text = t('The installed version of at least one of your modules or themes is no longer supported. Upgrading or disabling is strongly recommended. See the project homepage for more details.', array(), array('langcode' => $langcode));
      }
      break;

    case UPDATE_NOT_CURRENT:
      if ($msg_type == 'core') {
        $text = t('There are updates available for your version of Backdrop. To ensure the proper functioning of your site, you should update as soon as possible.', array(), array('langcode' => $langcode));
      }
      else {
        $text = t('There are updates available for one or more of your modules or themes. To ensure the proper functioning of your site, you should update as soon as possible.', array(), array('langcode' => $langcode));
      }
      break;

    case UPDATE_UNKNOWN:
    case UPDATE_NOT_CHECKED:
      if ($msg_type == 'core') {
        $text = t('Update checking is not available for your version of Backdrop.');
      }
      else {
        $text = t('Update checking is not available for some of your projects.');
      }
      break;
    case UPDATE_FETCH_PENDING:
      if ($msg_type == 'core') {
        $text = t('Update may be needed for your version of Backdrop.');
      }
      else {
        $text = t('Updates may be needed for one or more of your projects.');
      }
      break;
    case UPDATE_NOT_FETCHED:
      if ($msg_type == 'core') {
        $text = t('There was a problem checking <a href="@update-report">available updates</a> for Backdrop.', array('@update-report' => url('admin/reports/updates')), array('langcode' => $langcode));
      }
      else {
        $text = t('There was a problem checking <a href="@update-report">available updates</a> for your modules or themes.', array('@update-report' => url('admin/reports/updates')), array('langcode' => $langcode));
      }
      break;
    case UPDATE_NOT_IMPLEMENTED:
      $report_link = FALSE;
      $text = t('The update server has not yet been implemented, so no update statuses could be retrieved. Until the update server becomes active, please check for updates manually.');
      break;
  }

  if ($report_link && current_path() != 'admin/config/system/updates') {
    $text .= ' ' . t('See the <a href="@available_updates">available updates</a> page for more information.', array('@available_updates' => url('admin/reports/updates', array('language' => $language))), array('langcode' => $langcode));
  }

  return $text;
}