Index: modules/userpoints/userpoints.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/userpoints.module,v
retrieving revision 1.43
diff -u -r1.43 userpoints.module
--- modules/userpoints/userpoints.module	5 Nov 2006 00:14:51 -0000	1.43
+++ modules/userpoints/userpoints.module	17 Nov 2006 09:51:12 -0000
@@ -31,9 +31,9 @@
   
   if (!isset($trans)) {
     $trans = array(
-      '%Points' => variable_get(USERPOINTS_TRANS_UCPOINTS, 'Points'),
-      '%points' => variable_get(USERPOINTS_TRANS_LCPOINTS, 'points'),
-      '%point'  => variable_get(USERPOINTS_TRANS_LCPOINT, 'point')
+      '!Points' => variable_get(USERPOINTS_TRANS_UCPOINTS, 'Points'),
+      '!points' => variable_get(USERPOINTS_TRANS_LCPOINTS, 'points'),
+      '!point'  => variable_get(USERPOINTS_TRANS_LCPOINT, 'point')
       );
   }
   return $trans;  
@@ -41,11 +41,8 @@
 
 function userpoints_help($section) {
   switch ($section) {
-    case 'admin/modules#description':
-      $output = t('Users earn %points as they post nodes, comments, and vote on nodes', userpoints_translation());
-      break;
     case 'admin/settings/userpoints':
-      $output = t('Users earn %points as they post nodes, comments, and vote on nodes', userpoints_translation());
+      $output = t('Users earn !points as they post nodes, comments, and vote on nodes', userpoints_translation());
       break;
   }
   return $output;
@@ -54,12 +51,22 @@
 function userpoints_menu($may_cache) {
   $items = array();
 
-  $items[] = array(
-    'path'     => 'userpoints',
-    'callback' => 'userpoints_list_users',
-    'title'    => t('users by %points', userpoints_translation()),
-    'access'   => user_access(USERPOINTS_PERM_VIEW),
-    'type'     => MENU_NORMAL_ITEM);
+  if ($may_cache) {
+    $items[] = array(
+      'path'     => 'userpoints',
+      'callback' => 'userpoints_list_users',
+      'title'    => t('Users by !Points', userpoints_translation()),
+      'access'   => user_access(USERPOINTS_PERM_VIEW),
+      'type'     => MENU_NORMAL_ITEM);
+    $items[] = array(
+      'path' => 'admin/settings/userpoints',
+      'title' => t('Userpoints'),
+      'description' => t('Userpoints settings.'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => 'userpoints_settings',
+      'access'   => user_access(USERPOINTS_PERM_VIEW),
+      'type' => MENU_NORMAL_ITEM,);
+  }
 
    return $items;
 }
@@ -73,13 +80,13 @@
   $form[$group] = array(
     '#type' => 'fieldset',
     '#collapsible' => true,
-    '#title' => t('%Points for each event', userpoints_translation()),
+    '#title' => t('!Points for each event', userpoints_translation()),
     );
 
   foreach(node_get_types() as $type => $name) {
     $form[$group][USERPOINTS_POST. $type] = array(
       '#type' => 'textfield',
-      '#title' => t('%Points for posting a %node-name', array_merge(userpoints_translation(), array('%node-name' => $name))),
+      '#title' => t('!Points for posting a !node-name', array_merge(userpoints_translation(), array('!node-name' => $name->name))),
       '#default_value' => variable_get(USERPOINTS_POST. $type, '0'),
       '#size' => 5,
       '#maxlength' => 5,
@@ -88,7 +95,7 @@
 
   $form[$group][USERPOINTS_POST_COMMENT] = array(
     '#type' => 'textfield',
-    '#title' => t('%Points for posting a comment', userpoints_translation()),
+    '#title' => t('!Points for posting a Comment', userpoints_translation()),
     '#default_value' => variable_get(USERPOINTS_POST_COMMENT, 0),
     '#size' => 5,
     '#maxlength' => 5,
@@ -96,53 +103,53 @@
 
   $form[$group][USERPOINTS_MODERATE_COMMENT] = array(
     '#type' => 'textfield',
-    '#title' => t('%Points for moderating a comment', userpoints_translation()),
+    '#title' => t('!Points for moderating a Comment', userpoints_translation()),
     '#default_value' => variable_get(USERPOINTS_MODERATE_COMMENT, 0),
     '#size' => 5,
     '#maxlength' => 5,
     );
 
-  if (module_exist('nodevote')) {
+  if (module_exists('nodevote')) {
     $form[$group][USERPOINTS_NODEVOTE] = array(
       '#type' => 'textfield',
-      '#title' => t('%Points for voting on a node (requires nodevote module)', userpoints_translation()),
+      '#title' => t('!Points for voting on a node (requires nodevote module)', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_NODEVOTE, 0),
       '#size' => 5,
       '#maxlength' => 5,
     );
   }
 
-  if (module_exist('referral')) {
+  if (module_exists('referral')) {
     $form[$group][USERPOINTS_REFERRAL] = array(
       '#type' => 'textfield',
-      '#title' => t('%Points for referring a user (requires the referral module)', userpoints_translation()),
+      '#title' => t('!Points for referring a user (requires the referral module)', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_REFERRAL, 0),
       '#size' => 5,
       '#maxlength' => 5,
     );
   }
 
-  if (module_exist('invite')) {
+  if (module_exists('invite')) {
     $form[$group][USERPOINTS_INVITE_INVITE] = array(
       '#type' => 'textfield',
-      '#title' => t('%Points for inviting a user (requires the invite module)', userpoints_translation()),
+      '#title' => t('!Points for inviting a user (requires the invite module)', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_INVITE_INVITE, 0),
       '#size' => 5,
       '#maxlength' => 5,
     );
   }
 
-  if (module_exist('invite')) {
+  if (module_exists('invite')) {
     $form[$group][USERPOINTS_INVITE_REGISTER] = array(
       '#type' => 'textfield',
-      '#title' => t('%Points when invited user registers (requires the invite module)', userpoints_translation()),
+      '#title' => t('!Points when invited user registers (requires the invite module)', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_INVITE_REGISTER, 0),
       '#size' => 5,
       '#maxlength' => 5,
     );
   }
 
-  if (module_exist('cart') && module_exist('payment')) {
+  if (module_exists('cart') && module_exists('payment')) {
     $group = 'ecommerce';
     $form[$group] = array(
       '#type' => 'fieldset',
@@ -153,7 +160,7 @@
 
     $form[$group][USERPOINTS_EC_EARN] = array(
       '#type' => 'textfield',
-      '#title' => t('%Points awarded for buying (multiplied by price)', userpoints_translation()),
+      '#title' => t('!Points awarded for buying (multiplied by price)', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_EC_EARN, 0),
       '#size' => 5,
       '#maxlength' => 5,
@@ -161,7 +168,7 @@
 
     $form[$group][USERPOINTS_MIN_PURCHASE] = array(
       '#type' => 'textfield',
-      '#title' => t('Smallest purchase for which %points are awarded', userpoints_translation()),
+      '#title' => t('Smallest purchase for which !points are awarded', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_MIN_PURCHASE, '0.00'),
       '#size' => 5,
       '#maxlength' => 5,
@@ -169,14 +176,14 @@
 
     $form[$group][USERPOINTS_EC_PAYMENT] = array(
       '#type' => 'radios',
-      '#title' => t('Accept user %points as payment?', userpoints_translation()),
+      '#title' => t('Accept user !points as payment?', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_EC_PAYMENT, 0),
       '#options' => array(t('Disable'), t('Enable')),
     );
 
     $form[$group][USERPOINTS_EC_SPEND] = array(
       '#type' => 'textfield',
-      '#title' => t('%Points used in payment (for every dollar)', userpoints_translation()),
+      '#title' => t('!Points used in payment (for every dollar)', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_EC_SPEND, 1),
       '#size' => 5,
       '#maxlength' => 5,
@@ -184,7 +191,7 @@
     
     $form[$group][USERPOINTS_MIN_SPEND] = array(
       '#type' => 'textfield',
-      '#title' => t('Number of %points that must be spent per purchase', userpoints_translation()),
+      '#title' => t('Number of !points that must be spent per purchase', userpoints_translation()),
       '#default_value' => variable_get(USERPOINTS_MIN_SPEND, 0),
       '#size' => 5,
       '#maxlength' => 5,
@@ -201,7 +208,7 @@
   
   $form[$group][USERPOINTS_TRANS_UCPOINTS] = array(
   '#type' => 'textfield',
-  '#title' => t('Word to use in the interface for the upper case plural word %Points', userpoints_translation()),
+  '#title' => t('Word to use in the interface for the upper case plural word !Points', userpoints_translation()),
   '#default_value' => variable_get(USERPOINTS_TRANS_UCPOINTS, 'Points'),
   '#size' => 20,
   '#maxlength' => 20,
@@ -209,7 +216,7 @@
   
   $form[$group][USERPOINTS_TRANS_LCPOINTS] = array(
   '#type' => 'textfield',
-  '#title' => t('Word to use in the interface for the lower case plural word %points', userpoints_translation()),
+  '#title' => t('Word to use in the interface for the lower case plural word !points', userpoints_translation()),
   '#default_value' => variable_get(USERPOINTS_TRANS_LCPOINTS, 'points'),
   '#size' => 20,
   '#maxlength' => 20,
@@ -217,14 +224,14 @@
   
   $form[$group][USERPOINTS_TRANS_LCPOINT] = array(
   '#type' => 'textfield',
-  '#title' => t('Word to use in the interface for the lower case singular word %point', userpoints_translation()),
+  '#title' => t('Word to use in the interface for the lower case singular word !point', userpoints_translation()),
   '#default_value' => variable_get(USERPOINTS_TRANS_LCPOINT, 'point'),
   '#size' => 20,
   '#maxlength' => 20,
   );
 
 
-  return $form;
+  return system_settings_form($form);
 }  
 
 function userpoints_user($op, &$edit, &$user, $category = '') {
@@ -236,10 +243,10 @@
     case 'view':
       $points = (int) db_result(db_query('SELECT points FROM {userpoints} WHERE uid = %d', $user->uid));
       $disp_points[] = array(
-        'title' => t('User %points', userpoints_translation()),
+        'title' => t('User !points', userpoints_translation()),
         'value' => $points,
         );
-      return array(t('%Points', userpoints_translation()) => $disp_points);
+      return array(t('!Points', userpoints_translation()) => $disp_points);
       break;
   }
 }
@@ -251,7 +258,7 @@
   $sql_cnt = "SELECT COUNT(DISTINCT(uid)) FROM {userpoints}";
   $header = array(
     array('data' => t('User'), 'field' => 'u.name'),
-    array('data' => t('%Points', userpoints_translation()), 'field' => 'p.points', 'sort' => 'desc'),
+    array('data' => t('!Points', userpoints_translation()), 'field' => 'p.points', 'sort' => 'desc'),
   );
   $sql .= tablesort_sql($header);
   $result = pager_query($sql, 30, 0, $sql_cnt);
@@ -275,7 +282,7 @@
   $num = 5;
 
   $block_title = array();
-  $block_title[] = t('%user\'s %points', array_merge(array('%user' => $user->name), userpoints_translation()));
+  $block_title[] = t('%user\'s !points', array_merge(array('%user' => $user->name), userpoints_translation()));
   $block_title[] = t('Highest Users');
 
   switch ($op) {
@@ -291,12 +298,12 @@
             $title = $block_title[$delta];
             if ($user->uid) {
               $points = (int) db_result(db_query('SELECT points FROM {userpoints} WHERE uid = %d', $user->uid));
-              $singular = t('%point', userpoints_translation());
-              $plural = t('%points', userpoints_translation());
-              $content = t('You have %p %c', array('%p' => $points, '%c' => format_plural($points, $singular, $plural)));
+              $singular = t('!point', userpoints_translation());
+              $plural = t('!points', userpoints_translation());
+              $content = t('You have %p @c', array('%p' => $points, '@c' => format_plural($points, $singular, $plural)));
             }
             else {
-              $content = t('%Points are visible to logged in users only',userpoints_translation());
+              $content = t('!Points are visible to logged in users only',userpoints_translation());
             }
             break;
 
@@ -312,9 +319,9 @@
                   array('data' => theme('username', $data)),
                   array('data' => $data->points, 'align' => 'right'));
             }
-            $header = array(t('User'), t('%Points', userpoints_translation()));
+            $header = array(t('User'), t('!Points', userpoints_translation()));
             $content = theme('table', $header, $rows);
-            $content .= '<div class="more-link">'. l(t('more'), 'userpoints', array('title' => t('All users by %points', userpoints_translation()))) .'</div>';
+            $content .= '<div class="more-link">'. l(t('more'), 'userpoints', array('title' => t('All users by !points', userpoints_translation()))) .'</div>';
             break;
         }
 
@@ -435,12 +442,16 @@
 
   $points = (int)$new_points + (int)userpoints_get_current_points($uid);
 
-  drupal_set_message(t('User %uname %op %pointsvalue %points! Total now is %total points.',
+  $singular = t('!point', userpoints_translation());
+  $plural = t('!points', userpoints_translation());
+  drupal_set_message(t('User %uname %op !pointsvalue @points! Total now is %total @tpoints.',
     array_merge(userpoints_translation(), array(
+      '@points' => format_plural(abs($new_points), $singular, $plural),
       '%uname'  => $user->name,
       '%op'     => $msg,
-      '%pointsvalue' => abs($new_points),
-      '%total'  => $points)
+      '!pointsvalue' => abs($new_points),
+      '%total'  => $points,
+      '@tpoints' => format_plural($points, $singular, $plural))
       )));
 
   if (_userpoints_user_exists($uid)) {
@@ -509,21 +520,21 @@
 
   switch ($op) {
     case 'display name':
-      return t('User %Points', userpoints_translation());
+      return t('User !Points', userpoints_translation());
 
     case 'on checkout':
       $gross = store_transaction_calc_gross($txn);
       $points = ($gross * $multiplier);
 
       if ($points < $min) {
-        form_set_error('gross', t('You must spend at least %min %points', array_merge(array('%min' => $min),userpoints_translation())));
+        form_set_error('gross', t('You must spend at least %min !points', array_merge(array('%min' => $min),userpoints_translation())));
       }
 
       $balance = userpoints_get_current_points($uid);
       if ($balance < $points) {
-        form_set_error('gross', t('You do not have enough %points for this purchase', userpoints_translation()));
+        form_set_error('gross', t('You do not have enough !points for this purchase', userpoints_translation()));
       }
-      drupal_set_message(t('This purchase will cost you %point_value %points', array_merge(array('%point_value' => $points), userpoints_translation())));
+      drupal_set_message(t('This purchase will cost you !point_value !points', array_merge(array('!point_value' => $points), userpoints_translation())));
       break;
 
     case 'payment page':
@@ -564,7 +575,7 @@
             store_send_invoice_email($txnid);
           }
 
-          drupal_set_message(t('Your purchase using %pointsvalue %points has been completed', array_merge(array('%pointsvalue' => $points), userpoints_translation())));
+          drupal_set_message(t('Your purchase using !pointsvalue !points has been completed', array_merge(array('!pointsvalue' => $points), userpoints_translation())));
         }
       }
       break;
Index: modules/userpoints/contrib/userpoints_reset.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/contrib/userpoints_reset.module,v
retrieving revision 1.2
diff -u -r1.2 userpoints_reset.module
--- modules/userpoints/contrib/userpoints_reset.module	18 Sep 2006 02:42:50 -0000	1.2
+++ modules/userpoints/contrib/userpoints_reset.module	20 Nov 2006 16:28:20 -0000
@@ -5,8 +5,7 @@
 
 function userpoints_reset_help($section) {
   switch ($section) {
-    case 'admin/modules#description':
-    case 'admin/settings/userpoints_reset':
+    case 'admin/settings/userpoints/reset':
       $output = t('Reset userpoints');
       break;
   }
@@ -17,9 +16,9 @@
   $items = array();
 
   $items[] = array(
-    'path'     => 'userpoints_reset',
+    'path'     => 'admin/settings/userpoints/reset',
     'callback' => 'userpoints_reset_page',
-    'title'    => t('userpoints reset'),
+    'title'    => t('Reset'),
     'access'   => user_access(USERPOINTS_PERM_RESET),
     'type'     => MENU_NORMAL_ITEM);
 
@@ -31,6 +30,12 @@
 }
 
 function userpoints_reset_page() {
+  return drupal_get_form('userpoints_reset', $form);
+}
+
+function userpoints_reset() {
+  $form = array();
+
   $form['confirm'] = array(
     '#type' => 'textfield',
     '#title' => t('Reset all userpoints. This is useful in certain situations such as monthly contests. Enter YES to reset'),
@@ -42,14 +47,13 @@
     '#type' => 'submit',
     '#value' => t('Reset'));
 
-  return drupal_get_form('userpoints_reset', $form);
+  return $form;
 }
-
 function userpoints_reset_submit($form_id, $edit) {
   if ($edit['confirm'] == t('YES')) {
     userpoints_reset_do();
     drupal_set_message(t('All userpoints have been reset!'));
-    drupal_goto();
+    drupal_goto('admin/settings/userpoints');
   }
 }
 
Index: modules/userpoints/contrib/userpoints_retroactive.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/userpoints/contrib/userpoints_retroactive.module,v
retrieving revision 1.3
diff -u -r1.3 userpoints_retroactive.module
--- modules/userpoints/contrib/userpoints_retroactive.module	18 Sep 2006 03:05:14 -0000	1.3
+++ modules/userpoints/contrib/userpoints_retroactive.module	20 Nov 2006 16:32:46 -0000
@@ -5,9 +5,8 @@
 
 function userpoints_retroactive_help($section) {
   switch ($section) {
-    case 'admin/modules#description':
-    case 'admin/settings/userpoints_retroactive':
-      $output = t('Calculate userpoints for nodes and comments created in the past');
+    case 'admin/settings/userpoints/retroactive':
+      $output = t('Calculate userpoints for nodes and comments created in the past.');
       break;
   }
   return $output;
@@ -17,9 +16,9 @@
   $items = array();
 
   $items[] = array(
-    'path'     => 'userpoints_retroactive',
+    'path'     => 'admin/settings/userpoints/retroactive',
     'callback' => 'userpoints_retroactive_page',
-    'title'    => t('userpoints retroactive'),
+    'title'    => t('Retroactive'),
     'access'   => user_access(USERPOINTS_PERM_ADMIN),
     'type'     => MENU_NORMAL_ITEM);
 
@@ -27,9 +26,15 @@
 }
 
 function userpoints_retroactive_page() {
+  return drupal_get_form('userpoints_retroactive', $form);
+}
+
+function userpoints_retroactive() {
+  $form = array();
+
   $form['confirm'] = array(
     '#type' => 'textfield',
-    '#title' => t('Give users points for nodes and comments they created in the past. Enter YES to reset.'),
+    '#title' => t('Give users points for nodes and comments they created in the past. Enter YES to reset'),
     '#size' => 3,
     '#maxlength' => 3,
     '#default_value' => t('NO'));
@@ -38,14 +43,13 @@
     '#type' => 'submit',
     '#value' => t('Submit'));
 
-  return drupal_get_form('userpoints_retroactive', $form);
+  return $form;
 }
 
 function userpoints_retroactive_submit($form_id, $edit) {
   if ($edit['confirm'] == t('YES')) {
     userpoints_retroactive_do();
     drupal_set_message(t('Points awarded for past nodes and comments.'));
-    drupal_goto();
   }
 }
 
@@ -54,7 +58,7 @@
   userpoints_retroactive_nodes();
   userpoints_retroactive_comments();
   drupal_set_message(t('User points updated with node and comment values'));
-  drupal_goto();
+  drupal_goto('admin/settings/userpoints');
 }
 
 function userpoints_retroactive_initalize() {
@@ -79,4 +83,3 @@
 		db_query('UPDATE {userpoints} SET points = points + %d WHERE uid = %d', ($comment->val * $weight), $comment->uid);
 	}
 }
-
