Index: handlers/views_handler_argument.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/handlers/views_handler_argument.inc,v
retrieving revision 1.9.4.4
diff -u -p -r1.9.4.4 views_handler_argument.inc
--- handlers/views_handler_argument.inc	24 Jan 2010 22:37:52 -0000	1.9.4.4
+++ handlers/views_handler_argument.inc	28 Jan 2010 20:45:18 -0000
@@ -96,15 +96,16 @@ class views_handler_argument extends vie
     $options = parent::option_definition();
 
     $options['default_action'] = array('default' => 'ignore');
-    $options['style_plugin'] = array('default' => 'default_summary');
-    $options['style_options'] = array('default' => array());
+    $options['style_plugin'] = array('default' => 'default_summary', 'export' => 'export_style');
+    $options['style_options'] = array('default' => array(), 'export' => FALSE);
     $options['wildcard'] = array('default' => 'all');
     $options['wildcard_substitution'] = array('default' => t('All'), 'translatable' => TRUE);
     $options['title'] = array('default' => '', 'translatable' => TRUE);
     $options['breadcrumb'] = array('default' => '', 'translatable' => TRUE);
-    $options['default_argument_type'] = array('default' => 'fixed');
-    $options['default_argument'] = array('default' => '');
-    $options['validate_type'] = array('default' => 'none');
+    $options['default_argument_type'] = array('default' => 'fixed', 'export' => 'export_plugin');
+    $options['default_argument_options'] = array('default' => array(), 'export' => FALSE);
+    $options['validate_type'] = array('default' => 'none', 'export' => 'export_plugin');
+    $options['validate_options'] = array('default' => array(), 'export' => FALSE);
     $options['validate_fail'] = array('default' => 'not found');
 
     return $options;
@@ -220,11 +221,18 @@ class views_handler_argument extends vie
 
       // If we decide this validator is ok, add it to the list.
       if ($valid) {
-        $plugin = views_get_plugin('argument validator', $id);
+        $plugin = $this->get_plugin('argument validator', $id);
         if ($plugin) {
-          $plugin->init($this->view, $this, $id);
           if ($plugin->access() || $this->options['validate_type'] == $id) {
-            $plugin->validate_form($form, $form_state, $id);
+            $form['argument_validate'][$id] = array(
+              '#type' => 'item',
+              '#input' => TRUE, // trick it into checking input to make #process run
+              '#process' => array('views_process_dependency'),
+              '#dependency' => array(
+                'edit-options-validate-type' => array($id)
+              ),
+            );
+            $plugin->options_form($form['argument_validate'][$id], $form_state);
             $validate_types[$id] = $info['title'];
           }
         }
@@ -246,6 +254,51 @@ class views_handler_argument extends vie
     );
   }
 
+  function options_validate(&$form, &$form_state) {
+    if (empty($form_state['values']['options'])) {
+      return;
+    }
+
+    // Let the plugins do validation.
+    $default_id = $form_state['values']['options']['default_argument_type'];
+    $plugin = $this->get_plugin('argument default', $default_id);
+    if ($plugin) {
+      $plugin->options_validate($form['argument_default'][$default_id], $form_state, $form_state['values']['options']['argument_default'][$default_id]);
+    }
+
+    $validate_id = $form_state['values']['options']['validate_type'];
+    $plugin = $this->get_plugin('argument validator', $validate_id);
+    if ($plugin) {
+      $plugin->options_validate($form['argument_validate'][$default_id], $form_state, $form_state['values']['options']['argument_validate'][$validate_id]);
+    }
+
+  }
+
+  function options_submit(&$form, &$form_state) {
+    if (empty($form_state['values']['options'])) {
+      return;
+    }
+
+    // Let the plugins make submit modifications if necessary.
+    $default_id = $form_state['values']['options']['default_argument_type'];
+    $plugin = $this->get_plugin('argument default', $default_id);
+    if ($plugin) {
+      $options = &$form_state['values']['options']['argument_default'][$default_id];
+      $plugin->options_submit($form['argument_default'][$default_id], $form_state, $options);
+      // Copy the now submitted options to their final resting place so they get saved.
+      $form_state['values']['options']['default_argument_options'] = $options;
+    }
+
+    $validate_id = $form_state['values']['options']['validate_type'];
+    $plugin = $this->get_plugin('argument validator', $validate_id);
+    if ($plugin) {
+      $options = &$form_state['values']['options']['argument_default'][$validate_id];
+      $plugin->options_submit($form['argument_validate'][$default_id], $form_state, $options);
+      // Copy the now submitted options to their final resting place so they get saved.
+      $form_state['values']['options']['validate_options'] = $options;
+    }
+  }
+
   /**
    * Provide a list of default behaviors for this argument if the argument
    * is not present.
@@ -343,18 +396,27 @@ class views_handler_argument extends vie
       '#id' => 'edit-options-default-argument-type',
       '#title' => t('Default argument type'),
       '#default_value' => $this->options['default_argument_type'],
-      '#process' => array('form_process_radios', 'views_process_dependency'),
-      '#dependency' => array('radio:options[default_action]' => array('default')),
     );
 
     foreach ($plugins as $id => $info) {
-      $plugin = views_get_plugin('argument default', $id);
+      if (!empty($info['no ui'])) {
+        continue;
+      }
+      $plugin = $this->get_plugin('argument default', $id);
       if ($plugin) {
-        $plugin->init($this->view, $this, $id);
-
         if ($plugin->access() || $this->options['default_argument_type'] == $id) {
+          $form['argument_default'][$id] = array(
+            '#type' => 'item',
+            '#input' => TRUE, // trick it into checking input to make #process run
+            '#process' => array('views_process_dependency'),
+            '#dependency' => array(
+              'radio:options[default_action]' => array('default'),
+              'radio:options[default_argument_type]' => array($id)
+            ),
+            '#dependency_count' => 2,
+          );
           $options[$id] = $info['title'];
-          $plugin->argument_form($form, $form_state);
+          $plugin->options_form($form['argument_default'][$id], $form_state);
         }
       }
     }
@@ -456,9 +518,8 @@ class views_handler_argument extends vie
    * Get a default argument, if available.
    */
   function get_default_argument() {
-    $plugin = views_get_plugin('argument default', $this->options['default_argument_type']);
+    $plugin = $this->get_plugin('argument default');
     if ($plugin) {
-      $plugin->init($this->view, $this);
       return $plugin->get_argument();
     }
   }
@@ -654,9 +715,8 @@ class views_handler_argument extends vie
       return $this->argument_validated = $this->validate_argument_basic($arg);
     }
 
-    $plugin = views_get_plugin('argument validator', $this->options['validate_type']);
+    $plugin = $this->get_plugin('argument validator');
     if ($plugin) {
-      $plugin->init($this->view, $this, $this->options['validate_type']);
       return $this->argument_validated = $plugin->validate_argument($arg);
     }
 
@@ -754,6 +814,92 @@ class views_handler_argument extends vie
     unset($argument);
     return $value;
   }
