Fix for Code

  1. Only in d6: .DS_Store
  2. Only in d6: files
  3. Only in d6/modules: .DS_Store
  4. diff -r -u -F'^function' drupal-6.0-beta4/modules/system/system.admin.inc d6/modules/system/system.admin.inc
  5. --- drupal-6.0-beta4/modules/system/system.admin.inc    2007-12-05 11:12:59.000000000 -0800
  6. +++ d6/modules/system/system.admin.inc  2007-12-12 00:53:55.000000000 -0800
  7. @@ -1962,7 +1962,18 @@ function theme_system_modules($form) {
  8.        }
  9.  
  10.        $row[] = drupal_render($form['version'][$key]);
  11. +      
  12. +      $class = '';
  13. +      if (module_exists('update')) {
  14. +        if ($module['update_status'] == UPDATE_NOT_SECURE
  15. +            || $module['update_status'] == UPDATE_NOT_CURRENT) {
  16. +          $class = 'error update';
  17. +          $status = theme('update_version_status', $module['update_status'], array('url_fragment' => $module['project']));
  18. +          $description = $status . $description;
  19. +        }
  20. +      }
  21.        $row[] = array('data' => $description, 'class' => 'description');
  22. +      $row = array('data' => $row, 'class' => $class);
  23.        $rows[] = $row;
  24.      }
  25.      $fieldset = array(
  26. diff -r -u -F'^function' drupal-6.0-beta4/modules/update/update.module d6/modules/update/update.module
  27. --- drupal-6.0-beta4/modules/update/update.module       2007-12-02 08:43:59.000000000 -0800
  28. +++ d6/modules/update/update.module     2007-12-12 00:16:35.000000000 -0800
  29. @@ -57,11 +57,17 @@ function update_help($path, $arg) {
  30.        foreach (array('core', 'contrib') as $report_type) {
  31.          $type = 'update_'. $report_type;
  32.          if (isset($status[$type]['severity'])) {
  33. +          $description = $status[$type]['description'];
  34. +          if ($available = update_get_available(TRUE)) {
  35. +            include_once './modules/update/update.compare.inc';
  36. +            $data = update_calculate_project_data($available);
  37. +            $description .= theme('update_module_list', $data);
  38. +          }
  39.            if ($status[$type]['severity'] == REQUIREMENT_ERROR) {
  40. -            drupal_set_message($status[$type]['description'], 'error');
  41. +            drupal_set_message($description, 'error');
  42.            }
  43.            elseif ($status[$type]['severity'] == REQUIREMENT_WARNING) {
  44. -            drupal_set_message($status[$type]['description']);
  45. +            drupal_set_message($description);
  46.            }
  47.          }
  48.        }
  49. @@ -153,6 +159,12 @@ function update_theme() {
  50.      'update_version' => array(
  51.        'arguments' => array('version' => NULL, 'tag' => NULL, 'class' => NULL),
  52.      ),
  53. +    'update_module_list' => array(
  54. +      'arguments' => array('data' => NULL),
  55. +    ),
  56. +    'update_version_status' => array(
  57. +      'arguments' => array('status' => UPDATE_CURRENT, 'options' => NULL),
  58. +    ),
  59.    );
  60.  }
  61.  
  62. @@ -266,6 +278,19 @@ function update_form_alter(&$form, $form
  63.    if ($form_id == 'system_modules' || $form_id == 'system_themes' ) {
  64.      $form['#submit'][] = 'update_invalidate_cache';
  65.    }
  66. +  if ($form_id == 'system_modules') {
  67. +    if ($available = update_get_available(TRUE)) {
  68. +      include_once './modules/update/update.compare.inc';
  69. +      $data = update_calculate_project_data($available);
  70. +    }
  71. +    if (isset($data)) {
  72. +      foreach ($data as $project) {
  73. +        foreach ($project['includes'] as $module => $title) {
  74. +          $form['validation_modules']['#value'][$module]->info['update_status'] = $project['status'];
  75. +        }
  76. +      }
  77. +    }
  78. +  }
  79.  }
  80.  
  81.  /**
  82. @@ -393,3 +418,70 @@ function _update_message_text($msg_type,
  83.  
  84.    return $text;
  85.  }
  86. +
  87. +function theme_update_module_list($data) {
  88. +  if (!is_array($data)) {
  89. +    return $data;
  90. +  }
  91. +  $projects = array();
  92. +  foreach ($data as $project) {
  93. +    if ($project['status'] == UPDATE_NOT_SECURE
  94. +        || $project['status'] == UPDATE_NOT_CURRENT) {
  95. +      $title = isset($project['title']) ? $project['title'] : $project['name'];
  96. +      $projects[] = l($title, 'admin/reports/updates', array('fragment' => $project['name']));
  97. +    }
  98. +  }
  99. +  return theme('item_list', $projects);
  100. +}
  101. +
  102. +function theme_update_version_status($status = UPDATE_CURRENT, $options = NULL) {
  103. +  $notification_level = variable_get('update_notification_threshold', 'all');
  104. +  switch ($status) {
  105. +    case UPDATE_CURRENT:
  106. +      $icon = theme('image', 'misc/watchdog-ok.png');
  107. +      break;
  108. +    case UPDATE_NOT_SECURE:
  109. +    case UPDATE_NOT_CURRENT:
  110. +      if ($notification_level == 'all'
  111. +          || $status == UPDATE_NOT_SECURE) {
  112. +        $icon = theme('image', 'misc/watchdog-error.png');
  113. +        break;
  114. +      }
  115. +      // Otherwise, deliberate no break and use the warning icon.
  116. +    default:
  117. +      $icon = theme('image', 'misc/watchdog-warning.png');
  118. +      break;
  119. +  }
  120. +  
  121. +  $output = '<div class="version-status">';
  122. +  $text = '';
  123. +  switch ($status) {
  124. +    case UPDATE_CURRENT:
  125. +      $text .= t('Up to date');
  126. +      break;
  127. +    case UPDATE_NOT_SECURE:
  128. +      $text .= '<span class="security-error">';
  129. +      $text .= t('Security update required!');
  130. +      $text .= '</span>';
  131. +      break;
  132. +    case UPDATE_NOT_CURRENT:
  133. +      $text .= t('Update available');
  134. +      break;
  135. +    default:
  136. +      if (isset($options['reason'])) {
  137. +        $text .= check_plain($options['reason']);
  138. +      }
  139. +      break;
  140. +  }
  141. +  if (isset($options['url_fragment'])) {
  142. +    $output .= l($text, 'admin/reports/updates', array('html' => TRUE, 'fragment' => $options['url_fragment']));
  143. +  }
  144. +  else {
  145. +    $output .= $text;
  146. +  }
  147. +  $output .= '<span class="icon">'. $icon .'</span>';
  148. +  $output .= "</div>\n";
  149. +  
  150. +  drupal_add_css(drupal_get_path('module', 'update') .'/update.css');
  151. +  return $output;
  152. +}
  153. diff -r -u -F'^function' drupal-6.0-beta4/modules/update/update.report.inc d6/modules/update/update.report.inc
  154. --- drupal-6.0-beta4/modules/update/update.report.inc   2007-10-20 14:57:50.000000000 -0700
  155. +++ d6/modules/update/update.report.inc 2007-12-12 00:15:11.000000000 -0800
  156. @@ -36,51 +36,32 @@ function theme_update_report($data) {
  157.  
  158.    $header = array();
  159.    $rows = array();
  160. -
  161. +  
  162.    $notification_level = variable_get('update_notification_threshold', 'all');
  163.  
  164. -  foreach ($data as $project) {
  165. +  foreach ($data as $project) {    
  166.      switch ($project['status']) {
  167.        case UPDATE_CURRENT:
  168.          $class = 'ok';
  169. -        $icon = theme('image', 'misc/watchdog-ok.png');
  170.          break;
  171.        case UPDATE_NOT_SECURE:
  172.        case UPDATE_NOT_CURRENT:
  173.          if ($notification_level == 'all'
  174.              || $project['status'] == UPDATE_NOT_SECURE) {
  175.            $class = 'error';
  176. -          $icon = theme('image', 'misc/watchdog-error.png');
  177.            break;
  178.          }
  179. -        // Otherwise, deliberate no break and use the warning class/icon.
  180. +        // Otherwise, deliberate no break and use the warning class.
  181.        default:
  182.          $class = 'warning';
  183. -        $icon = theme('image', 'misc/watchdog-warning.png');
  184.          break;
  185.      }
  186. -
  187. -    $row = '<div class="version-status">';
  188. -    switch ($project['status']) {
  189. -      case UPDATE_CURRENT:
  190. -        $row .= t('Up to date');
  191. -        break;
  192. -      case UPDATE_NOT_SECURE:
  193. -        $row .= '<span class="security-error">';
  194. -        $row .= t('Security update required!');
  195. -        $row .= '</span>';
  196. -        break;
  197. -      case UPDATE_NOT_CURRENT:
  198. -        $row .= t('Update available');
  199. -        break;
  200. -      default:
  201. -        $row .= check_plain($project['reason']);
  202. -        break;
  203. -    }
  204. -    $row .= '<span class="icon">'. $icon .'</span>';
  205. -    $row .= "</div>\n";
  206. +    
  207. +    $reason = (isset($project['reason'])) ? $project['reason'] : NULL;
  208. +    $row = theme('update_version_status', $project['status'], array('reason' => $reason));
  209.  
  210.      $row .= '<div class="project">';
  211. +    $row .= '<a name="'. check_plain($project['name']) .'"></a>';
  212.      if (isset($project['title'])) {
  213.        if (isset($project['link'])) {
  214.          $row .= l($project['title'], $project['link']);
  215. Only in d6/sites: .DS_Store
  216. Only in d6/sites/all: .DS_Store
  217. Only in d6/sites/all: modules
  218. Only in d6/sites/default: settings.php

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.