You are here

function update_advanced_is_project_ignored in Update Status Advanced Settings 7

Same name and namespace in other branches
  1. 6 update_advanced.module \update_advanced_is_project_ignored()

Check if a project or a project's release has been set to be ignored.

Parameters

$project: A string with the project name.

$update_info: An array with the information fetched from update.module.

Return value

A string with the administrator note or TRUE if the project should be ignored in update results, or FALSE otherwise.

1 call to update_advanced_is_project_ignored()
update_advanced_update_status_alter in ./update_advanced.module
Implements hook_update_status_alter().

File

./update_advanced.module, line 78
Provides advanced settings for the Update status module in core.

Code

function update_advanced_is_project_ignored($project, $update_info) {
  $settings =& drupal_static(__FUNCTION__);
  if (!isset($settings)) {
    $settings = variable_get('update_advanced_project_settings', array());
  }
  $ignored = FALSE;
  if (isset($settings[$project]['check'])) {
    if ($settings[$project]['check'] == 'never') {

      // User has set this project to always be ignored.
      $ignored = TRUE;
    }
    elseif (isset($update_info['recommended']) && $settings[$project]['check'] === $update_info['recommended']) {

      // User has set this version to be ignored.
      $ignored = TRUE;
    }
  }
  if ($ignored && !empty($settings[$project]['notes'])) {

    // Return the ignore note if available.
    return $settings[$project]['notes'];
  }
  return $ignored;
}