+
+  /**
+   * Special handling for the style export.
+   *
+   * Arguments can have styles for the summary view. This special export
+   * handler makes sure this works properly.
+   */
+  function export_style($indent, $prefix, $storage, $option, $definition, $parents) {
+    $output = '';
+    $name = $storage[$option];
+    $options = $storage['style_options'];
+
+    $plugin = views_get_plugin('style', $name);
+    if ($plugin) {
+      $plugin->init($this->view, $this->display, $options);
+      // Write which plugin to use.
+      $output .= $indent . $prefix . "['$option'] = '$name';\n";
+
+      // Pass off to the plugin to export itself.
+      $output .= $plugin->export_options($indent, $prefix . "['style_options']");
+    }
+
+    return $output;
+  }
+
+  /**
+   * Special handling for the style export.
+   *
+   * Arguments can have styles for the summary view. This special export
+   * handler makes sure this works properly.
+   */
+  function export_plugin($indent, $prefix, $storage, $option, $definition, $parents) {
+    $output = '';
+    if ($option == 'default_argument_type') {
+      $type = 'argument default';
+      $option_name = 'default_argument_options';
+    }
+    else {
+      $type = 'argument validator';
+      $option_name = 'validate_options';
+    }
+    $plugin = $this->get_plugin($type);
+    $name = $this->options[$option];
+
+    if ($plugin) {
+      // Write which plugin to use.
+      $output .= $indent . $prefix . "['$option'] = '$name';\n";
+
+      // Pass off to the plugin to export itself.
+      $output .= $plugin->export_options($indent, $prefix . "['$option_name']");
+    }
+
+    return $output;
+  }
+
+  /**
+   * Get the display or row plugin, if it exists.
+   */
+  function get_plugin($type = 'argument default', $name = NULL) {
+    $options = array();
+    switch ($type) {
+      case 'argument default':
+        $plugin_name = 'default_argument_type';
+        $options_name = 'default_argument_options';
+        break;
+      case 'argument validator':
+        $plugin_name = 'validate_type';
+        $options_name = 'validate_options';
+    }
+
+    if (!$name) {
+      $name = $this->options[$plugin_name];
+    }
+
+    // we only fetch the options if we're fetching the plugin actually
+    // in use.
+    if ($name == $this->options[$plugin_name]) {
+      $options = $this->options[$options_name];
+    }
+
+    $plugin = views_get_plugin($type, $name);
+    if ($plugin) {
+      $plugin->init($this->view, $this, $options);
+      return $plugin;
+    }
+  }
 }
 
 /**
Index: includes/admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/admin.inc,v
retrieving revision 1.161.4.13
diff -u -p -r1.161.4.13 admin.inc
--- includes/admin.inc	28 Jan 2010 17:16:40 -0000	1.161.4.13
+++ includes/admin.inc	28 Jan 2010 20:45:18 -0000
@@ -2405,17 +2405,19 @@ function views_ui_config_item_form_submi
   $form_state['handler']->options_submit($form['options'], $form_state);
   $item = $form_state['handler']->options;
 
-  // Unset a button
-  unset($form_state['values']['options']['expose_button']);
-
-  // Store the data we're given.
-  foreach ($form_state['values']['options'] as $key => $value) {
-    $item[$key] = $value;
-  }
-
+  // Create a new handler and unpack the options from the form onto it. We
+  // can use that for storage.
+  $handler = views_get_handler($item['table'], $item['field'], $form_state['type']);
+  
+  // This unpacks only options that are in the definition, ensuring random
+  // extra stuff on the form is not sent through.
+  $handler->unpack_options($handler->options, $form_state['values']['options'], NULL, FALSE);
+  $handler->options['id'] = $item['id'];
+  $handler->options['table'] = $item['table'];
+  $handler->options['field'] = $item['field'];
+  
   // Store the item back on the view
-  $form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $item);
-
+  $form_state['view']->set_item($form_state['display_id'], $form_state['type'], $form_state['id'], $handler->options);
   if ($form_state['handler'] && $form_state['handler']->needs_style_plugin()) {
     views_ui_add_form_to_stack('change-style', $form_state['view'], $form_state['display_id'], array($form_state['type'], $form_state['id']), TRUE);
   }
Index: includes/base.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/base.inc,v
retrieving revision 1.3.4.1
diff -u -p -r1.3.4.1 base.inc
--- includes/base.inc	2 Nov 2009 22:01:26 -0000	1.3.4.1
+++ includes/base.inc	28 Jan 2010 20:45:18 -0000
@@ -76,7 +76,7 @@ class views_object {
    * Unpack options over our existing defaults, drilling down into arrays
    * so that defaults don't get totally blown away.
    */
-  function unpack_options(&$storage, $options, $definition = NULL) {
+  function unpack_options(&$storage, $options, $definition = NULL, $all = TRUE) {
     if (!is_array($options)) {
       return;
     }
@@ -91,12 +91,20 @@ class views_object {
           $storage[$key] = array();
         }
 
-        $this->unpack_options($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array());
+        // If we're just unpacking our known options, and we're dropping an
+        // unknown array (as might happen for a dependent plugin fields) go
+        // ahead and drop that in.
+        if (!$all && isset($definition[$key]) && !isset($definition[$key]['contains'])) {
+          $storage[$key] = $value;
+          continue;
+        }
+
+        $this->unpack_options($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array(), $all);
       }
       elseif (!empty($definition[$key]['translatable']) && !empty($value)) {
         $storage[$key] = t($value);
       }
-      else {
+      else if ($all || !empty($definition[$key])) {
         $storage[$key] = $value;
       }
     }
@@ -125,4 +133,63 @@ class views_object {
       unset($this->query);
     }
   }
+
+  function export_options($indent, $prefix) {
+    $output = '';
+    foreach ($this->option_definition() as $option => $definition) {
+      $output .= $this->export_option($indent, $prefix, $this->options, $option, $definition, array());
+    }
+
+    return $output;
+  }
+
+  function export_option($indent, $prefix, $storage, $option, $definition, $parents) {
+    // Do not export options for which we have no settings.
+    if (!isset($storage[$option])) {
+      return;
+    }
+
+    if (isset($definition['export'])) {
+      if ($definition['export'] === FALSE) {
+        return;
+      }
+
+      // Special handling for some items
+      if (method_exists($this, $definition['export'])) {
+        return $this->{$definition['export']}($indent, $prefix, $storage, $option, $definition, $parents);
+      }
+    }
+
+    // Add the current option to the parents tree.
+    $parents[] = $option;
+    $output = '';
+
+    // If it has child items, export those separately.
+    if (isset($definition['contains'])) {
+      foreach ($definition['contains'] as $sub_option => $sub_definition) {
+        $output .= $this->export_option($indent, $prefix, $storage[$option], $sub_option, $sub_definition, $parents);
+      }
+    }
+    // Otherwise export just this item.
+    else {
+      $default = isset($definition['default']) ? $definition['default'] : NULL;
+      $value = $storage[$option];
+      if (isset($definition['bool'])) {
+        $value = (bool) $value;
+      }
+
+      if ($value !== $default) {
+        $output .= $indent . $prefix . "['" . implode("']['", $parents) . "'] = ";
+        if (isset($definition['bool'])) {
+          $output .= empty($storage[$option]) ? 'FALSE' : 'TRUE';
+        }
+        else {
+          $output .= views_var_export($storage[$option], $indent);
+        }
+
+        $output .= ";\n";
+      }
+    }
+    return $output;
+  }
 }
