Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.318
diff -u -r1.318 common.inc
--- includes/common.inc	1 Feb 2004 19:07:36 -0000	1.318
+++ includes/common.inc	2 Feb 2004 15:20:17 -0000
@@ -1092,6 +1092,33 @@
 }
 
 /**
+ * Walks through the provided array and constructs an associative
+ * array out of it. The keys of the resulting array will be the
+ * values of the passed array. The values will either be the same
+ * (if no function was specified), or the results of the function
+ * given the value.
+ *
+ * @param $array An array
+ * @param $function A name of a function to apply to all values
+ */
+function drupal_map_assoc($array, $function = NULL) {
+  if (!isset($function)) {
+    $result = array();
+    foreach ($array as $value) {
+      $result[$value] = $value;
+    }
+    return $result;
+  }
+  elseif (function_exists($function)) {
+    $result = array();
+    foreach($array as $value) {
+      $result[$value] = $function($value);
+    }
+    return $result;
+  }
+} 
+
+/**
  * Wrapper around xml_parser_create() which extracts the encoding from the XML
  * data first and sets the output encoding to UTF-8. This function should be
  * used instead of xml_parser_create(), because PHP's XML parser doesn't check
Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.325
diff -u -r1.325 node.module
--- modules/node.module	2 Feb 2004 02:05:20 -0000	1.325
+++ modules/node.module	2 Feb 2004 15:20:22 -0000
@@ -570,7 +570,7 @@
 }
 
 function node_settings() {
-  $output .= form_select(t('Number of posts on main page'), 'default_nodes_main', variable_get('default_nodes_main', 10), array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 =>  5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 15 => 15, 20 => 20, 25 => 25, 30 => 30), t('The default maximum number of posts to display per page on overview pages such as the main page.'));
+  $output .= form_select(t('Number of posts on main page'), 'default_nodes_main', variable_get('default_nodes_main', 10), drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30)), t('The default maximum number of posts to display per page on overview pages such as the main page.'));
   $output .= form_select(t('Length of trimmed posts'), 'teaser_length', variable_get('teaser_length', 600), array(0 => t('Unlimited'), 200 => t('200 characters'), 400 => t('400 characters'), 600 => t('600 characters'), 800 => t('800 characters'), 1000 => t('1000 characters'), 1200 => t('1200 characters'), 1400 => t('1400 characters'), 1600 => t('1600 characters'), 1800 => t('1800 characters'), 2000 => t('2000 characters')), t("The maximum number of characters used in the trimmed version of a post.  Drupal will use this setting to determine at which offset long posts should be trimmed.  The trimmed version of a post is typically used as a teaser when displaying the post on the main page, in XML feeds, etc.  To disable teasers, set to 'Unlimited'."));
   $output .= form_radios(t('Preview post'), 'node_preview', variable_get('node_preview', 0), array(t('Optional'), t('Required')), t('Must users preview posts before submitting?'));
 
Index: modules/watchdog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/watchdog.module,v
retrieving revision 1.90
diff -u -r1.90 watchdog.module
--- modules/watchdog.module	23 Jan 2004 18:42:43 -0000	1.90
+++ modules/watchdog.module	2 Feb 2004 15:20:22 -0000
@@ -63,7 +63,8 @@
 }
 
 function watchdog_settings() {
-  $period = array(3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => t("Never"));
+  $period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200), "format_interval");
+  $period[1000000000] = t('Never');
   $output .= form_select(t("Discard entries older than"), "watchdog_clear", variable_get("watchdog_clear", 604800), $period, t("The time watchdog entries should be kept.  Older entries will be automatically discarded.  Requires crontab."));
   return $output;
 }
Index: modules/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment.module,v
retrieving revision 1.215
diff -u -r1.215 comment.module
--- modules/comment.module	31 Jan 2004 21:16:42 -0000	1.215
+++ modules/comment.module	2 Feb 2004 15:20:29 -0000
@@ -1687,7 +1687,7 @@
 }
 
 function _comment_per_page() {
-  return array(10 => 10, 30 => 30, 50 => 50, 70 => 70, 90 => 90);
+  return drupal_map_assoc(array(10, 30, 50, 70, 90));
 }
 
 ?>
