You are here

upgrade_status.module in Upgrade Status 6

Checks to see if your installed modules are available for the next major release of Drupal.

File

upgrade_status.module
View source
<?php

/**
 * @file
 * Checks to see if your installed modules are available for the next major
 * release of Drupal.
 */

/**
 * Default version of core we want to query for.
 */
define('UPGRADE_STATUS_CORE_VERSION', '7.x');

/**
 * Project has a new release available, but it is not a security release.
 */
define('UPGRADE_STATUS_DEVELOPMENT', 1000);

/**
 * Project is available.
 */
define('UPGRADE_STATUS_STABLE', 5);

/**
 * Project has been moved into core.
 */
define('UPGRADE_STATUS_CORE', 5000);

/**
 * Implementation of hook_help().
 */
function upgrade_status_help($path, $arg) {
  switch ($path) {
    case 'admin/help#module':
      $file = drupal_get_path('module', 'upgrade_status') . '/README.txt';
      if (file_exists($file)) {
        return _filter_autop(file_get_contents($file));
      }
      break;
  }
}

/**
 * Implementation of hook_menu().
 */
function upgrade_status_menu() {
  $items['admin/reports/updates/upgrade'] = array(
    'title' => 'Upgrade status',
    'page callback' => 'upgrade_status_status',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 10,
    'file' => 'upgrade_status.report.inc',
  );
  $items['admin/reports/updates/upgrade/check'] = array(
    'page callback' => 'upgrade_status_manual_status',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'upgrade_status.fetch.inc',
  );
  return $items;
}

/**
 * Implementation of hook_theme().
 */
function upgrade_status_theme() {
  return array(
    'upgrade_status_report' => array(
      'arguments' => array(
        'data' => NULL,
      ),
      'file' => 'upgrade_status.report.inc',
    ),
  );
}

/**
 * Internal helper to try to get the update information from the cache
 * if possible, and to refresh the cache when necessary.
 *
 * In addition to checking the cache lifetime, this function also ensures that
 * there are no .info files for enabled modules or themes that have a newer
 * modification timestamp than the last time we checked for available update
 * data. If any .info file was modified, it almost certainly means a new
 * version of something was installed. Without fresh available update data,
 * the logic in update_calculate_project_data() will be wrong and produce
 * confusing, bogus results.
 *
 * @param $refresh
 *   Boolean to indicate if this method should refresh the cache automatically
 *   if there's no data.
 *
 * @see update_refresh()
 * @see update_get_projects()
 */
function upgrade_status_get_available($refresh = FALSE) {
  module_load_include('inc', 'upgrade_status', 'upgrade_status.compare');
  $available = array();
  if (!$refresh && ($cache = _update_cache_get('upgrade_status_available_releases')) && $cache->expire > time()) {
    $available = $cache->data;
  }
  else {
    $available = upgrade_status_refresh();
  }
  return $available;
}

/**
 * Wrapper to load the include file and then refresh the release data.
 */
function upgrade_status_refresh() {
  module_load_include('inc', 'upgrade_status', 'upgrade_status.fetch');
  return _upgrade_status_refresh();
}

/**
 * Return status and notice about modules moved into Core.
 *
 * Assign custom upgrade information for certain modules.
 *
 * @param $projects
 *   Array of projects from upgrade_status_calculate_project_data().
 * @param $project
 *   Project name to check.
 * @return
 *   TRUE if module has been moved into core.
 *
 * @todo Handle partial core additions, e.g.
 *   - Token
 *   - CTools: AJAX framework
 *   - Taxonomy image
 *   - Better Formats, Filter by node type
 *   For cleanly coded and separated modules, allowing to target sub-modules in
 *   a project might be sufficient already.
 *
 * @todo Check whether 'help' keys make sense. Users having those modules
 *   installed should already know what the modules are doing. This help info
 *   was kept, because the work was done, but it might not make sense at all.
 */
