diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-10-29 15:13:01 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-10-29 15:13:01 +0000 |
commit | 49f6f3bf71daf78f75c731db626a40f2284838b2 (patch) | |
tree | e0b0bc296e48cd530449c151daade3c9bb833f60 /modules | |
parent | 7992505881073aff0bbdce49301eca2c5dd3fc1b (diff) | |
download | brdo-49f6f3bf71daf78f75c731db626a40f2284838b2.tar.gz brdo-49f6f3bf71daf78f75c731db626a40f2284838b2.tar.bz2 |
Color.module tweaks:
- Remove tab characters
- Make sure GD2 is present before doing magic.
- Add requirement check for GD2
- Fix broken .png file
Diffstat (limited to 'modules')
-rw-r--r-- | modules/color/color.module | 16 | ||||
-rw-r--r-- | modules/system/system.install | 5 | ||||
-rw-r--r-- | modules/system/system.module | 8 |
3 files changed, 19 insertions, 10 deletions
diff --git a/modules/color/color.module b/modules/color/color.module index 5b3b3ce71..e0253e74c 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -6,7 +6,7 @@ */ function color_form_alter($form_id, &$form) { // Insert the color changer into the theme settings page. - if ($form_id == 'system_theme_settings' && color_get_info(arg(4))) { + if ($form_id == 'system_theme_settings' && color_get_info(arg(4)) && function_exists('gd_info')) { $form['color'] = array( '#type' => 'fieldset', '#title' => t('Color scheme'), @@ -502,8 +502,8 @@ function _color_hsl2rgb($hsl) { $m2 = ($l <= 0.5) ? $l * ($s + 1) : $l + $s - $l*$s; $m1 = $l * 2 - $m2; return array(_color_hue2rgb($m1, $m2, $h + 0.33333), - _color_hue2rgb($m1, $m2, $h), - _color_hue2rgb($m1, $m2, $h - 0.33333)); + _color_hue2rgb($m1, $m2, $h), + _color_hue2rgb($m1, $m2, $h - 0.33333)); } /** @@ -530,14 +530,14 @@ function _color_rgb2hsl($rgb) { $l = ($min + $max) / 2; $s = 0; if ($l > 0 && $l < 1) { - $s = $delta / ($l < 0.5 ? (2 * $l) : (2 - 2 * $l)); + $s = $delta / ($l < 0.5 ? (2 * $l) : (2 - 2 * $l)); } $h = 0; if ($delta > 0) { - if ($max == $r && $max != $g) $h += ($g - $b) / $delta; - if ($max == $g && $max != $b) $h += (2 + ($b - $r) / $delta); - if ($max == $b && $max != $r) $h += (4 + ($r - $g) / $delta); - $h /= 6; + if ($max == $r && $max != $g) $h += ($g - $b) / $delta; + if ($max == $g && $max != $b) $h += (2 + ($b - $r) / $delta); + if ($max == $b && $max != $r) $h += (4 + ($r - $g) / $delta); + $h /= 6; } return array($h, $s, $l); }
\ No newline at end of file diff --git a/modules/system/system.install b/modules/system/system.install index c94a05234..7980c1272 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -19,7 +19,8 @@ function system_requirements($phase) { $requirements['drupal'] = array( 'title' => $t('Drupal'), 'value' => VERSION, - 'severity' => REQUIREMENT_INFO + 'severity' => REQUIREMENT_INFO, + 'weight' => -10, ); } @@ -27,7 +28,7 @@ function system_requirements($phase) { $software = $_SERVER['SERVER_SOFTWARE']; $requirements['webserver'] = array( 'title' => $t('Web server'), - 'value' => $software + 'value' => $software, ); // Use server info string, if present. if ($software && preg_match('![0-9]!', $software)) { diff --git a/modules/system/system.module b/modules/system/system.module index 0789d8841..ac3e743b1 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1793,6 +1793,7 @@ function system_status($check = FALSE) { // Check run-time requirements and status information $requirements = module_invoke_all('requirements', 'runtime'); + usort($requirements, '_system_sort_requirements'); if ($check) { return drupal_requirements_severity($requirements) == REQUIREMENT_ERROR; @@ -1802,6 +1803,13 @@ function system_status($check = FALSE) { } /** + * Helper function to sort requirements. + */ +function _system_sort_requirements($a, $b) { + return (isset($a['weight']) || isset($b['weight'])) ? $a['weight'] - $b['weight'] : strcmp($a['title'], $b['title']); +} + +/** * Theme status report */ function theme_status_report(&$requirements) { |