You are here

function media_wysiwyg_requirements in D7 Media 7.4

Same name and namespace in other branches
  1. 7.3 modules/media_wysiwyg/media_wysiwyg.install \media_wysiwyg_requirements()

Implements hook_requirements().

File

modules/media_wysiwyg/media_wysiwyg.install, line 89
Install, update and uninstall functions for the Media WYSIWYG module.

Code

function media_wysiwyg_requirements($phase) {
  if ($phase != 'runtime') {
    return array();
  }
  $t = get_t();
  $version = variable_get('media_wysiwyg_token_version', '');
  $req = array(
    'title' => $t("Media token version"),
  );
  if (version_compare($version, MEDIA_WYSIWYG_TOKEN_VERSION) >= 0) {
    $req['value'] = $version;
    $req['severity'] = REQUIREMENT_OK;
  }
  else {
    $req['value'] = $version ? $version . ' (' . $t("Out of date") . ')' : $t("Unknown");
    $req['severity'] = REQUIREMENT_WARNING;
    $req['description'] = $t("Existing media tokens in content may need to be updated to keep up with the latest features in the media module. This operation will alter the content in the database in-place without creating new revisions, so it's recommended to backup your database before you do this.");
    $req['description'] .= ' ';
    $req['description'] .= l($t("Upgrade tokens to format version !version", array(
      '!version' => MEDIA_WYSIWYG_TOKEN_VERSION,
    )), 'admin/reports/status/upgrade-media-tokens');
  }
  return array(
    'media_wysiwyg_token_version' => $req,
  );
}