function upgrade_status_moved_into_core(&$projects, $project) {

  // Only include in core statuses for the configured major version and below.
  // Set the oldest version's data first, so that the latest version of core may
  // update the previous version's information.
  // @todo What about modules moved into core and then back out?
  $core_version = variable_get('upgrade_status_core_version', UPGRADE_STATUS_CORE_VERSION);
  switch ($core_version) {
    case '7.x':
      $core = _upgrade_status_d7_core($projects, $project);
      break;
    case '8.x':
      $d7_core = _upgrade_status_d7_core($projects, $project);
      $d8_core = _upgrade_status_d8_core($projects, $project);
      $core = $d7_core || $d8_core;
      break;
  }
  return $core;
}

/**
 * Modules in core in Drupal 8.
 *
 * @see upgrades_status_moved_into_core()
 */
function _upgrade_status_d8_core(&$projects, $project) {

  // Specifying a case for the module in this switch statement will mark it as
  // included in core on the status report.
  $core = TRUE;
  switch ($project) {
    case 'admin_language':
    case 'entity_translation':
    case 'fallback_language_negotiation':
    case 'i18n':
    case 'i18nviews':
    case 'l10n_install':
    case 'l10n_update':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by core localization functionality, the core Language module, and the core Configuration, Content, and Interface Translation modules.');
      break;
    case 'admin_views':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('Integrated with the core Views module. No comment admin view in 8.0.x.');
      break;
    case 'bean':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by the core Custom Block module.');
      break;
    case 'breakpoint':
    case 'breakpoints':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'cachetags':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by core APIs.');
      break;
    case 'caption_filter':
    case 'float_filter':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by functionality in the core Editor module.');
      break;
    case 'ckeditor':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'ctools':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('Mostly replaced by core APIs, including modal dialogs, exportables, and plugins. Excludes <a href="@url">Page Manager</a> and Form Wizard.', array(
        '@url' => 'https://www.drupal.org/project/page_manager',
      ));
      break;
    case 'date':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('No recurring dates support or integrated start and end dates.');
      break;
    case 'date_popup_authored':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'edit':
    case 'quickedit':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'email':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('E-mail address contact forms are not supported by core.');
      break;
    case 'entityreference':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'entity':
    case 'entity_view_mode':
    case 'file_entity':
    case 'hidden_field':
    case 'title':
    case 'user_picture_field':
    case 'uuid':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by core Entity system functionality.');
      break;
    case 'features':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('The original intended functionality of the Features module is not provided by core, but the core Configuration system provides support for importing, exporting, and overriding site configuration.');
    case 'link':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('No support for internal links.');
      break;
    case 'migrate':
    case 'migrate_d2d':
    case 'migrate_drupal':
      $projects[$project]['in_core_since'] = '8.x';
      break;
    case 'module_filter':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('A search functionality is included on the core modules page. The re-designed modules page in the 2.x branch is not in core.');
      break;
    case 'navbar':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by the updated core Toolbar module.');
      break;
    case 'phone':
    case 'telephone':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'picture':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by the core Responsive Image module.');
      break;
    case 'elements':
    case 'placeholder':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by HTML5 form API functionality.');
      break;
    case 'restws':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by the core REST module.');
      break;
    case 'services':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('The core REST module provides most of the functionality from previous versions of the Services module.');
      break;
    case 'stringoverrides':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('The core Interface Translation module allows custom translations to be provided for strings in any language, including English.');
      break;
    case 'transliteration':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('Replaced by core APIs. No direct support for transliterating path aliases or file names.');
      break;
    case 'variable':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Replaced by the core Configuration system.');
      break;
    case 'views':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'views_bulk_operations':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('The core Views module provides bulk operations on simple actions only. No support for batch operations or configurable actions.');
      break;
    case 'wysiwyg':
      $projects[$project]['in_core_since'] = '8.x';
      $projects[$project]['in_core_note'] = t('API support added to the core "Editor" module. No support for multiple text editors per text format.');
      break;

    // Also correct information about D7 modules.
    case 'cck':
      $projects[$project]['in_core_note'] = '';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    default:

      // Any other module is not included in core.
      $core = FALSE;
  }
  return $core;
}

/**
 * Modules in core in Drupal 7.
 *
 * @see upgrades_status_moved_into_core()
 */
