Index: modules/user/views_plugin_argument_validate_user.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/user/views_plugin_argument_validate_user.inc,v
retrieving revision 1.1
diff -u -p -r1.1 views_plugin_argument_validate_user.inc
--- modules/user/views_plugin_argument_validate_user.inc	6 Feb 2009 21:13:04 -0000	1.1
+++ modules/user/views_plugin_argument_validate_user.inc	16 Feb 2009 19:51:57 -0000
@@ -10,7 +10,14 @@
  */
 class views_plugin_argument_validate_user extends views_plugin_argument_validate {
   function validate_form(&$form, &$form_state) {
-    $form['user_argument_type'] = array(
+    // We are unable to rely on options having already been set, so let's make
+    // sure defaults are here:
+    if (!isset($this->argument->options['validate_user_argument_type'])) {
+      $this->argument->options['validate_user_argument_type'] = 'uid';
+      $this->argument->options['validate_user_roles'] = array();
+    }
+
+    $form['validate_user_argument_type'] = array(
       '#type' => 'radios',
       '#title' => t('Type of user argument to allow'),
       '#options' => array(
@@ -18,31 +25,40 @@ class views_plugin_argument_validate_use
         'name' => t('Only allow string usernames'),
         'either' => t('Allow both numeric UIDs and string usernames'),
       ),
-      '#default_value' => $this->argument->options['user_argument_type'],
+      '#default_value' => $this->argument->options['validate_user_argument_type'],
+      '#process' => array('expand_radios', 'views_process_dependency'),
+      '#dependency' => array('edit-options-validate-type' => array($this->id)),
+      '#prefix' => '<div id="edit-options-validate-user-argument-type-wrapper">',
+      '#suffix' => '</div>',
     );
 
-    $form['restrict_user_roles'] = array(
+    $form['validate_user_restrict_roles'] = array(
       '#type' => 'checkbox',
       '#title' => t('Restrict user based on role'),
-      '#default_value' => !empty($this->argument->options['restrict_user_roles']),
+      '#default_value' => !empty($this->argument->options['validate_user_restrict_roles']),
+      '#process' => array('views_process_dependency'),
+      '#dependency' => array('edit-options-validate-type' => array($this->id)),
     );
 
-    $form['user_roles'] = array(
-      '#type' => 'select',
-      '#multiple' => TRUE,
+    $form['validate_user_roles'] = array(
+      '#type' => 'checkboxes',
+      '#prefix' => '<div id="edit-options-validate-user-roles-wrapper">',
+      '#suffix' => '</div>',
       '#title' => t('Restrict to the selected roles'),
       '#options' => user_roles(TRUE),
-      '#default_value' => $this->argument->options['user_roles'],
+      '#default_value' => $this->argument->options['validate_user_roles'],
       '#description' => t('If no roles are selected, users from any role will be allowed.'),
-      '#process' => array('views_process_dependency'),
+      '#process' => array('expand_checkboxes', 'views_process_dependency'),
       '#dependency' => array(
-        'edit-options-restrict-user-roles' => array(1),
+        'edit-options-validate-type' => array($this->id),
+        'edit-options-validate-user-restrict-roles' => array(1),
       ),
+      '#dependency_count' => 2,
     );
   }
-  
+
   function validate_argument($argument) {
-    $type = $this->argument->options['user_argument_type'];
+    $type = $this->argument->options['validate_user_argument_type'];
     // is_numeric() can return false positives, so we ensure it's an integer.
     // However, is_integer() will always fail, since $argument is a string.
     if (is_numeric($argument) && $argument == (int)$argument) {
@@ -69,8 +85,8 @@ class views_plugin_argument_validate_use
     }
 
     // See if we're filtering users based on roles.
-    if (!empty($this->argument->options['restrict_user_roles']) && !empty($this->argument->options['user_roles'])) {
-      $roles = $this->argument->options['user_roles'];
+    if (!empty($this->argument->options['validate_user_restrict_roles']) && !empty($this->argument->options['validate_user_roles'])) {
+      $roles = $this->argument->options['validate_user_roles'];
       $acccont->roles = array();
       $account->roles[] = $account->uid ? DRUPAL_AUTHENTICATED_RID : DRUPAL_ANONYMOUS_RID;
       $result = db_query('SELECT rid FROM {users_roles} WHERE uid = %d', $account->uid);