Index: includes/handlers.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/handlers.inc,v
retrieving revision 1.119.4.3
diff -u -p -r1.119.4.3 handlers.inc
--- includes/handlers.inc	24 Jan 2010 22:37:52 -0000	1.119.4.3
+++ includes/handlers.inc	28 Jan 2010 20:45:18 -0000
@@ -208,6 +208,10 @@ class views_handler extends views_object
   function option_definition() {
     $options = parent::option_definition();
 
+    $options['id'] = array('default' => '');
+    $options['table'] = array('default' => '');
+    $options['field'] = array('default' => '');
+    $options['relationship'] = array('default' => 'none');
     $options['group_type'] = array('default' => 'group');
 
     return $options;
Index: includes/plugins.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/plugins.inc,v
retrieving revision 1.156.4.3
diff -u -p -r1.156.4.3 plugins.inc
--- includes/plugins.inc	26 Dec 2009 19:50:12 -0000	1.156.4.3
+++ includes/plugins.inc	28 Jan 2010 20:45:18 -0000
@@ -160,9 +160,14 @@ function views_views_plugins() {
       ),
     ),
     'argument default' => array(
+      'parent' => array(
+        'no ui' => TRUE,
+        'handler' => 'views_plugin_argument_default',
+        'parent' => '',
+      ),
       'fixed' => array(
         'title' => t('Fixed entry'),
-        'handler' => 'views_plugin_argument_default',
+        'handler' => 'views_plugin_argument_default_fixed',
       ),
       'php' => array(
         'title' => t('PHP Code'),
Index: includes/view.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/includes/view.inc,v
retrieving revision 1.167.4.6
diff -u -p -r1.167.4.6 view.inc
--- includes/view.inc	24 Jan 2010 22:37:52 -0000	1.167.4.6
+++ includes/view.inc	28 Jan 2010 20:45:18 -0000
@@ -597,7 +597,7 @@ class view extends views_db_object {
     $this->_pre_query();
 
     if ($this->display_handler->uses_exposed()) {
-      $exposed_form = $this->display_handler->get_exposed_form_plugin();
+      $exposed_form = $this->display_handler->get_plugin('exposed_form');
       $this->exposed_widgets = $exposed_form->render_exposed_form();
       if (form_set_error() || !empty($this->build_info['abort'])) {
         $this->built = TRUE;
@@ -720,7 +720,7 @@ class view extends views_db_object {
       $cache = FALSE;
     }
     else {
-      $cache = $this->display_handler->get_cache_plugin();
+      $cache = $this->display_handler->get_plugin('cache');
     }
     if ($cache && $cache->cache_get('results')) {
       debug('Used cached results');
@@ -753,7 +753,7 @@ class view extends views_db_object {
       $this->start_query_capture();
     }
 
-    $exposed_form = $this->display_handler->get_exposed_form_plugin();
+    $exposed_form = $this->display_handler->get_plugin('exposed_form');
     $exposed_form->pre_render();
 
     // Check for already-cached output.
@@ -761,7 +761,7 @@ class view extends views_db_object {
       $cache = FALSE;
     }
     else {
-      $cache = $this->display_handler->get_cache_plugin();
+      $cache = $this->display_handler->get_plugin('cache');
     }
     if ($cache && $cache->cache_get('output')) {
       debug('Used cached output');
@@ -1412,6 +1412,7 @@ class view extends views_db_object {
     $output .= $indent . '$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */' . "\n";
 
     foreach ($this->display as $id => $display) {
+      $output .= $indent . "\n/* Display: $display->display_title */\n";
       $output .= $indent . '$handler = $view->new_display(' . views_var_export($display->display_plugin, $indent) . ', ' . views_var_export($display->display_title, $indent) . ', \'' . $id . "');\n";
       if (empty($display->handler)) {
         // @todo -- probably need a method of exporting broken displays as
@@ -1420,28 +1421,7 @@ class view extends views_db_object {
         continue;
       }
 
-      foreach ($display->handler->option_definition() as $option => $definition) {
-        // Special handling for some items
-        switch ($option) {
-          case 'defaults':
-            // skip these
-            break;
-          default:
-            if (!$display->handler->is_defaulted($option)) {
-              $value = $display->handler->get_option($option);
-              if ($id == 'default') {
-                $default = isset($definition['default']) ? $definition['default'] : NULL;
-              }
-              else {
-                $default = $this->display['default']->handler->get_option($option);
-              }
-
-              if ($value !== $default) {
-                $output .= $indent . '$handler->override_option(\'' . $option . '\', ' . views_var_export($value, $indent) . ");\n";
-              }
-            }
-        }
-      }
+      $output .= $display->handler->export_options($indent, '$handler->options');
     }
 
     return $output;
Index: modules/node/views_plugin_argument_default_node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/node/views_plugin_argument_default_node.inc,v
retrieving revision 1.1
diff -u -p -r1.1 views_plugin_argument_default_node.inc
--- modules/node/views_plugin_argument_default_node.inc	3 Sep 2008 19:21:29 -0000	1.1
+++ modules/node/views_plugin_argument_default_node.inc	28 Jan 2010 20:45:18 -0000
@@ -7,11 +7,10 @@
 
 /**
  * Default argument plugin to extract a node via menu_get_object
+ *
+ * This plugin actually has no options so it odes not need to do a great deal.
  */
 class views_plugin_argument_default_node extends views_plugin_argument_default {
-  function argument_form(&$form, &$form_state) {
-  }
-
   function get_argument() {
     foreach (range(1, 3) as $i) {
       $node = menu_get_object('node', $i);
Index: modules/node/views_plugin_argument_validate_node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/node/views_plugin_argument_validate_node.inc,v
retrieving revision 1.2.4.1
diff -u -p -r1.2.4.1 views_plugin_argument_validate_node.inc
--- modules/node/views_plugin_argument_validate_node.inc	2 Nov 2009 22:01:26 -0000	1.2.4.1
+++ modules/node/views_plugin_argument_validate_node.inc	28 Jan 2010 20:45:18 -0000
@@ -9,58 +9,63 @@
  * Validate whether an argument is an acceptable node.
  */
 class views_plugin_argument_validate_node extends views_plugin_argument_validate {
-  var $option_name = 'validate_argument_node_type';
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['types'] = array('default' => array());
+    $options['access'] = array('default' => FALSE);
+    $options['nid_type'] = array('default' => 'nid');
 
-  function validate_form(&$form, &$form_state) {
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
     $types = node_type_get_types();
     foreach ($types as $type => $info) {
       $options[$type] = check_plain(t($info->name));
     }
 
-    $arg = $this->get_argument();
-    if (empty($arg)) {
-      $arg = array();
-    }
-
-    $form[$this->option_name] = array(
+    $form['types'] = array(
       '#type' => 'checkboxes',
-      '#prefix' => '<div id="edit-options-validate-argument-node-type-wrapper">',
-      '#suffix' => '</div>',
       '#title' => t('Types'),
       '#options' => $options,
-      '#default_value' => $arg,
+      '#default_value' => $this->options['types'],
       '#description' => t('If you wish to validate for specific node types, check them; if none are checked, all nodes will pass.'),
-      '#process' => array('form_process_checkboxes', 'views_process_dependency'),
-      '#dependency' => array('edit-options-validate-type' => array($this->id)),
     );
 
-    $form['validate_argument_node_access'] = array(
+    $form['access'] = array(
       '#type' => 'checkbox',
       '#title' => t('Validate user has access to the node'),
-      '#default_value' => !empty($this->argument->options['validate_argument_node_access']),
-      '#process' => array('views_process_dependency'),
-      '#dependency' => array('edit-options-validate-type' => array($this->id)),
+      '#default_value' => $this->options['access'],
     );
 
-    $form['validate_argument_nid_type'] = array(
+    $form['nid_type'] = array(
       '#type' => 'select',
       '#title' => t('Argument type'),
       '#options' => array(
         'nid' => t('Node ID'),
         'nids' => t('Node IDs separated by , or +'),
       ),
-      '#default_value' => isset($this->argument->options['validate_argument_nid_type']) ? $this->argument->options['validate_argument_nid_type'] : 'nid',
-      '#process' => array('views_process_dependency'),
-      '#dependency' => array('edit-options-validate-type' => array($this->id)),
+      '#default_value' => $this->options['nid_type'],
     );
   }
 
-  function validate_argument($argument) {
-    $types = array_filter($this->argument->options[$this->option_name]);
+  function options_submit(&$form, &$form_state, &$options) {
+    // filter trash out of the options so we don't store giant unnecessary arrays
+    $options['types'] = array_filter($options['types']);
+  }
 
-    $type = isset($this->argument->options['validate_argument_nid_type']) ? $this->argument->options['validate_argument_nid_type'] : 'nid';
+  function convert_options(&$options) {
+    if (!isset($options['types']) && !empty($this->argument->options['validate_argument_node_type'])) {
+      $options['types'] = $this->argument->options['validate_argument_node_type'];
+      $options['access'] = !empty($this->argument->options['validate_argument_node_access']);
+      $options['nid_type'] = $this->argument->options['validate_argument_nid_type'];
+    }
+  }
+
+  function validate_argument($argument) {
+    $types = $this->options['types'];
 
-    switch ($type) {
+    switch ($this->options['nid_type']) {
       case 'nid':
         if (!is_numeric($argument)) {
           return FALSE;
@@ -70,7 +75,7 @@ class views_plugin_argument_validate_nod
           return FALSE;
         }
 
-        if (!empty($this->argument->options['validate_argument_node_access'])) {
+        if (!empty($this->options['access'])) {
           if (!node_access('view', $node)) {
             return FALSE;
           }
@@ -88,7 +93,7 @@ class views_plugin_argument_validate_nod
       case 'nids':
         $nids = new stdClass();
         $nids->value = array($argument);
-        $nids = views_break_phrase($argument, $nids);
+        $nids = views_nid_type($argument, $nids);
         if ($nids->value == -1) {
           return FALSE;
         }
@@ -102,7 +107,7 @@ class views_plugin_argument_validate_nod
             return FALSE;
           }
 
-          if (!empty($this->argument->options['validate_argument_node_access'])) {
+          if (!empty($this->options['access'])) {
             if (!node_access('view', $node)) {
               return FALSE;
             }
Index: modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc,v
retrieving revision 1.6.4.1
diff -u -p -r1.6.4.1 views_plugin_argument_validate_taxonomy_term.inc
--- modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc	2 Nov 2009 22:01:26 -0000	1.6.4.1
+++ modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc	28 Jan 2010 20:45:18 -0000
@@ -9,26 +9,33 @@
  * Validate whether an argument is an acceptable node.
  */
 class views_plugin_argument_validate_taxonomy_term extends views_plugin_argument_validate {
-  function validate_form(&$form, &$form_state) {
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['vids'] = array('default' => array());
+    $options['type'] = array('default' => 'tid');
+    $options['transform'] = array('default' => FALSE);
+
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
     $vocabularies = taxonomy_get_vocabularies();
     $options = array();
     foreach ($vocabularies as $voc) {
       $options[$voc->vid] = check_plain($voc->name);
     }
 
-    $form['validate_argument_vocabulary'] = array(
+    $form['vids'] = array(
       '#type' => 'checkboxes',
       '#prefix' => '<div id="edit-options-validate-argument-vocabulary-wrapper">',
       '#suffix' => '</div>',
       '#title' => t('Vocabularies'),
       '#options' => $options,
-      '#default_value' => isset($this->argument->options['validate_argument_vocabulary']) ? $this->argument->options['validate_argument_vocabulary'] : array(),
+      '#default_value' => $this->options['vids'],
       '#description' => t('If you wish to validate for specific vocabularies, check them; if none are checked, all terms will pass.'),
-      '#process' => array('form_process_checkboxes', 'views_process_dependency'),
-      '#dependency' => array('edit-options-validate-type' => array($this->id)),
     );
 
-    $form['validate_argument_type'] = array(
+    $form['type'] = array(
       '#type' => 'select',
       '#title' => t('Argument type'),
       '#options' => array(
@@ -37,25 +44,34 @@ class views_plugin_argument_validate_tax
         'name' => t('Term name or synonym'),
         'convert' => t('Term name/synonym converted to Term ID'),
       ),
-      '#default_value' => isset($this->argument->options['validate_argument_type']) ? $this->argument->options['validate_argument_type'] : 'tid',
+      '#default_value' => $this->options['type'],
       '#description' => t('Select the form of this argument; if using term name, it is generally more efficient to convert it to a term ID and use Taxonomy: Term ID rather than Taxonomy: Term Name" as an argument.'),
-      '#process' => array('views_process_dependency'),
-      '#dependency' => array('edit-options-validate-type' => array($this->id)),
     );
 
-    $form['validate_argument_transform'] = array(
+    $form['transform'] = array(
       '#type' => 'checkbox',
       '#title' => t('Transform dashes in URL to spaces in term name arguments'),
-      '#default_value' => isset($this->argument->options['validate_argument_transform']) ? $this->argument->options['validate_argument_transform'] : FALSE,
-      '#process' => array('views_process_dependency'),
-      '#dependency' => array('edit-options-validate-argument-type' => array('convert')),
+      '#default_value' => $this->options['transform'],
     );
   }
 
+  function options_submit(&$form, &$form_state, &$options) {
+    // filter trash out of the options so we don't store giant unnecessary arrays
+    $options['vids'] = array_filter($options['vids']);
+  }
+
+  function convert_options(&$options) {
+    if (!isset($options['vids']) && !empty($this->argument->options['validate_argument_vocabulary'])) {
+      $options['vids'] = $this->argument->options['validate_argument_vocabulary'];
+      $options['type'] = $this->argument->options['validate_argument_type'];
+      $options['transform'] = $this->argument->options['validate_argument_transform'];
+    }
+  }
+
   function validate_argument($argument) {
-    $vids = isset($this->argument->options['validate_argument_vocabulary']) ? array_filter($this->argument->options['validate_argument_vocabulary']) : array();
-    $type = isset($this->argument->options['validate_argument_type']) ? $this->argument->options['validate_argument_type'] : 'tid';
-    $transform = isset($this->argument->options['validate_argument_transform']) ? $this->argument->options['validate_argument_transform'] : FALSE;
+    $vids = $this->options['vids'];
+    $type = $this->options['type'];
+    $transform = $this->options['transform'];
 
     switch ($type) {
       case 'tid':
@@ -67,8 +83,8 @@ class views_plugin_argument_validate_tax
         if (!$result) {
           return FALSE;
         }
-
         return empty($vids) || !empty($vids[$result->vid]);
+
       case 'tids':
         $tids = new stdClass();
         $tids->value = $argument;
@@ -96,6 +112,7 @@ class views_plugin_argument_validate_tax
         $this->argument->validated_title = implode($tids->operator == 'or' ? ' + ' : ', ', $titles);
         // If this is not empty, we did not find a tid.
         return empty($test);
+
       case 'name':
       case 'convert':
         $and = '';
Index: modules/user/views_plugin_argument_default_current_user.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/user/views_plugin_argument_default_current_user.inc,v
retrieving revision 1.1
diff -u -p -r1.1 views_plugin_argument_default_current_user.inc
--- modules/user/views_plugin_argument_default_current_user.inc	1 Oct 2008 19:50:31 -0000	1.1
+++ modules/user/views_plugin_argument_default_current_user.inc	28 Jan 2010 20:45:18 -0000
@@ -7,6 +7,8 @@
 
 /**
  * Default argument plugin to extract the global $user
+ *
+ * This plugin actually has no options so it odes not need to do a great deal.
  */
 class views_plugin_argument_default_current_user extends views_plugin_argument_default {
   function get_argument() {
Index: modules/user/views_plugin_argument_default_user.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/modules/user/views_plugin_argument_default_user.inc,v
retrieving revision 1.1
diff -u -p -r1.1 views_plugin_argument_default_user.inc
--- modules/user/views_plugin_argument_default_user.inc	3 Sep 2008 19:21:30 -0000	1.1
+++ modules/user/views_plugin_argument_default_user.inc	28 Jan 2010 20:45:18 -0000
@@ -9,22 +9,27 @@
  * Default argument plugin to extract a user via menu_get_object
  */
 class views_plugin_argument_default_user extends views_plugin_argument_default {
-  var $option_name = 'default_argument_user';
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['user'] = array('default' => '');
 
-  function argument_form(&$form, &$form_state) {
-    $form[$this->option_name] = array(
-      '#type' => 'checkbox',
-      '#title' => t('Also look for a node and use the node author'),
-      '#default_value' => !empty($this->argument->options[$this->option_name]),
-      '#process' => array('views_process_dependency'),
-      '#dependency' => array(
-        'radio:options[default_action]' => array('default'),
-        'radio:options[default_argument_type]' => array($this->id)
-      ),
-      '#dependency_count' => 2,
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    $form['user'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Default argument'),
+      '#default_value' => $this->options['user'],
     );
   }
 
+  function convert_options(&$options) {
+    if (!isset($options['user']) && isset($this->argument->options['default_argument_user'])) {
+      $options['user'] = $this->argument->options['default_argument_user'];
+    }
+  }
+
   function get_argument() {
     foreach (range(1, 3) as $i) {
       $user = menu_get_object('user', $i);
@@ -40,7 +45,7 @@ class views_plugin_argument_default_user
       }
     }
 
-    if (!empty($this->argument->options[$this->option_name])) {
+    if (!empty($this->options['user'])) {
       foreach (range(1, 3) as $i) {
         $node = menu_get_object('node', $i);
         if (!empty($node)) {
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.2.6.1
diff -u -p -r1.2.6.1 views_plugin_argument_validate_user.inc
--- modules/user/views_plugin_argument_validate_user.inc	2 Nov 2009 22:01:27 -0000	1.2.6.1
+++ modules/user/views_plugin_argument_validate_user.inc	28 Jan 2010 20:45:18 -0000
@@ -9,14 +9,16 @@
  * argument's title to the username.
  */
 class views_plugin_argument_validate_user extends views_plugin_argument_validate {
-  function validate_form(&$form, &$form_state) {
-    // 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();
-    }
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['type'] = array('default' => 'uid');
+    $options['restrict_roles'] = array('default' => FALSE);
+    $options['roles'] = array('default' => array());
+
+    return $options;
+  }
 
+  function options_form(&$form, &$form_state) {
     $form['validate_user_argument_type'] = array(
       '#type' => 'radios',
       '#title' => t('Type of user argument to allow'),
@@ -25,40 +27,45 @@ 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['validate_user_argument_type'],
-      '#process' => array('form_process_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>',
+      '#default_value' => $this->options['type'],
     );
 
     $form['validate_user_restrict_roles'] = array(
       '#type' => 'checkbox',
       '#title' => t('Restrict user based on role'),
-      '#default_value' => !empty($this->argument->options['validate_user_restrict_roles']),
-      '#process' => array('views_process_dependency'),
-      '#dependency' => array('edit-options-validate-type' => array($this->id)),
+      '#default_value' => $this->options['restrict_roles'],
     );
 
-    $form['validate_user_roles'] = array(
+    $form['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['validate_user_roles'],
+      '#default_value' => $this->options['roles'],
       '#description' => t('If no roles are selected, users from any role will be allowed.'),
       '#process' => array('form_process_checkboxes', 'views_process_dependency'),
       '#dependency' => array(
-        'edit-options-validate-type' => array($this->id),
         'edit-options-validate-user-restrict-roles' => array(1),
       ),
-      '#dependency_count' => 2,
     );
   }
 
+  function options_submit(&$form, &$form_state, &$options) {
+    // filter trash out of the options so we don't store giant unnecessary arrays
+    $options['roles'] = array_filter($options['roles']);
+  }
+
+  function convert_options(&$options) {
+    if (!isset($options['type']) && isset($this->argument->options['validate_user_argument_type'])) {
+      $options['type'] = $this->argument->options['validate_user_argument_type'];
+      $options['restrict_roles'] = $this->argument->options['validate_user_restrict_roles'];
+      $options['roles'] = $this->argument->options['validate_user_roles'];
+    }
+  }
+
   function validate_argument($argument) {
-    $type = $this->argument->options['validate_user_argument_type'];
+    $type = $this->options['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) {
@@ -85,15 +92,15 @@ class views_plugin_argument_validate_use
     }
 
     // See if we're filtering users based on roles.
-    if (!empty($this->argument->options['validate_user_restrict_roles']) && !empty($this->argument->options['validate_user_roles'])) {
-      $roles = $this->argument->options['validate_user_roles'];
+    if (!empty($this->options['restrict_roles']) && !empty($this->options['roles'])) {
+      $roles = $this->options['roles'];
       $acccont->roles = array();
       $account->roles[] = $account->uid ? DRUPAL_AUTHENTICATED_RID : DRUPAL_ANONYMOUS_RID;
       $result = db_query('SELECT rid FROM {users_roles} WHERE uid = :uid', array(':uid' => $account->uid));
       foreach ($result as $role) {
         $account->roles[] = $role->rid;
       }
-      if (!(bool)array_intersect($account->roles, $roles)) {
+      if (!(bool) array_intersect($account->roles, $roles)) {
         return FALSE;
       }
     }
Index: plugins/views_plugin_argument_default.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_argument_default.inc,v
retrieving revision 1.2.4.1
diff -u -p -r1.2.4.1 views_plugin_argument_default.inc
--- plugins/views_plugin_argument_default.inc	2 Nov 2009 22:01:27 -0000	1.2.4.1
+++ plugins/views_plugin_argument_default.inc	28 Jan 2010 20:45:18 -0000
@@ -19,58 +19,76 @@
  * The fixed argument default handler; also used as the base.
  */
 class views_plugin_argument_default extends views_plugin {
-  var $option_name = 'default_argument_fixed';
+  /**
+   * Return the default argument.
+   *
+   * This needs to be overridden by every default argument handler to properly do what is needed.
+   */
+  function get_argument() { }
+
   /**
    * Initialize this plugin with the view and the argument
    * it is linked to.
    */
-  function init(&$view, &$argument, $id = NULL) {
+  function init(&$view, &$argument, $options) {
     $this->view = &$view;
     $this->argument = &$argument;
-    $this->id = $id;
+
+    $this->convert_options($options);
+    $this->unpack_options($this->options, $options);
   }
 
   /**
+   * Retrieve the options when this is a new access
+   * control plugin
+   */
+  function option_definition() { return array(); }
+
+  /**
+   * Provide the default form for setting options.
+   */
+  function options_form(&$form, &$form_state) { }
+
+  /**
+   * Provide the default form form for validating options
+   */
+  function options_validate(&$form, &$form_state) { }
+
+  /**
+   * Provide the default form form for submitting options
+   */
+  function options_submit(&$form, &$form_state) { }
+
+  /**
    * Determine if the administrator has the privileges to use this
    * plugin
    */
   function access() { return TRUE; }
 
-  function argument_form(&$form, &$form_state) {
-    $form[$this->option_name] = array(
-      '#type' => 'textfield',
-      '#title' => t('Default argument'),
-      '#default_value' => $this->get_argument(),
-      '#process' => array('views_process_dependency'),
-      '#dependency' => array(
-        'radio:options[default_action]' => array('default'),
-        'radio:options[default_argument_type]' => array($this->id)
-      ),
-      '#dependency_count' => 2,
-    );
-
-    // Only do this if using one simple standard form gadget
-    $this->check_access($form);
-  }
-
   /**
    * If we don't have access to the form but are showing it anyway, ensure that
    * the form is safe and cannot be changed from user input.
+   *
+   * This is only called by child objects if specified in the options_form(),
+   * so it will not always be used.
    */
-  function check_access(&$form) {
+  function check_access(&$form, $option_name) {
     if (!$this->access()) {
-      $form[$this->option_name]['#disabled'] = TRUE;
-      $form[$this->option_name]['#value'] = $form[$this->option_name]['#default_value'];
-      $form[$this->option_name]['#description'] .= ' <strong>' . t('Note: you do not have permission to modify this. If you change the default argument type, this setting will be lost and you will NOT be able to get it back.') . '</strong>';
+      $form[$option_name]['#disabled'] = TRUE;
+      $form[$option_name]['#value'] = $form[$this->option_name]['#default_value'];
+      $form[$option_name]['#description'] .= ' <strong>' . t('Note: you do not have permission to modify this. If you change the default argument type, this setting will be lost and you will NOT be able to get it back.') . '</strong>';
     }
   }
 
   /**
-   * Return the default argument.
+   * Convert options from the older style.
+   *
+   * In Views 3, the method of storing default argument options has changed
+   * and each plugin now gets its own silo. This method can be used to
+   * move arguments from the old style to the new style. See
+   * views_plugin_argument_default_fixed for a good example of this method.
    */
-  function get_argument() {
-    return isset($this->argument->options[$this->option_name]) ? $this->argument->options[$this->option_name] : '';
-  }
+  function convert_options(&$options) { }
 }
 
 /**
Index: plugins/views_plugin_argument_default_fixed.inc
===================================================================
RCS file: plugins/views_plugin_argument_default_fixed.inc
diff -N plugins/views_plugin_argument_default_fixed.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ plugins/views_plugin_argument_default_fixed.inc	28 Jan 2010 20:45:18 -0000
@@ -0,0 +1,44 @@
+<?php
+// $Id: views_plugin_argument_default.inc,v 1.1.2.1 2009/06/01 23:34:59 merlinofchaos Exp $
+/**
+ * @file
+ * Contains the fixed argument default plugin.
+ */
+
+/**
+ * The fixed argument default handler.
+ */
+class views_plugin_argument_default_fixed extends views_plugin_argument_default {
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['argument'] = array('default' => '');
+
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    $form['argument'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Default argument'),
+      '#default_value' => $this->options['argument'],
+    );
+  }
+
+  /**
+   * Return the default argument.
+   */
+  function get_argument() {
+    return $this->options['argument'];
+  }
+
+  function convert_options(&$options) {
+    if (!isset($options['argument']) && isset($this->argument->options['default_argument_fixed'])) {
+      $options['argument'] = $this->argument->options['default_argument_fixed'];
+    }
+  }
+}
+
+/**
+ * @}
+ */
+
Index: plugins/views_plugin_argument_default_php.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_argument_default_php.inc,v
retrieving revision 1.1.6.1
diff -u -p -r1.1.6.1 views_plugin_argument_default_php.inc
--- plugins/views_plugin_argument_default_php.inc	2 Nov 2009 22:01:27 -0000	1.1.6.1
+++ plugins/views_plugin_argument_default_php.inc	28 Jan 2010 20:45:18 -0000
@@ -9,23 +9,30 @@
  * Default argument plugin to provide a PHP code block.
  */
 class views_plugin_argument_default_php extends views_plugin_argument_default {
-  var $option_name = 'default_argument_php';
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['code'] = array('default' => '');
 
-  function argument_form(&$form, &$form_state) {
-    $form[$this->option_name] = array(
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    $form['code'] = array(
       '#type' => 'textarea',
       '#title' => t('PHP argument code'),
-      '#default_value' => $this->get_argument(TRUE), // the true forces it raw.
+      '#default_value' => $this->options['code'],
       '#process' => array('views_process_dependency'),
       '#description' => t('Enter PHP code that returns a value to use for this argument. Do not use &lt;?php ?&gt;. You must return only a single value for just this argument.'),
-      '#dependency' => array(
-        'radio:options[default_action]' => array('default'),
-        'radio:options[default_argument_type]' => array($this->id)
-      ),
-      '#dependency_count' => 2,
     );
 
-    $this->check_access($form);
+    // Only do this if using one simple standard form gadget
+    $this->check_access($form, 'code');
+  }
+
+  function convert_options(&$options) {
+    if (!isset($options['code']) && isset($this->argument->options['default_argument_php'])) {
+      $options['code'] = $this->argument->options['default_argument_php'];
+    }
   }
 
   /**
@@ -36,16 +43,12 @@ class views_plugin_argument_default_php 
     return user_access('use PHP for settings');
   }
 
-  function get_argument($raw = FALSE) {
-    if ($raw) {
-      return parent::get_argument();
-    }
-
+  function get_argument() {
     // set up variables to make it easier to reference during the argument.
     $view = &$this->view;
     $argument = &$this->argument;
     ob_start();
-    $result = eval($this->argument->options[$this->option_name]);
+    $result = eval($this->options['code']);
     ob_end_clean();
     return $result;
   }
Index: plugins/views_plugin_argument_validate.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_argument_validate.inc,v
retrieving revision 1.2.4.1
diff -u -p -r1.2.4.1 views_plugin_argument_validate.inc
--- plugins/views_plugin_argument_validate.inc	2 Nov 2009 22:01:27 -0000	1.2.4.1
+++ plugins/views_plugin_argument_validate.inc	28 Jan 2010 20:45:18 -0000
@@ -20,48 +20,70 @@
  * @ingroup views_argument_validate_plugins
  */
 class views_plugin_argument_validate extends views_plugin {
-  var $option_name = 'validate_argument';
 
   /**
    * Initialize this plugin with the view and the argument
    * it is linked to.
    */
-  function init(&$view, &$argument, $id = NULL) {
+  function init(&$view, &$argument, $options) {
     $this->view = &$view;
     $this->argument = &$argument;
-    $this->id = $id;
+
+    $this->convert_options($options);
+    $this->unpack_options($this->options, $options);
   }
 
   /**
-   * Determine if the administrator has the privileges to use this
-   * plugin
+   * Retrieve the options when this is a new access
+   * control plugin
    */
-  function access() { return TRUE; }
+  function option_definition() { return array(); }
 
-  function argument_form(&$form, &$form_state) {
-  }
+  /**
+   * Provide the default form for setting options.
+   */
+  function options_form(&$form, &$form_state) { }
+
+  /**
+   * Provide the default form form for validating options
+   */
+  function options_validate(&$form, &$form_state) { }
+
+  /**
+   * Provide the default form form for submitting options
+   */
+  function options_submit(&$form, &$form_state) { }
+
+  /**
+   * Convert options from the older style.
+   *
+   * In Views 3, the method of storing default argument options has changed
+   * and each plugin now gets its own silo. This method can be used to
+   * move arguments from the old style to the new style. See
+   * views_plugin_argument_default_fixed for a good example of this method.
+   */
+  function convert_options(&$options) { }
+
+  /**
+   * Determine if the administrator has the privileges to use this plugin
+   */
+  function access() { return TRUE; }
 
   /**
    * If we don't have access to the form but are showing it anyway, ensure that
    * the form is safe and cannot be changed from user input.
+   *
+   * This is only called by child objects if specified in the options_form(),
+   * so it will not always be used.
    */
-  function check_access(&$form) {
+  function check_access(&$form, $option_name) {
     if (!$this->access()) {
-      $form[$this->option_name]['#disabled'] = TRUE;
-      $form[$this->option_name]['#value'] = $form[$this->option_name]['#default_value'];
-      $form[$this->option_name]['#description'] .= ' <strong>' . t('Note: you do not have permission to modify this. If you change the validator, this setting will be lost and you will NOT be able to get it back.') . '</strong>';
+      $form[$option_name]['#disabled'] = TRUE;
+      $form[$option_name]['#value'] = $form[$this->option_name]['#default_value'];
+      $form[$option_name]['#description'] .= ' <strong>' . t('Note: you do not have permission to modify this. If you change the default argument type, this setting will be lost and you will NOT be able to get it back.') . '</strong>';
     }
   }
 
-  /**
-   * Return the validate argument.
-   */
-  function get_argument() {
-    return isset($this->argument->options[$this->option_name]) ? $this->argument->options[$this->option_name] : '';
-  }
-
-  function validate_form(&$form, &$form_state) { }
-
   function validate_argument($arg) { return TRUE; }
 }
 
Index: plugins/views_plugin_argument_validate_numeric.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_argument_validate_numeric.inc,v
retrieving revision 1.1
diff -u -p -r1.1 views_plugin_argument_validate_numeric.inc
--- plugins/views_plugin_argument_validate_numeric.inc	3 Sep 2008 19:21:30 -0000	1.1
+++ plugins/views_plugin_argument_validate_numeric.inc	28 Jan 2010 20:45:18 -0000
@@ -11,16 +11,6 @@
  * @ingroup views_argument_validate_plugins
  */
 class views_plugin_argument_validate_numeric extends views_plugin_argument_validate {
-  var $option_name = 'validate_argument_numeric';
-
-  /**
-   * Only let users with PHP block visibility permissions set/modify this
-   * validate plugin.
-   */
-  function access() {
-    return !empty($this->argument->definition['numeric']);
-  }
-
   function validate_argument($argument) {
     return is_numeric($argument);
   }
Index: plugins/views_plugin_argument_validate_php.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_argument_validate_php.inc,v
retrieving revision 1.1.6.1
diff -u -p -r1.1.6.1 views_plugin_argument_validate_php.inc
--- plugins/views_plugin_argument_validate_php.inc	2 Nov 2009 22:01:27 -0000	1.1.6.1
+++ plugins/views_plugin_argument_validate_php.inc	28 Jan 2010 20:45:18 -0000
@@ -11,19 +11,22 @@
  * @ingroup views_argument_validate_plugins
  */
 class views_plugin_argument_validate_php extends views_plugin_argument_validate {
-  var $option_name = 'validate_argument_php';
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['code'] = array('default' => '');
 
-  function validate_form(&$form, &$form_state) {
-    $form[$this->option_name] = array(
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    $form['code'] = array(
       '#type' => 'textarea',
       '#title' => t('PHP validate code'),
-      '#default_value' => $this->get_argument(),
-      '#description' => t('Enter PHP code that returns TRUE or FALSE. No return is the same as FALSE, so be SURE to return something if you do not want to declare the argument invalid. Do not use &lt;?php ?&gt;. The argument to validate will be "$argument" and the view will be "$view". You may change the argument by setting "$handler->argument".'),
-      '#process' => array('views_process_dependency'),
-      '#dependency' => array('edit-options-validate-type' => array($this->id)),
+      '#default_value' => $this->options['code'],
+      '#description' => t('Enter PHP code that returns TRUE or FALSE. No return is the same as FALSE, so be SURE to return something if you do not want to declare the argument invalid. Do not use &lt;?php ?&gt;. The argument to validate will be "$argument" and the view will be "$view". You may change the argument by setting "$handler->argument". You may change the title used for substitutions for this argument by setting "$argument->validated_title".'),
     );
 
-    $this->check_access($form);
+    $this->check_access($form, 'code');
   }
 
   /**
@@ -34,13 +37,19 @@ class views_plugin_argument_validate_php
     return user_access('use PHP for settings');
   }
 
+  function convert_options(&$options) {
+    if (!isset($options['code']) && isset($this->argument->options['validate_argument_php'])) {
+      $options['code'] = $this->argument->options['validate_argument_php'];
+    }
+  }
+
   function validate_argument($argument) {
     // set up variables to make it easier to reference during the argument.
     $view = &$this->view;
     $handler = &$this->argument;
 
     ob_start();
-    $result = eval($this->argument->options[$this->option_name]);
+    $result = eval($this->options['code']);
     ob_end_clean();
     return $result;
   }
Index: plugins/views_plugin_display.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_display.inc,v
retrieving revision 1.27.4.12
diff -u -p -r1.27.4.12 views_plugin_display.inc
--- plugins/views_plugin_display.inc	28 Jan 2010 17:16:40 -0000	1.27.4.12
+++ plugins/views_plugin_display.inc	28 Jan 2010 20:45:18 -0000
@@ -285,37 +285,9 @@ class views_plugin_display extends views
           'arguments' => TRUE,
           'filters' => TRUE,
         ),
+        'export' => FALSE,
       ),
-      'relationships' => array(
-        'default' => array(),
-        'export' => 'export_item',
-      ),
-      'fields' => array(
-        'default' => array(),
-        'export' => 'export_item',
-      ),
-      'sorts' => array(
-        'default' => array(),
-        'export' => 'export_item',
-      ),
-      'arguments' => array(
-        'default' => array(),
-        'export' => 'export_item',
-      ),
-      'filters' => array(
-        'default' => array(),
-        'export' => 'export_item',
-      ),
-      'access' => array(
-        'contains' => array(
-          'type' => array('default' => 'none'),
-         ),
-      ),
-      'cache' => array(
-        'contains' => array(
-          'type' => array('default' => 'none'),
-         ),
-      ),
+
       'title' => array(
         'default' => '',
         'translatable' => TRUE,
@@ -349,6 +321,7 @@ class views_plugin_display extends views
       ),
       'use_ajax' => array(
         'default' => FALSE,
+        'bool' => TRUE,
       ),
       'items_per_page' => array(
         'default' => 10,
@@ -358,15 +331,18 @@ class views_plugin_display extends views
       ),
       'use_pager' => array(
         'default' => FALSE,
+        'bool' => TRUE,
       ),
       'pager_element' => array(
         'default' => 0,
       ),
       'use_more' => array(
         'default' => FALSE,
+        'bool' => TRUE,
       ),
       'use_more_always' => array(
         'default' => FALSE,
+        'bool' => TRUE,
       ),
       'use_more_text' => array(
         'default' => 'more',
@@ -377,33 +353,86 @@ class views_plugin_display extends views
       ),
       'distinct' => array(
         'default' => FALSE,
+        'bool' => TRUE,
       ),
       'group_by' => array(
         'default' => FALSE,
+        'bool' => TRUE,
       ),
 
+      // These types are all plugins that can have individual settings
+      // and therefore need special handling.
+      'access' => array(
+        'contains' => array(
+          'type' => array('default' => 'none', 'export' => 'export_plugin'),
+         ),
+      ),
+      'cache' => array(
+        'contains' => array(
+          'type' => array('default' => 'none', 'export' => 'export_plugin'),
+         ),
+      ),
+      // Note that exposed_form plugin has options in a separate array,
+      // while access and cache do not. access and cache are legacy and
+      // that pattern should not be repeated, but it is left as is to
+      // reduce the need to modify older views. Let's consider the
+      // pattern used here to be the template from which future plugins
+      // should be copied.
+      'exposed_form' => array(
+        'contains' => array(
+          'type' => array('default' => 'basic', 'export' => 'export_plugin'),
+          'options' => array('default' => array(), 'export' => FALSE),
+         ),
+      ),
+
+      // Note that the styles have their options completely independent.
+      // Like access and cache above, this is a legacy pattern and
+      // should not be repeated.
       'style_plugin' => array(
         'default' => 'default',
+        'export' => 'export_style',
       ),
       'style_options' => array(
         'default' => array(),
+        'export' => FALSE,
       ),
       'row_plugin' => array(
         'default' => 'fields',
+        'export' => 'export_style',
       ),
       'row_options' => array(
         'default' => array(),
+        'export' => FALSE,
       ),
 
       'exposed_block' => array(
         'default' => FALSE,
       ),
-      'exposed_form' => array(
-        'contains' => array(
-          'type' => array('default' => 'basic'),
-          'options' => array('default' => array()),
-         ),
+
+      // We want these to export last.
+      // These are the 5 handler types.
+      'relationships' => array(
+        'default' => array(),
+        'export' => 'export_handler',
+      ),
+      'fields' => array(
+        'default' => array(),
+        'export' => 'export_handler',
       ),
+      'sorts' => array(
+        'default' => array(),
+        'export' => 'export_handler',
+      ),
+      'arguments' => array(
+        'default' => array(),
+        'export' => 'export_handler',
+      ),
+      'filters' => array(
+        'default' => array(),
+        'export' => 'export_handler',
+      ),
+
+
     );
 
     if ($this->is_default_display()) {
@@ -515,67 +544,38 @@ class views_plugin_display extends views
    * Get the display or row plugin, if it exists.
    */
   function get_plugin($type = 'style', $name = NULL) {
-    if (!$name) {
-      $name = $this->get_option($type . '_plugin');
+    switch ($type) {
+      case 'style':
+      case 'row':
+        $option_name = $type . '_plugin';
+        $options = $this->get_option($type . '_options');
+        if (!$name) {
+          $name = $this->get_option($option_name);
+        }
+
+        break;
+      default:
+        $option_name = $type;
+        $options = $this->get_option($type);
+        if (!$name) {
+          $name = $options['type'];
+        }
+
+        // access & cache store their options as siblings with the
+        // type; all others use an 'options' array.
+        if ($type != 'access' && $type != 'cache') {
+          $options = $options['options'];
+        }
     }
 
     $plugin = views_get_plugin($type, $name);
     if ($plugin) {
-      $options = $this->get_option($type . '_options');
       $plugin->init($this->view, $this->display, $options);
       return $plugin;
     }
   }
 
   /**
-   * Get the access plugin
-   */
-  function get_access_plugin($name = NULL) {
-    if (!$name) {
-      $access = $this->get_option('access');
-      $name = $access['type'];
-    }
-
-    $plugin = views_get_plugin('access', $name);
-    if ($plugin) {
-      $plugin->init($this->view, $this->display);
-      return $plugin;
-    }
-  }
-
-  /**
-   * Get the cache plugin
-   */
-  function get_cache_plugin($name = NULL) {
-    if (!$name) {
-      $cache = $this->get_option('cache');
-      $name = $cache['type'];
-    }
-
-    $plugin = views_get_plugin('cache', $name);
-    if ($plugin) {
-      $plugin->init($this->view, $this->display);
-      return $plugin;
-    }
-  }
-
-  /**
-   * Get the exposed form plugin
-   */
-  function get_exposed_form_plugin($name = NULL) {
-    if (!$name) {
-      $exposed_form = $this->get_option('exposed_form');
-      $name = $exposed_form['type'];
-    }
-
-    $plugin = views_get_plugin('exposed_form', $name);
-    if ($plugin) {
-      $plugin->init($this->view, $this->display);
-      return $plugin;
-    }
-  }
-
-  /**
    * Get the handler object for a single handler.
    */
   function &get_handler($type, $id) {
@@ -807,7 +807,7 @@ class views_plugin_display extends views
       );
     }
 
-    $access_plugin = $this->get_access_plugin();
+    $access_plugin = $this->get_plugin('access');
     if (!$access_plugin) {
       // default to the no access control plugin.
       $access_plugin = views_get_plugin('access', 'none');
@@ -826,7 +826,7 @@ class views_plugin_display extends views
       $options['access']['links']['access_options'] = t('Change settings for this access type.');
     }
 
-    $cache_plugin = $this->get_cache_plugin();
+    $cache_plugin = $this->get_plugin('cache');
     if (!$cache_plugin) {
       // default to the no cache control plugin.
       $cache_plugin = views_get_plugin('cache', 'none');
@@ -876,7 +876,7 @@ class views_plugin_display extends views
       'desc' => t('Allow the exposed form to appear in a block instead of the view.'),
     );
 
-    $exposed_form_plugin = $this->get_exposed_form_plugin();
+    $exposed_form_plugin = $this->get_plugin('exposed_form');
     if (!$exposed_form_plugin) {
       // default to the no cache control plugin.
       $exposed_form_plugin = views_get_plugin('exposed_form', 'basic');
@@ -1084,7 +1084,7 @@ class views_plugin_display extends views
         break;
       case 'access_options':
         $access = $this->get_option('access');
-        $plugin = $this->get_access_plugin();
+        $plugin = $this->get_plugin('access');
         $form['#title'] .= t('Access options');
         if ($plugin) {
           $form['#help_topic'] = $plugin->definition['help topic'];
@@ -1126,7 +1126,7 @@ class views_plugin_display extends views
         break;
       case 'cache_options':
         $cache = $this->get_option('cache');
-        $plugin = $this->get_cache_plugin();
+        $plugin = $this->get_plugin('cache');
         $form['#title'] .= t('Caching options');
         if ($plugin) {
           $form['#help_topic'] = $plugin->definition['help topic'];
@@ -1502,8 +1502,7 @@ class views_plugin_display extends views
         }
         break;
       case 'exposed_form_options':
-        $exposed_form = $this->get_option('exposed_form');
-        $plugin = $this->get_exposed_form_plugin();
+        $plugin = $this->get_plugin('exposed_form');
         $form['#title'] .= t('Exposed form options');
         if ($plugin) {
           $form['#help_topic'] = $plugin->definition['help topic'];
@@ -1578,19 +1577,19 @@ class views_plugin_display extends views
         }
         break;
       case 'access_options':
-        $plugin = $this->get_access_plugin();
+        $plugin = $this->get_plugin('access');
         if ($plugin) {
           $plugin->options_validate($form['access_options'], $form_state);
         }
         break;
       case 'cache_options':
-        $plugin = $this->get_cache_plugin();
+        $plugin = $this->get_plugin('cache');
         if ($plugin) {
           $plugin->options_validate($form['cache_options'], $form_state);
         }
         break;
       case 'exposed_form_options':
-        $plugin = $this->get_exposed_form_plugin();
+        $plugin = $this->get_plugin('exposed_form');
         if ($plugin) {
           $plugin->options_validate($form['exposed_form_options'], $form_state);
         }
@@ -1604,7 +1603,7 @@ class views_plugin_display extends views
    */
   function options_submit(&$form, &$form_state) {
     // Not sure I like this being here, but it seems (?) like a logical place.
-    $cache_plugin = $this->get_cache_plugin();
+    $cache_plugin = $this->get_plugin('cache');
     if ($cache_plugin) {
       $cache_plugin->cache_flush();
     }
@@ -1754,7 +1753,7 @@ class views_plugin_display extends views
 
         break;
       case 'exposed_form_options':
-        $plugin = $this->get_exposed_form_plugin();
+        $plugin = $this->get_plugin('exposed_form');
         if ($plugin) {
           $exposed_form = $this->get_option('exposed_form');
           $plugin->options_submit($form['exposed_form_options'], $form_state);
@@ -1964,7 +1963,7 @@ class views_plugin_display extends views
       return TRUE;
     }
 
-    $plugin = $this->get_access_plugin();
+    $plugin = $this->get_plugin('access');
     if ($plugin) {
       return $plugin->access($account);
     }
@@ -2112,6 +2111,130 @@ class views_plugin_display extends views
     }
   }
 
+  /**
+   * Override of export_option()
+   *
+   * Because displays do not want to export options that are NOT overridden from the
+   * default display, we need some special handling during the export process.
+   */
+  function export_option($indent, $prefix, $storage, $option, $definition, $parents) {
+    // The $prefix is wrong because we store our actual options a little differently:
+    $prefix = '$handler->display->display_options';
+    $output = '';
+    if (!$parents && !$this->is_default_display()) {
+      // Do not export items that are not overridden.
+      if ($this->is_defaulted($option)) {
+        return;
+      }
+
+      // If this is not defaulted and is overrideable, flip the switch to say this
+      // is overridden.
+      if ($this->defaultable_sections($option)) {
+        $output .= $indent . $prefix . "['defaults']['$option'] = FALSE;\n";
+      }
+    }
+
+    $output .= parent::export_option($indent, $prefix, $storage, $option, $definition, $parents);
+    return $output;
+  }
+
+  /**
+   * Special method to export items that have handlers.
+   *
+   * This method was specified in the option_definition() as the method to utilize to
+   * export fields, filters, sort criteria, relationships and arguments. This passes
+   * the export off to the individual handlers so that they can export themselves
+   * properly.
+   */
+  function export_handler($indent, $prefix, $storage, $option, $definition, $parents) {
+    $output = '';
+
+    // cut the 's' off because the data is stored as the plural form but we need
+    // the singular form. Who designed that anyway? Oh yeah, I did. :(
+    $type = substr($option, 0, -1);
+    $types = views_object_types();
+    foreach ($storage[$option] as $id => $info) {
+      $handler = views_get_handler($info['table'], $info['field'], $type);
+      if ($handler) {
+        $handler->init($this->view, $info);
+        $output .= $indent . '/* ' . $types[$type]['stitle'] . ': ' . $handler->ui_name() . " */\n";
+        $output .= $handler->export_options($indent, $prefix . "['$option']['$id']");
+      }
+
+      // Prevent reference problems.
+      unset($handler);
+    }
+
+    return $output;
+  }
+
+  /**
+   * Special handling for the style export.
+   *
+   * Styles are stored as style_plugin and style_options or row_plugin and
+   * row_options accordingly. The options are told not to export, and the
+   * export for the plugin should export both.
+   */
+  function export_style($indent, $prefix, $storage, $option, $definition, $parents) {
+    $output = '';
+    $style_plugin = $this->get_plugin();
+    if ($option == 'style_plugin') {
+      $type = 'style';
+      $options_field = 'style_options';
+      $plugin = $style_plugin;
+    }
+    else {
+      if (!$style_plugin || !$style_plugin->uses_row_plugin()) {
+        return;
+      }
+
+      $type = 'row';
+      $options_field = 'row_options';
+      $plugin = $this->get_plugin('row');
+      // If the style plugin doesn't use row plugins, don't even bother.
+    }
+
+    if ($plugin) {
+      // Write which plugin to use.
+      $value = $this->get_option($option);
+      $output .= $indent . $prefix . "['$option'] = '$value';\n";
+
+      // Pass off to the plugin to export itself.
+      $output .= $plugin->export_options($indent, $prefix . "['$options_field']");
+    }
+
+    return $output;
+  }
+
+  /**
+   * Special handling for plugin export
+   *
+   * Plugins other than styles are stored in array with 'type' being the key
+   * to the plugin. For modern plugins, the options are stored in the 'options'
+   * array, but for legacy plugins (access and cache) options are stored as
+   * siblings to the type.
+   */
+  function export_plugin($indent, $prefix, $storage, $option, $definition, $parents) {
+    $output = '';
+    $plugin_type = end($parents);
+    $plugin = $this->get_plugin($plugin_type);
+    if ($plugin) {
+      // Write which plugin to use.
+      $value = $storage[$option];
+      $new_prefix = $prefix . "['$plugin_type']";
+
+      $output .= $indent . $new_prefix . "['$option'] = '$value';\n";
+
+      if ($plugin_type != 'access' && $plugin_type!= 'cache') {
+        $new_prefix .= "['options']";
+      }
+
+      // Pass off to the plugin to export itself.
+      $output .= $plugin->export_options($indent, $new_prefix);
+    }
+
+    return $output;
+  }
 }
 
 
Index: plugins/views_plugin_display_page.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_display_page.inc,v
retrieving revision 1.8.4.2
diff -u -p -r1.8.4.2 views_plugin_display_page.inc
--- plugins/views_plugin_display_page.inc	29 Nov 2009 20:03:38 -0000	1.8.4.2
+++ plugins/views_plugin_display_page.inc	28 Jan 2010 20:45:18 -0000
@@ -66,7 +66,7 @@ class views_plugin_display_page extends 
 
     $path = implode('/', $bits);
 
-    $access_plugin = $this->get_access_plugin();
+    $access_plugin = $this->get_plugin('access');
 
     if ($path) {
       $items[$path] = array(
Index: plugins/views_plugin_style_summary.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/views_plugin_style_summary.inc,v
retrieving revision 1.1.6.2
diff -u -p -r1.1.6.2 views_plugin_style_summary.inc
--- plugins/views_plugin_style_summary.inc	20 Jan 2010 23:51:42 -0000	1.1.6.2
+++ plugins/views_plugin_style_summary.inc	28 Jan 2010 20:45:18 -0000
@@ -14,8 +14,8 @@ class views_plugin_style_summary extends
   function option_definition() {
     $options = parent::option_definition();
 
-    $options['count'] = array('default' => TRUE);
-    $options['override'] = array('default' => FALSE);
+    $options['count'] = array('default' => TRUE, 'bool' => TRUE);
+    $options['override'] = array('default' => FALSE, 'bool' => TRUE);
     $options['items_per_page'] = array('default' => 25);
 
     return $options;