function _upgrade_status_d7_core(&$projects, $project) {

  // Specifying a case for the module in this switch statement will mark it as
  // included in core on the status report.
  $core = TRUE;
  switch ($project) {
    case 'ahah_helper':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Allows Drupal modules to implement AHAH/AJAX functionality without touching JavaScript. Entirely covered by the new AJAX framework in Drupal 7, which is based on <a href="@ctools-url">CTools</a>.', array(
        '@ctools-url' => 'http://drupal.org/project/ctools',
      ));
      break;
    case 'autoload':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('Allows Drupal modules to lazy-load any class that has not been loaded yet. A major performance improvement in Drupal 7, and the only part of the <a href="@issue-url">Registry</a> that was introduced earlier, but later removed from Drupal 7.', array(
        '@issue-url' => 'http://drupal.org/node/221964',
      ));
      break;
    case 'auto_menutitle':
    case 'automaticmenu':
    case 'automenu':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('When creating new content, Drupal 7 automatically takes over the title of the content as menu link title, while still allowing you to alter it.');
      break;
    case 'admin_hover':
    case 'block_edit':
    case 'contextual':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('The new <a href="@issue-url">Contextual links</a> module in Drupal 7 allows you to manage page elements from the page you are looking at, i.e., you have direct access to "Edit" and "Delete" pages for content, or "Configure" pages for blocks, "List links" for menu blocks, etc. Every module can integrate with Contextual module.', array(
        '@issue-url' => 'http://drupal.org/node/473268',
      ));
      break;
    case 'adminrole':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('The <a href="@issue-url">administration role</a> is based on regular Drupal user roles and every user role can be configured to be the administration role. All new permissions (and only new) are automatically granted to the configured administration role. Permissions can still be removed from the role.', array(
        '@issue-url' => 'http://drupal.org/node/480660',
      ));
      break;
    case 'block_node_visibility':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'blocks404':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'button_style':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'canonical_url':
    case 'shortlink':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'cck':
    case 'content':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('You still need <a href="@cck-url">CCK</a> for the Nodereference and Userreference field types, and to upgrade your fields to Drupal 7. There is an overall CCK to field <a href="@upgrade-issue-url">upgrade path discussion</a>. Contributed modules may use <a href="@field-convert-url">Field converter</a> as dependency to properly upgrade their non-field data to fields. Custom programmed field type modules, which may be obsolete now, might be easier to upgrade using <a href="@migrate-url">Migrate</a> module.', array(
        '@upgrade-issue-url' => 'http://drupal.org/node/366364',
        '@cck-url' => 'http://drupal.org/project/cck',
        '@field-convert-url' => 'http://drupal.org/project/field_convert',
        '@migrate-url' => 'http://drupal.org/project/migrate',
      ));
      break;
    case 'checkbox_validate':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'comment_display':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'config_perms':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'content_taxonomy':
    case 'field_taxonomy':
    case 'term_fields':
    case 'taxidermy':
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_since'] = '7.x';
      break;

    // @todo Allow to target a module (not project).
    case 'date_timezone':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'dbtng':
    case 'transaction':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Drupal 7 implements an entirely new <a href="@issue-url">database layer</a>, which allows Drupal to work with any database. Modules are able to alter most database queries and there is support for transactions.', array(
        '@issue-url' => 'http://drupal.org/node/225450',
      ));
      break;
    case 'edit_term':
    case 'taxonomy_intro':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'elements':
    case 'element_themehook':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('In Drupal 7, almost all content is generated as "renderable array", which allows to consider any element on a page as atomic, alterable, and themeable element that can be still be altered until it is rendered into a string.');
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'hook_file':
    case 'storage_api':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Drupal 7 natively uses PHP 5 stream wrappers, which allow to store and access files in almost any location, even remotely. There is also a clean separation between the public and private filesystem, and both can be used at the same time.');
      break;
    case 'filefield':

    // @todo Allow to target a module (not project).
    case 'upload':
    case 'upload_element':
    case 'upload_preview':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('<a href="@issue-url">Upload</a> module has been replaced with File field.', array(
        '@issue-url' => 'http://drupal.org/node/563000',
      ));
      break;
    case 'filter_default':
    case 'input_format_permissions':
    case 'user_default_filter':
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_since'] = '7.x';
      break;
    case 'image':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('The most common use-case of <a href="@image-url">Image</a> module, an image field type, is contained in Drupal core. The Image project is required to <a href="@upgrade-issue-url">upgrade</a> existing data, and its main image module has been renamed to image_node module, since Drupal core took over the namespace. Image Node module is required for use-cases like restricting access, direct image access through a URL, attached data like comments, votes, or geo coordinates.', array(
        '@image-url' => 'http://drupal.org/project/image',
        '@upgrade-issue-url' => 'http://drupal.org/node/513096',
      ));
      break;
    case 'imageapi':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('The <a href="@imageapi-url">ImageAPI</a> module for Drupal 7 only provides the ImageMagick toolkit and an unsharpen mask action. Everything else has been moved into Drupal core.', array(
        '@imageapi-url' => 'http://drupal.org/project/imageapi',
      ));
      break;
    case 'imagecache':
    case 'imagefield':
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_since'] = '7.x';
      break;
    case 'jq':
    case 'jqp':
    case 'plugins':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('Drupal 7 allows modules to register custom libraries, consisting of JavaScript and CSS files, which can then be loaded at once. External libraries, i.e., code that is not shipped with a module, is not supported by Drupal core and requires the <a href="@libraries-url">Libraries API</a> module.', array(
        '@libraries-url' => 'http://drupal.org/project/libraries',
      ));
      break;
    case 'jquery_cookie':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'jquery_form_update':
    case 'jsalter':
    case 'wysiwygcck':
    case 'tinymce_ahah':
    case 'tinymce_dragdrop':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'jquery_ui':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('Advanced jQuery UI features (like Theme Roller support) are not in Drupal core.');
      break;
    case 'login_security':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('Drupal core provides no UI. If required, the internal variables may be configured using the <a href="@flood-control-url">Flood control</a> module.', array(
        '@flood-control-url' => 'http://drupal.org/project/flood_control',
      ));
      break;
    case 'menuless_nodetype':
    case 'ctm':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'nodepreview_by_type':
    case 'preview':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'permissions_api':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'phpass':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      $projects[$project]['in_core_note'] = t('All stored user passwords will be additionally salted');
      break;
    case 'plugin_manager':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'poormanscron':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'protect_critical_users':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'drupal_queue':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'rdf':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'seven':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'simplecdn':
    case 'abssrc':
    case 'parallel':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('The new File API and handling of JavaScript  and CSS in Drupal 7 allows modules to alter the URLs of all files. Everyone is encouraged to switch to the joined community effort, the <a href="@cdn-url">CDN</a> project.', array(
        '@cdn-url' => 'http://drupal.org/project/cdn',
      ));
      break;
    case 'simpletest':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'tar':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'taxonomy_delegate':
    case 'vocabperms':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'token':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_note'] = t('Drupal core does not provide a user interface to browse tokens (in forms).');
      break;
    case 'url_alter':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'user_cancellation':
    case 'user_delete':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'vertical_tabs':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'view_unpublished':
      $projects[$project]['in_core_since'] = '7.x';
      $projects[$project]['in_core_complete'] = TRUE;
      break;
    case 'actions':
      $projects[$project]['in_core_since'] = '6.x';
      $projects[$project]['in_core_note'] = t('Please note that the syntax for actions used by the 5.x-1.x and 4.7 versions of Actions module are different to triggers in Drupal 6.x. For further information please refer to the <a href="!project-url">Actions</a> module project page.', array(
        '!project-url' => 'http://drupal.org/project/actions',
      ));
      break;
    case 'ahah_forms':
      $projects[$project]['in_core_since'] = '6.x';
      break;
    case 'autolocale':
      $projects[$project]['in_core_since'] = '6.x';
      break;
    case 'book_bridge':
      $projects[$project]['in_core_since'] = '6.x';
      break;
    case 'find_path':
      $projects[$project]['in_core_since'] = '6.x';
      break;
    case 'html_to_text':
      $projects[$project]['in_core_since'] = '6.x';
      break;
    case 'htmlcorrector':
      $projects[$project]['in_core_since'] = '6.x';
      break;
    case 'javascript_aggregator':
      $projects[$project]['in_core_since'] = '6.x';
      $projects[$project]['in_core_note'] = t('Please note that there is a version of <a href="!project-url">JavaScript Aggregator</a> module for Drupal 6.x, which additionally minifies JavaScript.', array(
        '!project-url' => 'http://drupal.org/project/javascript_aggregator',
      ));
      break;
    case 'openid':
      $projects[$project]['in_core_since'] = '6.x';
      break;
    case 'themesettingsapi':
      $projects[$project]['in_core_since'] = '6.x';
      break;
    case 'update_status':
      $projects[$project]['in_core_since'] = '6.x';
      $projects[$project]['in_core_note'] = t('Please note that some of the advanced settings in the 5.x version of Update status are not present in the update.module in 6.x core, and have been moved into the <a href="!project-url">Update status advanced settings</a> module for Drupal 6.x and beyond.', array(
        '!project-url' => 'http://drupal.org/project/update_advanced',
      ));
      break;
    case 'user_status':
      $projects[$project]['in_core_since'] = '6.x';
      $projects[$project]['in_core_note'] = t('There is no database upgrade path for sites that used the 5.x version of the user_status module to migrate the message templates to the new settings in core. Furthermore, the place-holders available in these templates are different in 6.x core. Therefore, users will have to re-enter their message templates into the core settings at admin/user/settings.');
      break;
    default:
      $core = FALSE;
  }
  return $core;
}

