1. /**
  2.  * Implementation of hook_requirements().
  3.  */
  4. function hs_views_taxonomy_requirements($phase) {
  5.   $requirements = array();
  6.  
  7.   if ($phase == 'runtime') {
  8.     $pattern = <<<EOT
  9. function _views_build_filters_form(\$view) {
  10.   // When the form is retrieved through an AJAX callback, the cache hasn't
  11.   // been loaded yet. The cache is necesssary for _views_get_filters().
  12.   views_load_cache();
  13. EOT;
  14.     $views_with_patch_257004 = preg_match('#'. preg_quote($pattern) .'#m', file_get_contents(drupal_get_path('module', 'views') .'/views.module'));
  15.  
  16.     if ($views_with_patch_257004) {
  17.       $value = t('The Views module is new enough.');
  18.       $description = '';
  19.       $severity = REQUIREMENT_OK;
  20.     }
  21.     else {
  22.       $value = t('The Views module is outdated.');
  23.       $description = t("The version of Views that you have installed is either
  24.        older than May 11, 2008, or doesn't have the obligatory patch applied.
  25.        Please apply the <a href=\"!patch_url\">patch</a> or update to a newer
  26.        version of the Views module!"
  27.       );
  28.       $severity = REQUIREMENT_ERROR;      
  29.     }
  30.  
  31.     $requirements['hs_views_taxonomy'] = array(
  32.       'title' => t('Hierarchical Select Views Taxonomy'),
  33.       'value' => $value,
  34.       'description' => $description,
  35.       'severity' => $severity,
  36.     );
  37.   }
  38.  
  39.   return $requirements;
  40. }