You are here

function update_advanced_is_project_ignored in Update Status Advanced Settings 6

Same name and namespace in other branches
  1. 7 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
Implementation of hook_update_status_alter().

File

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

Code

function update_advanced_is_project_ignored($project, $update_info) {
  static $settings;
  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'];
  }
  else {
    return $ignored;
  }
}