/**
 * Form to display Drupal core version selection.
 */
function upgrade_status_core_version_form(&$form_state) {
  $form['upgrade_status_core_version'] = array(
    '#type' => 'select',
    '#title' => t('Target version of Drupal core'),
    '#options' => drupal_map_assoc(array(
      '7.x',
      '8.x',
    )),
    '#default_value' => variable_get('upgrade_status_core_version', UPGRADE_STATUS_CORE_VERSION),
    '#description' => t('Select the version of Drupal core you wish to check for project status.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Change'),
  );
  return $form;
}

/**
 * Set the new Drupal core version in a variable; refresh project data.
 */
function upgrade_status_core_version_form_submit($form, &$form_state) {

  // Refresh status if a different version than the default has been selected.
  if ($form_state['values']['upgrade_status_core_version'] != UPGRADE_STATUS_CORE_VERSION) {
    variable_set('upgrade_status_core_version', $form_state['values']['upgrade_status_core_version']);
    upgrade_status_refresh();
  }
  else {
    if (variable_get('upgrade_status_core_version', UPGRADE_STATUS_CORE_VERSION) != UPGRADE_STATUS_CORE_VERSION) {
      variable_del('upgrade_status_core_version');
      upgrade_status_refresh();
    }
    else {
      variable_del('upgrade_status_core_version');
    }
  }
  drupal_set_message(t('The configuration options have been saved.'));
}

Functions

Namesort descending Description
upgrade_status_core_version_form Form to display Drupal core version selection.
upgrade_status_core_version_form_submit Set the new Drupal core version in a variable; refresh project data.
upgrade_status_get_available Internal helper to try to get the update information from the cache if possible, and to refresh the cache when necessary.
upgrade_status_help Implementation of hook_help().
upgrade_status_menu Implementation of hook_menu().
upgrade_status_moved_into_core Return status and notice about modules moved into Core.
upgrade_status_refresh Wrapper to load the include file and then refresh the release data.
upgrade_status_theme Implementation of hook_theme().
_upgrade_status_d7_core Modules in core in Drupal 7.
_upgrade_status_d8_core Modules in core in Drupal 8.

Constants

Namesort descending Description
UPGRADE_STATUS_CORE Project has been moved into core.
UPGRADE_STATUS_CORE_VERSION Default version of core we want to query for.
UPGRADE_STATUS_DEVELOPMENT Project has a new release available, but it is not a security release.
UPGRADE_STATUS_STABLE Project is available.