You are here

function opigno_lms_update_status_alter in Opigno LMS 7

Implements hook_update_status_alter().

Disable reporting of projects that are in the distribution, but only if they have not been updated manually.

File

./opigno_lms.profile, line 321
Enables modules and site configuration for a standard site installation. Provides a default API for Apps and modules to use. This will simplify the user experience.

Code

function opigno_lms_update_status_alter(&$projects) {
  $make_filepath = drupal_get_path('profile', 'opigno_lms') . '/drupal-org.make';
  if (!file_exists($make_filepath)) {
    return;
  }
  $make_info = drupal_parse_info_file($make_filepath);
  foreach ($projects as $project_name => $project_info) {

    // Never unset the drupal project to avoid hitting an error with
    // _update_requirement_check(). See http://drupal.org/node/1875386.

    /*if ($project_name == 'drupal' || !isset($project_info['releases']) || !isset($project_info['recommended'])) {
        continue;
      }*/

    // Never unset the opigno_lms project. We want them to update.
    if ($project_name == 'opigno_lms') {
      continue;
    }

    // Hide Opigno LMS projects, they have no update status of their own.
    if (strpos($project_name, 'opigno_features_') !== FALSE) {
      unset($projects[$project_name]);
    }
    elseif (isset($make_info['projects'][$project_name]['version'])) {
      $version = $make_info['projects'][$project_name]['version'];
      if (strpos($version, 'dev') !== FALSE || DRUPAL_CORE_COMPATIBILITY . '-' . $version == $project_info['info']['version']) {
        unset($projects[$project_name]);
      }
    }
  }
}