=== modified file '.bzrignore'
--- .bzrignore	2009-10-17 18:33:18 +0000
+++ .bzrignore	2009-10-17 19:17:01 +0000
@@ -1,1 +1,4 @@
 CVS
+._*
+*.patch
+*.diff

=== modified file 'CHANGELOG.txt'
--- CHANGELOG.txt	2009-10-17 18:33:18 +0000
+++ CHANGELOG.txt	2009-10-18 07:37:31 +0000
@@ -95,7 +95,7 @@
     o #478312 by yhahn: Provide specific node access filter.
     o #479878 by dereine: User language field.
     o #468824 by eaton: Pluggable caching mechanism which can cache both the query result and rendered result.
-    o #399534 by clemens.tolboom and drewish: Add fragment and query string as options when making fields into links. 
+    o #399534 by clemens.tolboom and drewish: Add fragment and query string as options when making fields into links.
     o #315915 by dixon_: Add another base row class to rows.
     o #271833 by grugnog, agentrickard and others: Taxonomy depth in filter.
     o #353403 by agentrickard: Field to provide "more" text.
@@ -162,7 +162,7 @@
     o #364082 by hass: Unique key missing on views_view table.
     o #366250 by sirkitree: Fix deprecated jquery selectors so we can work with jquery 1.2.6 as well as 1.3.2.
     o #386986: 2 or more relationships could block a normal table from being added.
-    o #371219 by aclight: Incorrect logic in views_many_to_one_helper::ensure_my_table() 
+    o #371219 by aclight: Incorrect logic in views_many_to_one_helper::ensure_my_table()
     o #376570 by yhahn: Better AJAX scrolling.
     o #412576 by yhahn: Restore missing views_handler_filter_float class.
     o #378710: Add strip_tags() to path when displaying a field as a link as a path can never have HTML in it.
@@ -241,7 +241,7 @@
     o #353002 by neclimdul: Provide a filter for user posted or commented on to complement the argument with the same functionality.
 
   2.3 API Notes:
-    A minor change in the API now requires that styles that render fields MUST 
+    A minor change in the API now requires that styles that render fields MUST
     render them in order, first by row and then by field ID. Not doing so will
     cause the token expansion to fail.
 

=== modified file 'README.txt'
--- README.txt	2009-10-17 18:33:18 +0000
+++ README.txt	2009-10-18 07:37:31 +0000
@@ -2,7 +2,7 @@
 
 Welcome to Views 2. Please see the advanced help for more information.
 
-If you're having trouble installing this module, please ensure that your 
+If you're having trouble installing this module, please ensure that your
 tar program is not flattening the directory tree, truncating filenames
 or losing files.
 

=== modified file 'css/views-admin.css'
--- css/views-admin.css	2009-10-17 18:33:18 +0000
+++ css/views-admin.css	2009-10-19 05:17:54 +0000
@@ -95,6 +95,7 @@
 .views-tabset .extra input {
   margin-top: 0;
   margin-right: 0;
+  font-size: 10px;
   white-space: normal;
 }
 
@@ -209,6 +210,10 @@
   margin-top: 0px;
 }
 
+#views-ajax-pad > div.ajax-progress {
+  display: none;
+}
+
 #views-ajax-title {
   background: #f6f6f6;
   border-left: #D6DBDE 1px solid;
@@ -234,6 +239,7 @@
   border: #D6DBDE 1px solid;
   padding-top: 3px;
   border-top: 0;
+  float: none;
 }
 
 #views-ajax-pad .views-messages {
@@ -256,8 +262,7 @@
 }
 
 #views-ajax-pad .form-buttons .form-submit {
-  margin: 0 .5em 0 0;
-  padding: 0;
+  font-size: 10px;
 }
 
 #views-ajax-pad .form-item {
@@ -556,8 +561,9 @@
 }
 
 #views-ui-edit-view-form {
-  margin: 0;
+  margin: 10px 0 0;
   padding: 0;
+  clear: both;
 }
 
 #views-live-preview {
@@ -654,3 +660,8 @@
   margin: 0 1em;
   border: 1px solid;
 }
+
+div.views-category #page-title {
+  background: none;
+  padding-top: 0px;
+}

=== modified file 'css/views-list.css'
--- css/views-list.css	2009-10-17 18:33:18 +0000
+++ css/views-list.css	2009-10-18 07:37:31 +0000
@@ -80,5 +80,5 @@
 }
 table.view-enabled td.view-name,
 table.view-enabled td.view-ops {
-  background: #E4F0F8; 
+  background: #E4F0F8;
 }

=== modified file 'css/views-tabs.css'
--- css/views-tabs.css	2009-10-17 18:33:18 +0000
+++ css/views-tabs.css	2009-10-18 07:37:31 +0000
@@ -1,5 +1,5 @@
 /* $Id */
 
-.ui-tabs-hide { 
-  display: none; 
+.ui-tabs-hide {
+  display: none;
 }

=== modified file 'docs/docs.php'
--- docs/docs.php	2009-10-17 18:33:18 +0000
+++ docs/docs.php	2009-10-18 07:37:31 +0000
@@ -244,7 +244,7 @@
 function hook_views_api() {
   return array(
     'api' => 2,
-    'path' => drupal_get_path('module', 'example') . '/includes/views', 
+    'path' => drupal_get_path('module', 'example') . '/includes/views',
   );
 }
 

=== modified file 'handlers/views_handler_argument.inc'
--- handlers/views_handler_argument.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_argument.inc	2009-10-18 19:13:47 +0000
@@ -114,16 +114,16 @@
     $defaults = $this->default_actions();
 
     $form['title'] = array(
-      '#prefix' => '<div class="clear-block">',
+      '#prefix' => '<div class="clearfix">',
       '#suffix' => '</div>',
       '#type' => 'textfield',
       '#title' => t('Title'),
       '#default_value' => $this->options['title'],
       '#description' => t('The title to use when this argument is present. It will override the title of the view and titles from previous arguments. You can use percent substitution here to replace with argument titles. Use "%1" for the first argument, "%2" for the second, etc.'),
     );
-    
+
     $form['breadcrumb'] = array(
-      '#prefix' => '<div class="clear-block">',
+      '#prefix' => '<div class="clearfix">',
       '#suffix' => '</div>',
       '#type' => 'textfield',
       '#title' => t('Breadcrumb'),
@@ -132,11 +132,11 @@
     );
 
     $form['clear_start'] = array(
-      '#value' => '<div class="clear-block">',
+      '#markup' => '<div class="clearfix">',
     );
 
     $form['defaults_start'] = array(
-      '#value' => '<div class="views-left-50">',
+      '#markup' => '<div class="views-left-50">',
     );
 
     $form['default_action'] = array(
@@ -146,7 +146,7 @@
     );
 
     $form['defaults_stop'] = array(
-      '#value' => '</div>',
+      '#markup' => '</div>',
     );
 
     $form['wildcard'] = array(
@@ -169,7 +169,7 @@
     );
 
     $form['clear_stop'] = array(
-      '#value' => '</div>',
+      '#markup' => '</div>',
     );
 
     $options = array();
@@ -188,7 +188,7 @@
 
     $form['validate_options_div_prefix'] = array(
       '#id' => 'views-validator-options',
-      '#value' => '<fieldset id="views-validator-options"><legend>' . t('Validator options') . '</legend>',
+      '#markup' => '<fieldset id="views-validator-options"><legend>' . t('Validator options') . '</legend>',
     );
 
     $form['validate_type'] = array(
@@ -242,7 +242,7 @@
     );
 
     $form['validate_options_div_suffix'] = array(
-      '#value' => '</fieldset>',
+      '#markup' => '</fieldset>',
     );
   }
 
@@ -329,7 +329,7 @@
       '#id' => 'edit-options-default-argument-type',
       '#title' => t('Default argument type'),
       '#default_value' => $this->options['default_argument_type'],
-      '#process' => array('expand_radios', 'views_process_dependency'),
+      '#process' => array('form_process_radios', 'views_process_dependency'),
       '#dependency' => array('radio:options[default_action]' => array('default')),
     );
 
@@ -346,7 +346,7 @@
     }
 
     $form['default_options_div_suffix'] = array(
-      '#value' => '</fieldset></div>',
+      '#markup' => '</fieldset></div>',
     );
 
     asort($options);
@@ -512,7 +512,7 @@
       if ($this->table_alias != $this->table) {
         $j = views_get_table_join($this->name_table, $this->table);
         if ($j) {
-          $join = drupal_clone($j);
+          $join = clone $j;
           $join->left_table = $this->table_alias;
           $this->name_table_alias = $this->query->add_table($this->name_table, $this->relationship, $join);
         }
@@ -598,8 +598,7 @@
    */
   function query() {
     $this->ensure_my_table();
-    $placeholder = empty($this->definition['numeric']) ? "'%s'" : '%d';
-    $this->query->add_where(0, "$this->table_alias.$this->real_field = $placeholder", $this->argument);
+    $this->query->add_where(0, "$this->table_alias.$this->real_field", $this->argument);
   }
 
   /**
@@ -714,7 +713,7 @@
     if (isset($this->argument)) {
       return $this->argument;
     }
-    
+
     // Otherwise, we have to pretend to process ourself to find the value.
     $value = NULL;
     // Find the position of this argument within the view.
@@ -731,7 +730,7 @@
 
     // Clone ourselves so that we don't break things when we're really
     // processing the arguments.
-    $argument = drupal_clone($this);
+    $argument = clone $this;
     if (!isset($arg) && $argument->has_default_argument()) {
       $arg = $argument->get_default_argument();
     }
@@ -758,8 +757,7 @@
   function query() { /* No query to run */ }
   function options_form(&$form, &$form_state) {
     $form['markup'] = array(
-      '#prefix' => '<div class="form-item description">',
-      '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
+      '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>',
     );
   }
 

=== modified file 'handlers/views_handler_argument_date.inc'
--- handlers/views_handler_argument_date.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_argument_date.inc	2009-10-18 07:37:31 +0000
@@ -36,16 +36,16 @@
    */
   function get_default_argument($raw = FALSE) {
     if (!$raw && $this->options['default_argument_type'] == 'date') {
-      return date($this->arg_format, time());
+      return date($this->arg_format, REQUEST_TIME);
     }
-    else if (!$raw) {
+    elseif (!$raw) {
       foreach (range(1, 3) as $i) {
         $node = menu_get_object('node', $i);
         if (!empty($node)) {
           continue;
         }
       }
-  
+
       if (arg(0) == 'node' && is_numeric(arg(1))) {
         $node = node_load(arg(1));
       }
@@ -53,10 +53,10 @@
       if (empty($node)) {
         return parent::get_default_argument();
       }
-      else if ($this->options['default_argument_type'] == 'node_created') {
+      elseif ($this->options['default_argument_type'] == 'node_created') {
         return date($this->arg_format, $node->created);
       }
-      else if ($this->options['default_argument_type'] == 'node_changed') {
+      elseif ($this->options['default_argument_type'] == 'node_changed') {
         return date($this->arg_format, $node->changed);
       }
     }

=== modified file 'handlers/views_handler_argument_formula.inc'
--- handlers/views_handler_argument_formula.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_argument_formula.inc	2009-10-17 22:49:05 +0000
@@ -50,6 +50,6 @@
     // Now that our table is secure, get our formula.
     $formula = $this->get_formula();
 
-    $this->query->add_where(0, "$formula = '%s'", $this->argument);
+    $this->query->add_where(0, $formula, $this->argument);
   }
 }

=== modified file 'handlers/views_handler_argument_many_to_one.inc'
--- handlers/views_handler_argument_many_to_one.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_argument_many_to_one.inc	2009-10-17 22:49:05 +0000
@@ -75,7 +75,7 @@
   function query() {
     if (empty($this->argument)) {
       parent::ensure_my_table();
-      $this->query->add_where(0, "$this->table_alias.$this->real_field IS NULL");
+      $this->query->add_where(0, "$this->table_alias.$this->real_field", NULL, 'IS NULL');
       return;
     }
 

=== modified file 'handlers/views_handler_argument_numeric.inc'
--- handlers/views_handler_argument_numeric.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_argument_numeric.inc	2009-10-17 22:49:05 +0000
@@ -84,11 +84,11 @@
     if (count($this->value) > 1) {
       $operator = empty($this->options['not']) ? 'IN' : 'NOT IN';
       $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
-      $this->query->add_where(0, "$this->table_alias.$this->real_field $operator ($placeholders)", $this->value);
+      $this->query->add_where(0, "$this->table_alias.$this->real_field", $this->value, $operator);
     }
     else {
       $operator = empty($this->options['not']) ? '=' : '!=';
-      $this->query->add_where(0, "$this->table_alias.$this->real_field $operator %d", $this->argument);
+      $this->query->add_where(0, "$this->table_alias.$this->real_field", $this->argument, $operator);
     }
   }
 }

=== modified file 'handlers/views_handler_argument_string.inc'
--- handlers/views_handler_argument_string.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_argument_string.inc	2009-10-17 22:49:05 +0000
@@ -167,7 +167,7 @@
       $field = $this->get_formula();
     }
 
-    $this->query->add_where(0, "$field = '%s'", $argument);
+    $this->query->add_where(0, $field, $argument);
   }
 
   function summary_argument($data) {

=== modified file 'handlers/views_handler_field.inc'
--- handlers/views_handler_field.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_field.inc	2009-10-19 05:17:54 +0000
@@ -272,7 +272,7 @@
           'edit-options-alter-make-link' => array(1)
         ),
       );
-      
+
 
       // Get a list of the available fields and arguments for token replacement.
       $options = array();
@@ -302,7 +302,11 @@
             foreach ($options[$type] as $key => $value) {
               $items[] = $key . ' == ' . $value;
             }
-            $output .= theme('item_list', $items, $type);
+            $output .= theme('item_list',
+              array(
+                'items' => $items,
+                'type' => $type
+              ));
           }
         }
       }
@@ -458,7 +462,7 @@
           $this->original_value = $this->last_render;
 
           $alter = $item + $this->options['alter'];
-          $items[] = $this->render_text($alter);       
+          $items[] = $this->render_text($alter);
         }
 
         $value = $this->render_items($items);
@@ -511,7 +515,7 @@
 
     return $value;
   }
-  
+
   /**
    * Render this field as altered text, from a fieldset set by the user.
    */
@@ -603,7 +607,7 @@
 
     $class = strtr($alter['link_class'], $tokens);
     if ($class) {
-      $options['attributes']['class'] = $class;
+      $options['attributes']['class'] = array($class);
     }
 
     $target = check_plain(trim($alter['target']));
@@ -698,7 +702,12 @@
    * allows sites to override output fairly easily.
    */
   function theme($values) {
-    return theme($this->theme_functions(), $this->view, $this, $values);
+    return theme($this->theme_functions(),
+      array(
+        'view' => $this->view,
+        'field' => $this,
+        'row' => $values
+      ));
   }
 
   function theme_functions() {
@@ -740,8 +749,7 @@
   function query() { /* No query to run */ }
   function options_form(&$form, &$form_state) {
     $form['markup'] = array(
-      '#prefix' => '<div class="form-item description">',
-      '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
+      '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>',
     );
   }
 

=== modified file 'handlers/views_handler_field_date.inc'
--- handlers/views_handler_field_date.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_field_date.inc	2009-10-18 07:37:31 +0000
@@ -17,15 +17,14 @@
 
   function options_form(&$form, &$form_state) {
     parent::options_form($form, $form_state);
-    $time = time();
 
     $form['date_format'] = array(
       '#type' => 'select',
       '#title' => t('Date format'),
       '#options' => array(
-        'small' => format_date($time, 'small'),
-        'medium' => format_date($time, 'medium'),
-        'large' => format_date($time, 'large'),
+        'small' => format_date(REQUEST_TIME, 'small'),
+        'medium' => format_date(REQUEST_TIME, 'medium'),
+        'large' => format_date(REQUEST_TIME, 'large'),
         'custom' => t('Custom'),
         'raw time ago' => t('Time ago'),
         'time ago' => t('Time ago (with "ago" appended)'),
@@ -50,12 +49,12 @@
     if (in_array($format, array('custom', 'raw time ago', 'time ago', 'raw time span', 'time span'))) {
       $custom_format = $this->options['custom_date_format'];
     }
-    
+
     if (!$value) {
       return theme('views_nodate');
     }
     else {
-      $time_diff = time() - $value; // will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence)
+      $time_diff = REQUEST_TIME - $value; // will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence)
       switch ($format) {
         case 'raw time ago':
           return format_interval($time_diff, is_numeric($custom_format) ? $custom_format : 2);

=== modified file 'handlers/views_handler_field_markup.inc'
--- handlers/views_handler_field_markup.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_field_markup.inc	2009-10-18 08:27:41 +0000
@@ -29,7 +29,7 @@
   function render($values) {
     $value = $values->{$this->field_alias};
     $format = is_numeric($this->format) ? $this->format : $values->{$this->aliases['format']};
-    return check_markup($value, $format, FALSE);
+    return check_markup($value, $format, '');
   }
 
   function element_type() {

=== modified file 'handlers/views_handler_field_prerender_list.inc'
--- handlers/views_handler_field_prerender_list.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_field_prerender_list.inc	2009-10-18 19:50:53 +0000
@@ -57,7 +57,12 @@
         return implode(check_plain($this->options['separator']), $this->items[$field]);
       }
       else {
-        return theme('item_list', $this->items[$field], NULL, $this->options['type']);
+        return theme('item_list',
+          array(
+            'items' => $this->items[$field],
+            'title' => NULL,
+            'type' => $this->options['type']
+          ));
       }
     }
   }
@@ -74,7 +79,12 @@
         return implode(check_plain($this->options['separator']), $items);
       }
       else {
-        return theme('item_list', $items, NULL, $this->options['type']);
+        return theme('item_list',
+          array(
+            'items' => $this->items[$field],
+            'title' => NULL,
+            'type' => $this->options['type']
+          ));
       }
     }
   }
@@ -82,7 +92,7 @@
   /**
    * Return an array of items for the field.
    *
-   * Items should be stored in the result array, if possible, as an array 
+   * Items should be stored in the result array, if possible, as an array
    * with 'value' as the actual displayable value of the item, plus
    * any items that might be found in the 'alter' options array for
    * creating links, such as 'path', 'fragment', 'query' etc, such a thing
@@ -94,7 +104,7 @@
     if (!empty($this->items[$field])) {
       return $this->items[$field];
     }
-    
+
     return array();
   }
 

=== modified file 'handlers/views_handler_filter.inc'
--- handlers/views_handler_filter.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_filter.inc	2009-10-18 19:13:47 +0000
@@ -80,10 +80,10 @@
     if ($this->can_expose()) {
       $this->show_expose_button($form, $form_state);
     }
-    $form['op_val_start'] = array('#value' => '<div class="clear-block">');
+    $form['op_val_start'] = array('#markup' => '<div class="clearfix">');
     $this->show_operator_form($form, $form_state);
     $this->show_value_form($form, $form_state);
-    $form['op_val_end'] = array('#value' => '</div>');
+    $form['op_val_end'] = array('#markup' => '</div>');
     if ($this->can_expose()) {
       $this->show_expose_form($form, $form_state);
     }
@@ -488,7 +488,7 @@
    */
   function query() {
     $this->ensure_my_table();
-    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field " . $this->operator . " '%s'", $this->value);
+    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field", $this->value, $this->operator);
   }
 }
 
@@ -505,8 +505,7 @@
   function query() { /* No query to run */ }
   function options_form(&$form, &$form_state) {
     $form['markup'] = array(
-      '#prefix' => '<div class="form-item description">',
-      '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
+      '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>',
     );
   }
 

=== modified file 'handlers/views_handler_filter_date.inc'
--- handlers/views_handler_filter_date.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_filter_date.inc	2009-10-17 22:49:05 +0000
@@ -139,8 +139,7 @@
     }
     // %s is safe here because strtotime scrubbed the input and we might
     // have a string if using offset.
-    $this->query->add_where($this->options['group'], "$field >= %s", $a);
-    $this->query->add_where($this->options['group'], "$field <= %s", $b);
+    $this->query->add_where($this->options['group'], $field, array($a, $b), 'BETWEEN');
   }
 
   function op_simple($field) {
@@ -148,6 +147,6 @@
     if (!empty($this->value['type']) && $this->value['type'] == 'offset') {
       $value = '***CURRENT_TIME***' . sprintf('%+d', $value); // keep sign
     }
-    $this->query->add_where($this->options['group'], "$field $this->operator %s", $value);
+    $this->query->add_where($this->options['group'], $field, $value, $this->operator);
   }
 }

=== modified file 'handlers/views_handler_filter_float.inc'
--- handlers/views_handler_filter_float.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_filter_float.inc	2009-10-17 22:49:05 +0000
@@ -9,15 +9,14 @@
 class views_handler_filter_float extends views_handler_filter_numeric {
   function op_between($field) {
     if ($this->operator == 'between') {
-      $this->query->add_where($this->options['group'], "$field >= %f", $this->value['min']);
-      $this->query->add_where($this->options['group'], "$field <= %f", $this->value['max']);
+      $this->query->add_where($this->options['group'], $field, array($this->value['min'], $this->value['max']), 'BETWEEN');
     }
     else {
-      $this->query->add_where($this->options['group'], "$field <= %f OR $field >= %f", $this->value['min'], $this->value['max']);
+      $this->query->add_where($this->options['group'], db_or()->condition($field, $this->value['min'], '<=')->condition($field, $this->value['max'], '>='));
     }
   }
 
   function op_simple($field) {
-    $this->query->add_where($this->options['group'], "$field $this->operator %f", $this->value['value']);
+    $this->query->add_where($this->options['group'], $field, $this->value['value'], $this->operator);
   }
 }

=== modified file 'handlers/views_handler_filter_in_operator.inc'
--- handlers/views_handler_filter_in_operator.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_filter_in_operator.inc	2009-10-18 07:37:31 +0000
@@ -161,7 +161,7 @@
         if (!empty($this->options['expose']['optional']) && (empty($default_value) || !empty($this->options['expose']['reduce']))) {
           $default_value = 'All';
         }
-        else if (empty($default_value)) {
+        elseif (empty($default_value)) {
           $keys = array_keys($options);
           $default_value = array_shift($keys);
         }
@@ -228,14 +228,14 @@
         $options[$id] = $this->reduce_value_options($option);
         continue;
       }
-      else if (is_object($option)) {
+      elseif (is_object($option)) {
         $keys = array_keys($option->option);
         $key = array_shift($keys);
         if (isset($this->options['value'][$key])) {
           $options[$id] = $option;
         }
       }
-      else if (isset($this->options['value'][$id])) {
+      elseif (isset($this->options['value'][$id])) {
         $options[$id] = $option;
       }
     }
@@ -333,20 +333,14 @@
       return;
     }
     $this->ensure_my_table();
-    $placeholder = !empty($this->definition['numeric']) ? '%d' : "'%s'";
-
-    $replace = array_fill(0, sizeof($this->value), $placeholder);
-    $in = ' (' . implode(", ", $replace) . ')';
 
     // We use array_values() because the checkboxes keep keys and that can cause
     // array addition problems.
-    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field " . $this->operator . $in, array_values($this->value));
+    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field", array_values($this->value), $this->operator);
   }
 
   function op_empty() {
     $this->ensure_my_table();
-    $field = "$this->table_alias.$this->real_field";
-
     if ($this->operator == 'empty') {
       $operator = "IS NULL";
     }
@@ -354,6 +348,6 @@
       $operator = "IS NOT NULL";
     }
 
-    $this->query->add_where($this->options['group'], "$field $operator");
+    $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field", NULL, $operator);
   }
 }

=== modified file 'handlers/views_handler_filter_numeric.inc'
--- handlers/views_handler_filter_numeric.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_filter_numeric.inc	2009-10-18 07:37:31 +0000
@@ -155,7 +155,7 @@
         $form_state['input'][$identifier]['value'] = $this->value['value'];
       }
     }
-    else if ($which == 'value') {
+    elseif ($which == 'value') {
       // When exposed we drop the value-value and just do value if
       // the operator is locked.
       $form['value'] = array(
@@ -219,16 +219,15 @@
 
   function op_between($field) {
     if ($this->operator == 'between') {
-      $this->query->add_where($this->options['group'], "$field >= %d", $this->value['min']);
-      $this->query->add_where($this->options['group'], "$field <= %d", $this->value['max']);
+      $this->query->add_where($this->options['group'], $field, array($this->value['min'], $this->value['max']), 'BETWEEN');
     }
     else {
-      $this->query->add_where($this->options['group'], "$field <= %d OR $field >= %d", $this->value['min'], $this->value['max']);
+      $this->query->add_where($this->options['group'], db_or()->condition($field, $this->value['min'], '<=')->condition($field, $this->value['max'], '>='));
     }
   }
 
   function op_simple($field) {
-    $this->query->add_where($this->options['group'], "$field $this->operator %d", $this->value['value']);
+    $this->query->add_where($this->options['group'], $field, $this->value['value'], $this->operator);
   }
 
   function op_empty($field) {
@@ -239,7 +238,7 @@
       $operator = "IS NOT NULL";
     }
 
-    $this->query->add_where($this->options['group'], "$field $operator");
+    $this->query->add_where($this->options['group'], $field, NULL, $operator);
   }
 
   function admin_summary() {

=== modified file 'handlers/views_handler_filter_string.inc'
--- handlers/views_handler_filter_string.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_filter_string.inc	2009-10-18 07:37:31 +0000
@@ -216,8 +216,13 @@
     }
   }
 
-  function case_transform() {
-    return !empty($this->options['case']) ? '' : 'UPPER';
+  function operator() {
+    if (!empty($this->options['case'])) {
+      return $this->operator;
+    }
+    else {
+      return $this->operator == '=' ? 'LIKE' : 'NOT LIKE';
+    }
   }
 
   /**
@@ -230,25 +235,24 @@
   function query() {
     $this->ensure_my_table();
     $field = "$this->table_alias.$this->real_field";
-    $upper = $this->case_transform();
 
     $info = $this->operators();
     if (!empty($info[$this->operator]['method'])) {
-      $this->{$info[$this->operator]['method']}($field, $upper);
+      $this->{$info[$this->operator]['method']}($field);
     }
   }
 
-  function op_equal($field, $upper) {
-    // operator is either = or !=
-    $this->query->add_where($this->options['group'], "$upper(%s) $this->operator $upper('%s')", $field, $this->value);
+  function op_equal($field) {
+    $this->query->add_where($this->options['group'], $field, $this->value, $this->operator());
   }
 
-  function op_contains($field, $upper) {
-    $this->query->add_where($this->options['group'], "$upper(%s) LIKE $upper('%%%s%%')", $field, $this->value);
+  function op_contains($field) {
+    $this->query->add_where($this->options['group'], $field, "%$this->value%", 'LIKE');
   }
 
   function op_word($field, $upper) {
-    $where = array();
+    $where = $this->operator == 'word' ? db_or() : db_and();
+
     preg_match_all('/ (-?)("[^"]+"|[^" ]+)/i', ' ' . $this->value, $matches, PREG_SET_ORDER);
     foreach ($matches as $match) {
       $phrase = false;
@@ -260,9 +264,7 @@
       $words = trim($match[2], ',?!();:-');
       $words = $phrase ? array($words) : preg_split('/ /', $words, -1, PREG_SPLIT_NO_EMPTY);
       foreach ($words as $word) {
-        $where[] = "$upper(%s) LIKE $upper('%%%s%%')";
-        $values[] = $field;
-        $values[] = trim($word, " ,!?");
+        $where->condition($field, trim($word, " ,!?"), 'LIKE');
       }
     }
 
@@ -282,31 +284,31 @@
   }
 
   function op_starts($field, $upper) {
-    $this->query->add_where($this->options['group'], "$upper(%s) LIKE $upper('%s%%')", $field, $this->value);
+    $this->query->add_where($this->options['group'], "$upper($field)", $this->value . '%', 'LIKE');
   }
 
   function op_not_starts($field, $upper) {
-    $this->query->add_where($this->options['group'], "$upper(%s) NOT LIKE $upper('%s%%')", $field, $this->value);
+    $this->query->add_where($this->options['group'], "$upper($field)", $this->value . '%', 'NOT LIKE');
   }
 
   function op_ends($field, $upper) {
-    $this->query->add_where($this->options['group'], "$upper(%s) LIKE $upper('%%%s')", $field, $this->value);
+    $this->query->add_where($this->options['group'], "$upper($field)", '%' . $this->value, 'LIKE');
   }
 
   function op_not_ends($field, $upper) {
-    $this->query->add_where($this->options['group'], "$upper(%s) NOT LIKE $upper('%%%s')", $field, $this->value);
+    $this->query->add_where($this->options['group'], "$upper($field)", '%' . $this->value, 'NOT LIKE');
   }
 
   function op_not($field, $upper) {
-    $this->query->add_where($this->options['group'], "$upper(%s) NOT LIKE $upper('%%%s%%')", $field, $this->value);
+    $this->query->add_where($this->options['group'], "$upper($field)", '%' . $this->value . '%', 'NOT LIKE');
   }
-  
+
   function op_shorter($field, $upper) {
-    $this->query->add_where($this->options['group'], "LENGTH($upper(%s)) < %d", $field, $this->value);
+    $this->query->add_where($this->options['group'], "LENGTH($upper($field))", $this->value, '<');
   }
 
   function op_longer($field, $upper) {
-    $this->query->add_where($this->options['group'], "LENGTH($upper(%s)) > %d", $field, $this->value);
+    $this->query->add_where($this->options['group'], "LENGTH($upper($field))", $this->value, '>');
   }
 
   function op_empty($field) {
@@ -317,7 +319,7 @@
       $operator = "IS NOT NULL";
     }
 
-    $this->query->add_where($this->options['group'], "$field $operator");
+    $this->query->add_where($this->options['group'], $field, NULL, $operator);
   }
 
 }

=== modified file 'handlers/views_handler_relationship.inc'
--- handlers/views_handler_relationship.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_relationship.inc	2009-10-17 19:26:01 +0000
@@ -137,8 +137,7 @@
   function query() { /* No query to run */ }
   function options_form(&$form, &$form_state) {
     $form['markup'] = array(
-      '#prefix' => '<div class="form-item description">',
-      '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
+      '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>',
     );
   }
 

=== modified file 'handlers/views_handler_sort.inc'
--- handlers/views_handler_sort.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_sort.inc	2009-10-17 19:26:01 +0000
@@ -70,8 +70,7 @@
   function query() { /* No query to run */ }
   function options_form(&$form, &$form_state) {
     $form['markup'] = array(
-      '#prefix' => '<div class="form-item description">',
-      '#value' => t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.'),
+      '#markup' => '<div class="form-item description">' . t('The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.') . '</div>',
     );
   }
 

=== modified file 'handlers/views_handler_sort_random.inc'
--- handlers/views_handler_sort_random.inc	2009-10-17 18:33:18 +0000
+++ handlers/views_handler_sort_random.inc	2009-10-18 22:07:56 +0000
@@ -6,8 +6,7 @@
  */
 class views_handler_sort_random extends views_handler_sort {
   function query() {
-    global $db_type;
-    switch ($db_type) {
+    switch (db_driver()) {
       case 'mysql':
       case 'mysqli':
         $formula = 'RAND()';

=== modified file 'help/about.html'
--- help/about.html	2009-10-17 18:33:18 +0000
+++ help/about.html	2009-10-18 20:51:34 +0000
@@ -1,5 +1,5 @@
 <!-- $Id: about.html,v 1.5 2009/01/31 19:15:30 merlinofchaos Exp $ -->
-The views module allows administrators and site designers to create, manage, and display lists of content. Each list managed by the views module is known as a "view", and the output of a view is known as a "display". Displays are provided in either block or page form, and a single view may have multiple displays. Optional navigation aids, including a system path and menu item, can be set for each page-based display of a view. By default, views may be created that list content (a <em>Node</em> view type), content revisions (a <em>Node revisions</em> view type) or users (a <em>User</em> view type). A view may be restricted to members of specific user roles, and may be added, edited or deleted at the <a href="base_url:admin/build/views">views administration page</a>
+The views module allows administrators and site designers to create, manage, and display lists of content. Each list managed by the views module is known as a "view", and the output of a view is known as a "display". Displays are provided in either block or page form, and a single view may have multiple displays. Optional navigation aids, including a system path and menu item, can be set for each page-based display of a view. By default, views may be created that list content (a <em>Node</em> view type), content revisions (a <em>Node revisions</em> view type) or users (a <em>User</em> view type). A view may be restricted to members of specific user roles, and may be added, edited or deleted at the <a href="base_url:admin/structure/views">views administration page</a>
 
 The "building block" design of the views system provides power and flexibility, allowing parameters to be specified only when needed. While an advanced view may use all of available parameters to create complex and highly interactive applications, a simple content listing may specify only a few options. All views rely on a conceptual framework that includes:
 

=== modified file 'help/analyze-theme.html'
--- help/analyze-theme.html	2009-10-17 18:33:18 +0000
+++ help/analyze-theme.html	2009-10-18 07:37:31 +0000
@@ -4,9 +4,9 @@
   <li> The <strong>display</strong> theme is usually views-view.tpl.php and it largely controls the decorations around a view; where the header, footer, pager, more link, feed icon, etc, will be placed. </li>
 
   <li> The <strong>style</strong> will control how all of the results of the display are put together. It may be as simple as just displaying all of the rows, or it may be a complex table generator or something in between. </li>
-  
-  <li> The <strong>row</strong> style controls each individual row; not all styles utilize the row style (notably the table), but most others do. 
-  
+
+  <li> The <strong>row</strong> style controls each individual row; not all styles utilize the row style (notably the table), but most others do.
+
   <li> Finally, <strong>field</strong> themes allow you to override the look and even the data of each individual field, if the style uses fields. The actual template the system will use should be hilighted in <strong>bold</strong>.</li>
 </ul>
 

=== modified file 'help/api-default-views.html'
--- help/api-default-views.html	2009-10-17 18:33:18 +0000
+++ help/api-default-views.html	2009-10-18 07:37:31 +0000
@@ -90,8 +90,8 @@
       ),
 </pre>
 
-  The first one is the global 'template_preprocess' function which all templates utilize. It does some basic things such as setting up $zebra and a few other items. See <a href="http://api.drupal.org/api/function/template_preprocess/6">api.drupal.org</a> for specifics. 
-  
+  The first one is the global 'template_preprocess' function which all templates utilize. It does some basic things such as setting up $zebra and a few other items. See <a href="http://api.drupal.org/api/function/template_preprocess/6">api.drupal.org</a> for specifics.
+
   The second one is the plugin specific preprocess. Like 'original hook' it should conform to the name used by the original template. i.e, if the original template was <em>views-view-list.tpl.php</em> then that preprocess function would be named <em>template_preprocess_views_view_list</em>.
 
   The third one is your module's preprocess function, if it needs one. In general, you probably will not need one, and you should only attempt to use one if you are reasonably familiar with the concept of preprocess functions and Drupal's theme system in general. See Drupal's theme documentation for more information.

=== modified file 'help/api-example.html'
--- help/api-example.html	2009-10-17 18:33:18 +0000
+++ help/api-example.html	2009-10-18 07:37:31 +0000
@@ -5,13 +5,13 @@
 <pre>
 &lt;?php
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  *
- * This tells drupal that there is Views integration file named 
- * module-name.views.inc 
+ * This tells drupal that there is Views integration file named
+ * module-name.views.inc
  */
 function node_example_views_api() {
-  // Note that you can include 'path' in this array so that your views.inc 
+  // Note that you can include 'path' in this array so that your views.inc
   // file can be stored in a different location.
   return array(
     'api' => 2.0
@@ -24,7 +24,7 @@
 
 <pre>
 &lt;?php
-// $Id: api-example.html,v 1.1.2.1 2009/09/15 15:42:42 merlinofchaos Exp $ 
+// $Id: api-example.html,v 1.1.2.1 2009/09/15 15:42:42 merlinofchaos Exp $
 
 /**
  * This file is used to tell the views module about the new node_example table.
@@ -120,7 +120,7 @@
 
 <h3>Type/relationship extension</h3>
 
-When your tables have first class data, you will often need to have own View types and View relationships defined.  With the current node_example table this isn't required although I try to justify it below on an efficiency basis. See [[http://groups.drupal.org/node/17236#comment-58980|this discussion]] as to why it isn't justified. 
+When your tables have first class data, you will often need to have own View types and View relationships defined.  With the current node_example table this isn't required although I try to justify it below on an efficiency basis. See [[http://groups.drupal.org/node/17236#comment-58980|this discussion]] as to why it isn't justified.
 
 Pulling data out of the database for every node when you only want data for the new Example node type is inefficient.  To reduce the initial data extraction to just that relating to the new Example nodes requires that you make the node_example table the base table.  This can be done by adding the following code into the node_example.views.inc file just before the 'return $data;'
 
@@ -132,7 +132,7 @@
   //  Use node_example as a new base table
   //     by creating a new views type called 'Node example'
   //  This allows it to be selected as the 'view type'
-  //          when you initially add a new view. 
+  //          when you initially add a new view.
   $data['node_example']['table']['base'] = array(
     'field' => 'vid',
     'title' => t('Node example'),

=== modified file 'help/api-handlers.html'
--- help/api-handlers.html	2009-10-17 18:33:18 +0000
+++ help/api-handlers.html	2009-10-18 07:37:31 +0000
@@ -1,5 +1,5 @@
 <!-- $Id: api-handlers.html,v 1.4 2008/09/16 19:26:26 merlinofchaos Exp $ -->
-In Views, a handler is an object that is part of the view and is part of the query building flow. 
+In Views, a handler is an object that is part of the view and is part of the query building flow.
 
 Handlers are objects; much of the time, the base handlers will work, but often you'll need to override the handler for something. One typical handler override will be views_handler_filter_operator_in which allows you to have a filter select from a list of options; you'll need to override this to provide your list.
 
@@ -52,15 +52,7 @@
 
 Handlers are stored in their own files; for these files to be loaded by Views on demand, they must first be registered. Since Views core handlers are also loaded this way, it's imperative that your module also implement this pattern in order to prevent code crashes when your handler's parent class is not yet available.
 
-To register handlers, you must implement <strong>hook_views_handlers()</strong>. This hook returns an array with two keys; the first key is <em>info</em> which contains the modulename (which is only necessary if you're registering handlers on behalf of another module, such as what Views does) and <em>path</em>, which is the search path to find the files. This path is only necessary if your files will not be stored in the same directory as the .module file.
-
-The other key is <em>handlers</em> which contains a full array of handlers and the information for each handler. The key to each handler array is the name of the handler class. It can contain:
-<dl>
-<dt><strong>parent</strong></dt>
-<dd>The class that this handler extends. This is important to make sure that the parent class is included before your handler class. Without this, you may cause people's sites to crash in a difficult to recover state. Be sure you get this right!</dd>
-<dt><strong>file</strong></dt>
-<dd>The filename the handler is in. By default, this will be classname.inc -- however, you can have multiple similar handlers together in one file. However, because there is only one parent, please be sure that the parentage on these handlers matches! Otherwise you will run into whitescreens as not all parents will be loaded.</dd>
-</dl>
+To register handlers, you must implement <strong>hook_views_handlers()</strong>. This hook returns an array of handlers. Each element of the array is the name of a handler class.
 
 You can see examples of this function in any of the various module.views.inc files in the views modules directory.
 
@@ -68,4 +60,4 @@
 
 Please note that while all handler names in views are prefixed with views_, you should use your own module's name to prefix your handler names in order to ensure namespace safety. Note that the basic pattern for handler naming goes like this:
 
-[module]_handler_[type]_[tablename]_[fieldname]. Sometimes table and fieldname are not appropriate, but something that resembles what the table/field would be can be used.
\ No newline at end of file
+[module]_handler_[type]_[tablename]_[fieldname]. Sometimes table and fieldname are not appropriate, but something that resembles what the table/field would be can be used.

=== modified file 'help/api-plugins.html'
--- help/api-plugins.html	2009-10-17 18:33:18 +0000
+++ help/api-plugins.html	2009-10-17 19:26:01 +0000
@@ -58,14 +58,13 @@
       ),
 </code>
 
-Of particular interest is the <em>path</em> directive, which works a little differently from handler registration; each plugin must define its own path, rather than relying on a global info for the paths. Also, there is an optional <em>parent</em> directive which is automatically filled in to be the base parent for the plugin type. Usually this is enough, but if your plugin derives from something other than the base, it must be filled in. For example:
+Of particular interest is the <em>path</em> directive, which works a little differently from handler registration; each plugin must define its own path, rather than relying on a global info for the paths. For example:
 
 <code>
       'feed' => array(
         'title' => t('Feed'),
         'help' => t('Display the view as a feed, such as an RSS feed.'),
         'handler' => 'views_plugin_display_feed',
-        'parent' => 'page', // so it knows to load the page plugin .inc file
         'uses hook menu' => TRUE,
         'use ajax' => FALSE,
         'use pager' => FALSE,
@@ -75,6 +74,6 @@
       ),
 </code>
 
-Note that unlike handler registration, where parentage is referred to by object name, with plugins it is referred to by the unique plugin identifier. Please be sure to prefix your plugin identifiers with your module name to ensure namespace safety; after all, two different modules could try to implement the 'grid2' plugin, and that would cause one plugin to completely fail.
+Please be sure to prefix your plugin identifiers with your module name to ensure namespace safety; after all, two different modules could try to implement the 'grid2' plugin, and that would cause one plugin to completely fail.
 
 ...TODO: Finish this document....

=== modified file 'help/api-tables.html'
--- help/api-tables.html	2009-10-17 18:33:18 +0000
+++ help/api-tables.html	2009-10-18 07:37:31 +0000
@@ -52,7 +52,7 @@
 </pre>
 
 <h3>Base table</h3>
-If your table is a base table -- meaning it can be the primary, central table for a View to use, you can declare it to be a base table. This primarily provides UI information so that it can be selected. 
+If your table is a base table -- meaning it can be the primary, central table for a View to use, you can declare it to be a base table. This primarily provides UI information so that it can be selected.
 For example:
 <pre>
   // Advertise this table as a possible base table
@@ -64,7 +64,7 @@
   );
 </pre>
 
-The following tags are available in the 
+The following tags are available in the
 <dl>
 <dt>field</dt>
 <dd>The primary key field for this table. For Views to treat any table as a base table, it <b>must</b> have a primary field. For node this is the 'nid', for users this is the 'uid', etc. <strong>Without a single primary key field (i.e. not a composite key), Views will not be able to utilize the table as a base table.</strong> If your table does not have a primary key field, it is not too difficult to just add a serial field to it, usually.</dd>

=== modified file 'help/api.html'
--- help/api.html	2009-10-17 18:33:18 +0000
+++ help/api.html	2009-10-17 19:26:01 +0000
@@ -14,7 +14,7 @@
 <dt><strong>api</strong></dt>
 <dd>This must appear; it should be the oldest API version that your module can work with. If Views is currently running an older version of the API, it will ignore your module's views integration. This is a good thing, as it will prevent code crashes, at the expense of your module's functionality disappearing.
 <br />
-You may find the current Views API version by calling <strong>views_api_version()</strong> which is implemented at the top of views.module. This version numbering starts at 2.0. Every time changes are made to the Views handlers and plugins or other aspects of the Views API, the number will tick up (by either .001, .01 .1 or 1 depending upon how major the changes are). Note that <strong>views_api_version()</strong> was introduced in Views 2.0-rc2 and may not exist prior to that version. You may use function_exists() to test to see if this function is there.
+You may find the current Views API version by calling <strong>views_api_version()</strong> which is implemented at the top of views.module. This version numbering starts at 2.0. Every time changes are made to the Views handlers and plugins or other aspects of the Views API, the number will tick up (by either .001, .01 .1 or 1 depending upon how major the changes are). Note that <strong>views_api_version()</strong> was introduced in Views 2.0-rc2 and may not exist prior to that version. You may use drupal_function_exists() to test to see if this function is there.
 <br />
 Often these versions are basically compatible with each other and Views won't care if your module implements 2.000, 2.001, 2.002, etc. Your module can request that it won't work with any version older than a given version, however. Views will determine, itself, if a newer version will work.
 </dd>

=== modified file 'help/example-author-block.html'
--- help/example-author-block.html	2009-10-17 18:33:18 +0000
+++ help/example-author-block.html	2009-10-18 20:51:34 +0000
@@ -4,7 +4,7 @@
 <p>Before working through this example, enable the <strong>Blog</strong> module and populate some entries from a few different users.</p>
 
 <h3>Creating the View</h3>
-<p>The first step is creating a view for our recent blog entries block. Because the block will show the titles of blog entries, this view is considered a "Node" type. Go to <a target="_blank" href="/admin/build/views/add">add new view</a>, enter the following properties, and click <strong>Next</strong>:</p>
+<p>The first step is creating a view for our recent blog entries block. Because the block will show the titles of blog entries, this view is considered a "Node" type. Go to <a target="_blank" href="/admin/structure/views/add">add new view</a>, enter the following properties, and click <strong>Next</strong>:</p>
 
 <dl>
   <dt>View name</dt>
@@ -60,14 +60,14 @@
 <li>There's not much else to do here as far as Views is concerned. Under <strong>Block settings</strong>, click the <em>None</em> link next to <strong>Admin</strong> and fill in a description for the block in the administrative interface, such as: 'Recent blog entries by author.' and click <strong>Update</strong>.</li>
 <li>Save your work by clicking the <strong>Save</strong> button at the bottom of the Views interface. You should receive a message that the view has been saved.</li>
 <li>Next, navigate to the <a target="_blank" href="/admin/build/block">blocks interface</a> and drag the 'Recent blog entries by author' block to the right sidebar region (or similar) and click <strong>Save blocks</strong>.</li>
-<li>You'll notice this appeared to do nothing. No block shows in the sidebar. But remember, we are looking at an adminitrative page; we are not looking at a page that would provide a user ID context. Navigate to the <a target="_blank" href="/blog">main blog listing</a> and click on an entry there. You should now see a sidebar block, titled something like "Recent entries by admin," with a list of blog entries beneath it.</li> 
+<li>You'll notice this appeared to do nothing. No block shows in the sidebar. But remember, we are looking at an adminitrative page; we are not looking at a page that would provide a user ID context. Navigate to the <a target="_blank" href="/blog">main blog listing</a> and click on an entry there. You should now see a sidebar block, titled something like "Recent entries by admin," with a list of blog entries beneath it.</li>
 </ol>
 
 <h3>Finishing touches</h3>
 <p>There are still a few remaining things to do before our view is complete. For example, we said that the block was to show <em>recent</em> blog entries, but instead it's showing them in the order they were entered, with oldest on top. Additionally, even unpublished entries are showing in the list currently.</p>
 
 <ol>
-<li>Return to the <a target="_blank" href="/admin/build/views/edit/recent_blog_entries">recent_blog_entries view edit page</a>.</li>
+<li>Return to the <a target="_blank" href="/admin/structure/views/edit/recent_blog_entries">recent_blog_entries view edit page</a>.</li>
 <li>Add an additional filter by clicking the <strong>+</strong> icon in the <strong>Filters</strong> section in the fourth column.</li>
 <li>Change <strong>Groups</strong> to <em>Node</em> and select <em>Node: Published</em>. Click <strong>Add</strong>.</li>
 <li>Under the <strong>Published</strong> selection, choose <em>Yes</em> and click <strong>Update</strong>.</li>

=== modified file 'help/example-recent-stories.html'
--- help/example-recent-stories.html	2009-10-17 18:33:18 +0000
+++ help/example-recent-stories.html	2009-10-18 20:51:34 +0000
@@ -3,7 +3,7 @@
 
 <ol>
 <li><h3>Creating a new view</h3>
-<p>Go to <a target="_blank" href="base_url:admin/build/views/add">add new view</a>. Give your new view the name 'recent_stories', description 'Recent Stories', tag 'story', type 'Node' and click <strong>Next</strong>.</p></li>
+<p>Go to <a target="_blank" href="base_url:admin/structure/views/add">add new view</a>. Give your new view the name 'recent_stories', description 'Recent Stories', tag 'story', type 'Node' and click <strong>Next</strong>.</p></li>
 <li><h3>About the interface</h3>
 <p>You have been brought to Views User Interface. As you start, you are editing the "Default" options for the view. In the 1st column on the left you can see the drop-down menu offers 'block', for example, to select settings specific only to block views. In the remaining columns, you will be able to add or change options by clicking on links or icons. These options will then appear below this main area. Most likely, you will need to scroll a bit to see the options appear.</p></li>
 <li><h3>Selecting the fields to display</h3>

=== modified file 'help/example-user-feed.html'
--- help/example-user-feed.html	2009-10-17 18:33:18 +0000
+++ help/example-user-feed.html	2009-10-18 20:51:34 +0000
@@ -6,7 +6,7 @@
   <li>
     <h3>Creating a new view </h3>
     <ol>
-      <li>Go to <a target="_blank" href="/admin/build/views/add">add new view</a>. Give it the name 'user_feed', description 'A feed of user nodes.', tag 'users', type 'Node' and click Next.</li>
+      <li>Go to <a target="_blank" href="/admin/structure/views/add">add new view</a>. Give it the name 'user_feed', description 'A feed of user nodes.', tag 'users', type 'Node' and click Next.</li>
     </ol>
   </li>
   <li><strong>About the Interface.</strong> You have been brought to the Views User Interface. As you start, you are editing the &quot;Default&quot; options for the view. In the 1st column on the left- you can see the pull-down menu offers 'Feed', for example, to select settings specific only to RSS views. In the remaining columns, you will be able to add or change options by clicking on links or icons. These options appear below this main area. Most likely, you will need to scroll to see the options appear. As you make changes, these options will appear in bold until you save your view.</li>

=== modified file 'help/example-users-by-role.html'
--- help/example-users-by-role.html	2009-10-17 18:33:18 +0000
+++ help/example-users-by-role.html	2009-10-18 20:51:34 +0000
@@ -3,13 +3,13 @@
 
 <ol>
 <li><h3>Creating a new view</h3>
-<p>Go to <a target="_blank" href="base_url:admin/build/views/add">add new view</a>. Give your new view the name 'user_list', description 'A simple user listing.', tag 'users', type 'User' and click <strong>Next</strong>.</p></li>
+<p>Go to <a target="_blank" href="base_url:admin/structure/views/add">add new view</a>. Give your new view the name 'user_list', description 'A simple user listing.', tag 'users', type 'User' and click <strong>Next</strong>.</p></li>
 <li><h3>About the Interface</h3>
 <p>You have been brought to the Views User Interface. As you start, you are editing the "Default" options for the view. In the 1st column on the left you can see the drop-down menu offers 'block', for example, to select settings specific only to block views. In the remaining columns, you will be able to add or change options by clicking on links or icons. These options will then appear below this main area. Most likely, you will need to scroll to see the options appear. As you make changes, these options will appear in bold until you save your view.</p></li>
 <li><h3>Creating a page display; choosing a URL and creating a menu link</h3>
   <ol>
     <li>In the 1st column, ensure that 'Page' is selected in the drop-down menu, and click <strong>Add Display</strong>.</li>
-    <li>Next we'll define the path for this page. A page must have a path, and we define it early so that Views doesn't warn us "Display Page uses path but path is undefined." Locate the <strong>Page settings</strong> in the 2nd column, and click the <em>None</em> link next to the <em>Path</em> setting. In the options editing area that appears below, set the path to 'user_list' (or something else if you prefer) and click <strong>Update</strong>.</li>
+    <li>Next we'll define the path for this page. A page must have a path, and we define it early so that Views doesn't warn us "Display Page uses path but path is undefined." Locate the <strong>Page settings</strong> in the 2nd column, and click the <em>None</em> link next to the <em>Path</em> setting. In the options editing area that appears below, set the path to 'user_list' (or something Implement you prefer) and click <strong>Update</strong>.</li>
     <li>Next to <em>Menu</em> setting, Click the <em>No menu</em> link. In the options which appear below, select <em>Normal menu entry</em>, and set the title to 'User list' and click <strong>Update</strong>.</li>
     <li>Scroll up to <strong>Basic settings</strong>, in that same 2nd column, and click the <em>No</em> link next to <em>Use pager</em>. Below, in the options, select <em>Full pager</em> and click <strong>Update default display</strong>.</li>
   </ol>

=== modified file 'help/menu.html'
--- help/menu.html	2009-10-17 18:33:18 +0000
+++ help/menu.html	2009-10-18 07:37:31 +0000
@@ -14,7 +14,7 @@
 
 For example, if you have two views that you want to be tabs, you could set it up like this:
 <ul>
-<li> In the first view, set the path to 'tabs/tab1'. Set it to be the 'default tab', set the title to 'Tab 1' and the weight to 0. 
+<li> In the first view, set the path to 'tabs/tab1'. Set it to be the 'default tab', set the title to 'Tab 1' and the weight to 0.
 <li> Click update and you will be taken to a form that lets you define the parent. Since 'tabs' doesn't already exist in the system, select 'Normal menu item', and set the title to 'Tabs'.
 <li> On the second view, set the path to 'tabs/tab2'; set it to be a 'Menu tab', and set the title to 'Tab 2'.
 </ul>

=== modified file 'help/style-grid.html'
--- help/style-grid.html	2009-10-17 18:33:18 +0000
+++ help/style-grid.html	2009-10-18 07:37:31 +0000
@@ -8,7 +8,7 @@
 <tr><td>row 13</td><td>row 14</td><td>row 15</td><td>row 16</td></tr>
 </table>
 
-The above uses the 'horizontal' alignment, where rows are added into the grid from left to right. 
+The above uses the 'horizontal' alignment, where rows are added into the grid from left to right.
 
 With a vertical alignment, rows will be placed from top to bottom, like this:
 <table width="100%">

=== modified file 'help/style-list.html'
--- help/style-list.html	2009-10-17 18:33:18 +0000
+++ help/style-list.html	2009-10-18 07:37:31 +0000
@@ -16,6 +16,6 @@
 <li> Row 4 </li>
 </ol>
 
-The list style also uses a <em>row style</em> which means that it doesn't care what the actual output for each row of the view is. 
+The list style also uses a <em>row style</em> which means that it doesn't care what the actual output for each row of the view is.
 
 If you need information about using CSS to style list views, you may find this <a href="http://www.alistapart.com/stories/taminglists/">A list apart guide to styling lists</a> useful.
\ No newline at end of file

=== modified file 'help/theme-css.html'
--- help/theme-css.html	2009-10-17 18:33:18 +0000
+++ help/theme-css.html	2009-10-18 07:37:31 +0000
@@ -1,5 +1,5 @@
 <!-- $Id: theme-css.html,v 1.3 2008/07/01 22:34:25 merlinofchaos Exp $ -->
-Views uses a wide array of CSS classes on all of its content to ensure that you can easily and accurately select exactly the content you need in order to manipulate it with CSS. 
+Views uses a wide array of CSS classes on all of its content to ensure that you can easily and accurately select exactly the content you need in order to manipulate it with CSS.
 
 Typically, every view is wrapped in a div with the name of the view as part of its class (for all these examples, we will assume the name of the view is <strong>myview</strong>), as well as the generic class 'view':
 

=== modified file 'help/using-theme.html'
--- help/using-theme.html	2009-10-17 18:33:18 +0000
+++ help/using-theme.html	2009-10-18 07:37:31 +0000
@@ -28,7 +28,7 @@
 User: Name
 </code>
 
-The contents of the $row variable included these fields, in precisely the order that I had arranged them to using the Views rearrange link. Also worth noting, though, is that each field also has an identifier so it can easily be pulled out of the row should I want to display it differently. Using 
+The contents of the $row variable included these fields, in precisely the order that I had arranged them to using the Views rearrange link. Also worth noting, though, is that each field also has an identifier so it can easily be pulled out of the row should I want to display it differently. Using
 <code>&lt;?php print $row['title']; ?&gt;
 </code>
 

=== modified file 'help/views.help.ini'
--- help/views.help.ini	2009-10-17 18:33:18 +0000
+++ help/views.help.ini	2009-10-18 07:37:31 +0000
@@ -82,7 +82,7 @@
 
 [style]
 title = "Output styles (View styles)"
-weight = -20 
+weight = -20
 
 [style-row]
 title = "View row styles"

=== modified file 'includes/admin.inc'
--- includes/admin.inc	2009-10-17 18:33:18 +0000
+++ includes/admin.inc	2009-10-19 05:51:59 +0000
@@ -31,12 +31,13 @@
   }
 
   if (!module_exists('advanced_help')) {
-    $filename = db_result(db_query("SELECT filename FROM {system} WHERE type = 'module' AND name = 'advanced_help'"));
+    $filename = db_query_range("SELECT filename FROM {system} WHERE type = 'module' AND name = 'advanced_help'", 0, 1)
+      ->fetchField();
     if ($filename && file_exists($filename)) {
-      drupal_set_message(t('If you <a href="@modules">enable the advanced help module</a>, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('@modules' => url('admin/build/modules'),'@hide' => url('admin/build/views/tools'))));
+      drupal_set_message(t('If you <a href="@modules">enable the advanced help module</a>, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('@modules' => url('admin/build/modules'),'@hide' => url('admin/structure/views/tools'))));
     }
     else {
-      drupal_set_message(t('If you install the advanced help module from !href, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('!href' => l('http://drupal.org/project/advanced_help', 'http://drupal.org/project/advanced_help'), '@hide' => url('admin/build/views/tools'))));
+      drupal_set_message(t('If you install the advanced help module from !href, Views will provide more and better help. <a href="@hide">Hide this message.</a>', array('!href' => l('http://drupal.org/project/advanced_help', 'http://drupal.org/project/advanced_help'), '@hide' => url('admin/structure/views/tools'))));
     }
   }
 }
@@ -54,7 +55,7 @@
   // back to the base URL.
   if (isset($_GET['op']) && $_GET['op'] == t('Reset')) {
     unset($_SESSION['views']['#admin']);
-    drupal_goto('admin/build/views');
+    drupal_goto('admin/structure/views');
   }
   if (count($_GET) <= 1) {
     if (isset($_SESSION['views']['#admin']) && is_array($_SESSION['views']['#admin'])) {
@@ -75,8 +76,15 @@
   );
 
   $vars['widgets'] = drupal_build_form('views_ui_list_views_form', $form_state);
+  unset($vars['widgets']['form_id']);
+  unset($vars['widgets']['form_build_id']);
+  unset($vars['widgets']['form_token']);
+  $vars['widgets'] = drupal_render($vars['widgets']);
 
-  $vars['help_type_icon'] = theme('advanced_help_topic', 'views', 'view-type');
+  $vars['help_type_icon'] = '';
+  if (module_exists('advanced_help')) {
+    $vars['help_type_icon'] = theme('advanced_help_topic', array('topic' => 'views', 'type' => 'view-type'));
+  }
 
   $base_tables = views_fetch_base_tables();
 
@@ -87,7 +95,7 @@
           continue;
         }
       }
-      else if ($form_state['values']['tag'] != $view->tag) {
+      elseif ($form_state['values']['tag'] != $view->tag) {
         continue;
       }
     }
@@ -106,20 +114,20 @@
     $item = new stdClass();
     $item->ops = array();
     if (empty($view->disabled)) {
-      $item->ops[] = l(t('Edit'), "admin/build/views/edit/$view->name");
-      $item->ops[] = l(t('Export'), "admin/build/views/export/$view->name");
-      $item->ops[] = l(t('Clone'), "admin/build/views/clone/$view->name");
+      $item->ops[] = l(t('Edit'), "admin/structure/views/edit/$view->name");
+      $item->ops[] = l(t('Export'), "admin/structure/views/export/$view->name");
+      $item->ops[] = l(t('Clone'), "admin/structure/views/clone/$view->name");
     }
     if ($view->type != t('Default')) {
       $text = $view->type == t('Overridden') ? t('Revert') : t('Delete');
-      $item->ops[] = l($text, "admin/build/views/delete/$view->name");
+      $item->ops[] = l($text, "admin/structure/views/delete/$view->name");
     }
     else {
       if (empty($view->disabled)) {
-        $item->ops[] = l(t('Disable'), "admin/build/views/disable/$view->name", array('query' => drupal_get_destination()));
+        $item->ops[] = l(t('Disable'), "admin/structure/views/disable/$view->name", array('query' => drupal_get_destination()));
       }
       else {
-        $item->ops[] = l(t('Enable'), "admin/build/views/enable/$view->name", array('query' => drupal_get_destination()));
+        $item->ops[] = l(t('Enable'), "admin/structure/views/enable/$view->name", array('query' => drupal_get_destination()));
       }
     }
 
@@ -200,7 +208,10 @@
   views_add_css('views-list');
   $vars['views'] = $i;
 
-  $getting_started = theme('advanced_help_topic', 'views', 'getting-started', 'title');
+  $getting_started = '';
+  if (module_exists('advanced_help')) {
+    $getting_started = theme('advanced_help_topic', array('topic' => 'views', 'type' => 'getting-started', 'extra' => 'title'));
+  }
   if (!$getting_started) {
     $getting_started = t('Install the advanced help module for the getting started');
   }
@@ -211,7 +222,7 @@
 /**
  * Provide a form for sorting and filtering the list of views.
  */
-function views_ui_list_views_form(&$form_state) {
+function views_ui_list_views_form($form, &$form_state) {
   if (!variable_get('clean_url', FALSE)) {
     $form['q'] = array(
       '#type' => 'hidden',
@@ -249,9 +260,11 @@
   $tags = array();
 
   $extras = array();
-  foreach ($form_state['views'] as $name => $view) {
-    if (!empty($view->tag)) {
-      $tags[$view->tag] = $view->tag;
+  if (isset($form_state['views'])) {
+    foreach ($form_state['views'] as $name => $view) {
+      if (!empty($view->tag)) {
+        $tags[$view->tag] = $view->tag;
+      }
     }
   }
 
@@ -319,18 +332,9 @@
     );
   }
 
-  $form['#theme'] = array('views_ui_list_views_form');
   return $form;
 }
 
-function theme_views_ui_list_views_form($form) {
-  // Don't render these:
-  unset($form['form_id']);
-  unset($form['form_build_id']);
-  unset($form['form_token']);
-  return drupal_render($form);
-}
-
 /**
  * Page callback for the live preview.
  *
@@ -353,7 +357,7 @@
     'ajax' => $js
   );
 
-  $output = drupal_build_form('views_ui_preview_form', $form_state);
+  $output = drupal_render(drupal_build_form('views_ui_preview_form', $form_state));
   $args = array();
   if (isset($form_state['view_args']) && $form_state['view_args'] !== '') {
     $args = explode('/', $form_state['view_args']);
@@ -373,7 +377,7 @@
     }
 
     // Make view links come back to preview.
-    $view->override_path = 'admin/build/views/nojs/preview/' . $view->name . '/' . $form_state['display_id'];
+    $view->override_path = 'admin/structure/views/nojs/preview/' . $view->name . '/' . $form_state['display_id'];
 
     // also override $_GET['q'] so we get the pager
     $_GET['q'] = $view->override_path;
@@ -386,12 +390,8 @@
     // Get information from the preview for display.
     if (!empty($view->build_info['query'])) {
       $rows = array();
-      $query = db_prefix_tables($view->build_info['query']);
-      if ($view->build_info['query_args']) {
-        _db_query_callback($view->build_info['query_args'], TRUE);
-        $query = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $query);
-      }
-      $rows[] = array('<strong>' . t('Query') . '</strong>', '<pre>' . check_plain($query) . '</pre>');
+      $query = $view->build_info['query'];
+      $rows[] = array('<strong>' . t('Query') . '</strong>', '<pre>' . check_plain((string) $query) . '</pre>');
       if (!empty($view->additional_queries)) {
         $queries = '<strong>' . t('These queries were run during view rendering:') . '</strong>';
         foreach ($view->additional_queries as $query) {
@@ -419,10 +419,10 @@
       $rows[] = array('<strong>' . t('View render time') . '</strong>', t('@time ms', array('@time' => intval($view->render_time * 100000) / 100)));
       drupal_alter('views_preview_info', $rows, $view);
 
-      $info = theme('table', array(), $rows);
+      $info = theme('table', array('rows' => $rows));
     }
     else {
-      $info = theme('table', array(), array(array('<strong>' . t('Query') . '</strong>', t('No query was run'))));
+      $info = theme('table', array('rows' => array(array('<strong>' . t('Query') . '</strong>', t('No query was run')))));
     }
   }
   else {
@@ -449,24 +449,26 @@
   }
   else {
     views_include('ajax');
-    $object = new stdClass();
+    $commands = array();
     if (!empty($view->js_settings)) {
-      $object->js = $view->js_settings;
+      $commands[] = ajax_command_settings($view->js_settings);
     }
-    $object->display = '';
+    $display = '';
     if ($messages = theme('status_messages')) {
-      $object->display = '<div class="views-messages">' . $messages . '</div>';
-    }
-    $object->display .= $output;
-    $object->title = $view->get_title();
-    views_ajax_render($object);
+      $display = '<div class="views-messages">' . $messages . '</div>';
+    }
+    $display .= $output;
+    if ($display) {
+      $commands[] = views_ajax_command_set_form($display, $view->get_title());
+    }
+    ajax_render($commands);
   }
 }
 
 /**
  * Form for generating argument information for the live preview.
  */
-function views_ui_preview_form(&$form_state) {
+function views_ui_preview_form($form, &$form_state) {
   $view = &$form_state['view'];
   $view->init_display();
   $options = array();
@@ -475,7 +477,7 @@
   }
 
   $form['#attributes'] = array(
-    'class' => 'clear-block',
+    'class' => array('clearfix'),
   );
 
   $form['display_id'] = array(
@@ -500,7 +502,7 @@
     '#id' => 'preview-submit',
   );
 
-  $form['#action'] = url("admin/build/views/nojs/preview/$view->name");
+  $form['#action'] = url("admin/structure/views/nojs/preview/$view->name");
   return $form;
 }
 
@@ -523,7 +525,7 @@
     'view' => NULL
   );
 
-  return drupal_build_form('views_ui_add_form', $form_state);
+  return drupal_render(drupal_build_form('views_ui_add_form', $form_state));
 }
 
 /**
@@ -534,14 +536,14 @@
     'view' => $view->copy(),
   );
 
-  drupal_set_title(t('Clone view %view', array('%view' => $view->name)));
-  return drupal_build_form('views_ui_add_form', $form_state);
+  drupal_set_title(t('Clone view %view', array('%view' => $view->name)), PASS_THROUGH);
+  return drupal_render(drupal_build_form('views_ui_add_form', $form_state));
 }
 
 /**
  * Form constructor callback to create the views Add Form, phase 1.
  */
-function views_ui_add_form(&$form_state) {
+function views_ui_add_form($form, &$form_state) {
   $view = $form_state['view'];
   $form = array();
 
@@ -628,17 +630,17 @@
   }
 
   views_ui_cache_set($view);
-  $form_state['redirect'] ='admin/build/views/edit/' . $view->name;
+  $form_state['redirect'] ='admin/structure/views/edit/' . $view->name;
 }
 
 /**
  * Page to delete a view.
  */
-function views_ui_delete_confirm(&$form_state, $view) {
+function views_ui_delete_confirm($form, &$form_state, $view) {
   $form_state['view'] = &$view;
   $form = array();
 
-  $cancel = 'admin/build/views';
+  $cancel = 'admin/structure/views';
   if (!empty($_REQUEST['cancel'])) {
     $cancel = $_REQUEST['cancel'];
   }
@@ -669,13 +671,13 @@
   $form_state['view']->delete();
   views_object_cache_clear('view', $form_state['view']->name);
   drupal_set_message(t('The view has been deleted.'));
-  $form_state['redirect'] = 'admin/build/views';
+  $form_state['redirect'] = 'admin/structure/views';
 }
 
 /**
  * Page to delete a view.
  */
-function views_ui_break_lock_confirm(&$form_state, $view) {
+function views_ui_break_lock_confirm($form, &$form_state, $view) {
   $form_state['view'] = &$view;
   $form = array();
 
@@ -683,7 +685,7 @@
     return t('There is no lock on view %view to break.', array('%name' => $view->name));
   }
 
-  $cancel = 'admin/build/views/edit/' . $view->name;
+  $cancel = 'admin/structure/views/edit/' . $view->name;
   if (!empty($_REQUEST['cancel'])) {
     $cancel = $_REQUEST['cancel'];
   }
@@ -693,7 +695,7 @@
                   t('Are you sure you want to break the lock on view %name?',
                   array('%name' => $view->name)),
                   $cancel,
-                  t('By breaking this lock, any unsaved changes made by !user will be lost!', array('!user' => theme('username', $account))),
+                  t('By breaking this lock, any unsaved changes made by !user will be lost!', array('!user' => theme('username', array('account' => $account)))),
                   t('Break lock'),
                   t('Cancel'));
 }
@@ -702,8 +704,11 @@
  * Submit handler to break_lock a view.
  */
 function views_ui_break_lock_confirm_submit(&$form, &$form_state) {
-  db_query("DELETE FROM {views_object_cache} WHERE obj = 'view' AND name = '%s'", $form_state['view']->name);
-  $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
+  db_delete('views_object_cache')
+    ->condition('obj', 'view')
+    ->condition('name', $form_state['view']->name)
+    ->execute();
+  $form_state['redirect'] = 'admin/structure/views/edit/' . $form_state['view']->name;
   drupal_set_message(t('The lock has been broken and you may now edit this view.'));
 }
 
@@ -711,8 +716,8 @@
  * The main view edit page
  */
 function views_ui_edit_page($view) {
-  drupal_set_title(t('Edit view %view', array('%view' => $view->name)));
-  $output = theme('views_ui_edit_view', $view);
+  drupal_set_title(t('Edit view %view', array('%view' => $view->name)), PASS_THROUGH);
+  $output = theme('views_ui_edit_view', array('view' => $view));
   views_ui_check_advanced_help();
   return $output;
 }
@@ -720,7 +725,7 @@
 /**
  * Export a view for cut & paste.
  */
-function views_ui_export_page(&$form_state, $view) {
+function views_ui_export_page($form, &$form_state, $view) {
   $code = $view->export();
   $lines = substr_count($code, "\n");
   $form['code'] = array(
@@ -735,7 +740,7 @@
 /**
  * Import a view from cut & paste
  */
-function views_ui_import_page(&$form_state) {
+function views_ui_import_page($form, &$form_state) {
   $form['name'] = array(
     '#type' => 'textfield',
     '#title' => t('View name'),
@@ -813,7 +818,7 @@
       drupal_set_message(t('Style plugin @plugin is not available.', array('@plugin' => $display->handler->get_option('style_plugin'))), 'error');
       $broken = TRUE;
     }
-    else if ($plugin->uses_row_plugin()) {
+    elseif ($plugin->uses_row_plugin()) {
       $plugin = views_get_plugin('row', $display->handler->get_option('row_plugin'));
       if (!$plugin) {
         drupal_set_message(t('Row plugin @plugin is not available.', array('@plugin' => $display->handler->get_option('row_plugin'))), 'error');
@@ -851,13 +856,13 @@
 function views_ui_import_submit($form, &$form_state) {
   // Store in cache and then go to edit.
   views_ui_cache_set($form_state['view']);
-  $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
+  $form_state['redirect'] = 'admin/structure/views/edit/' . $form_state['view']->name;
 }
 
 /**
  * The main edit view form, which is really just a save/cancel/delete button.
  */
-function views_ui_edit_view_form(&$form_state, $view) {
+function views_ui_edit_view_form($form, &$form_state, $view) {
   $form['buttons']['save'] = array(
     '#type' => 'submit',
     '#value' => t('Save'),
@@ -936,14 +941,14 @@
   if (empty($form['view']->vid)) {
     // I seem to have to drupal_goto here because I can't get fapi to
     // honor the redirect target. Not sure what I screwed up here.
-    drupal_goto('admin/build/views');
+    drupal_goto('admin/structure/views');
   }
 }
 
 function views_ui_edit_view_form_delete($form, &$form_state) {
   unset($_REQUEST['destination']);
   // Redirect to the delete confirm page
-  $form_state['redirect'] = array('admin/build/views/delete/' . $form_state['view']->name, 'cancel=admin/build/views/edit/' . $form_state['view']->name);
+  $form_state['redirect'] = array('admin/structure/views/delete/' . $form_state['view']->name, 'cancel=admin/structure/views/edit/' . $form_state['view']->name);
 }
 
 /**
@@ -951,8 +956,9 @@
  */
 function template_preprocess_views_ui_edit_view(&$vars) {
   $view = &$vars['view'];
+  views_add_js('dependent');
 
-  $vars['save_button'] = drupal_get_form('views_ui_edit_view_form', $view);
+  $vars['save_button'] = drupal_render(drupal_get_form('views_ui_edit_view_form', $view));
 
   $table = views_fetch_data($view->base_table);
   $vars['base_table'] = !empty($table['table']['base']['title']) ?
@@ -979,8 +985,8 @@
     'ajax' => FALSE,
   );
 
-  $display_button = drupal_build_form('views_ui_add_display_form', $form_state);
-  $analyze_button = drupal_get_form('views_ui_analyze_view_button', $view);
+  $display_button = drupal_render(drupal_build_form('views_ui_add_display_form', $form_state));
+  $analyze_button = drupal_render(drupal_get_form('views_ui_analyze_view_button', $view));
   $tabs->add_extra($display_button . $analyze_button);
 
   $vars['tabs'] = $tabs->render();
@@ -993,26 +999,28 @@
     'view' => &$view,
     'input' => array(),
   );
-  $vars['preview'] = drupal_build_form('views_ui_preview_form', $form_state);
+  $vars['preview'] = drupal_render(drupal_build_form('views_ui_preview_form', $form_state));
 
   $vars['locked'] = NULL;
   if (isset($view->locked) && is_object($view->locked)) {
-    $account = user_load($view->locked->uid);
-    $vars['locked'] = theme('username', $account);
-    $vars['lock_age'] = format_interval(time() - $view->locked->updated);
-    $vars['break'] = url('admin/build/views/break-lock/' . $view->name);
+    $account = array();
+    $account['account'] = user_load($view->locked->uid);
+    $account['name'] = $account['account']->name;
+    $vars['locked'] = theme('username', array($account));
+    $vars['lock_age'] = format_interval(REQUEST_TIME - $view->locked->updated);
+    $vars['break'] = url('admin/structure/views/break-lock/' . $view->name);
   }
 
   $vars['quick_links_raw'] = array(
     array(
       'title' => t('Export'),
       'alt' => t("Export this view"),
-      'href' => "admin/build/views/export/$view->name",
+      'href' => "admin/structure/views/export/$view->name",
     ),
     array(
       'title' => t('Clone'),
       'alt' => t("Create a copy of this view"),
-      'href' => "admin/build/views/clone/$view->name",
+      'href' => "admin/structure/views/clone/$view->name",
     ),
   );
 
@@ -1032,7 +1040,7 @@
     }
   }
 
-  $vars['quick_links'] = theme('links', $vars['quick_links_raw']);
+  $vars['quick_links'] = theme('links', array('links' => $vars['quick_links_raw']));
   views_add_css('views-admin');
   views_add_css('views');
   views_add_js('ajax');
@@ -1075,7 +1083,7 @@
       unset($_POST['form_id']);
     }
     $form_state = array('view' => &$view, 'display_id' => $display->id, 'ajax' => FALSE);
-    $vars['remove'] = drupal_build_form('views_ui_remove_display_form', $form_state);
+    $vars['remove'] = drupal_render(drupal_build_form('views_ui_remove_display_form', $form_state));
   }
 
   // basic fields
@@ -1090,7 +1098,7 @@
   }
 
   $tag = empty($view->tag) ? t('None') : $view->tag;
-  $vars['details'] = t('Tag') . ': ' . l($tag, "admin/build/views/nojs/details/$view->name", array('attributes' => array('class' => 'views-ajax-link')));
+  $vars['details'] = t('Tag') . ': ' . l($tag, "admin/structure/views/nojs/details/$view->name", array('attributes' => array('class' => array('views-ajax-link'), 'id' => 'views-tag')));
 
   // Calculate options from display plugin.
   $options = $categories = array();
@@ -1132,7 +1140,7 @@
         }
       }
     }
-    $data['class'] = views_ui_item_css($display_id . '-' . $id);
+    $data['class'][] = views_ui_item_css($display_id . '-' . $id);
     if (!empty($view->changed_sections[$display_id . '-' . $id])) {
       $data['changed'] = TRUE;
     }
@@ -1141,8 +1149,8 @@
   $vars['categories'] = $categories;
 
   // Add a help icon
-  if (isset($plugin['help topic'])) {
-    $vars['display_help_icon'] = theme('advanced_help_topic', $plugin['module'], $plugin['help topic']);
+  if (isset($plugin['help topic']) && module_exists('advanced_help')) {
+    $vars['display_help_icon'] = theme('advanced_help_topic', array('topic' => $plugin['module'], 'type' => $plugin['help topic']));
   }
   else {
     $vars['display_help_icon'] = '';
@@ -1152,11 +1160,11 @@
   $style_plugin = $display->handler->get_plugin();
 
   $vars['fields'] = '';
-  $vars['fields'] = theme('views_ui_edit_item', 'field', $view, $display, !($style_plugin && $style_plugin->uses_fields()));
-  $vars['relationships'] = theme('views_ui_edit_item', 'relationship', $view, $display);
-  $vars['arguments'] = theme('views_ui_edit_item', 'argument', $view, $display);
-  $vars['filters'] = theme('views_ui_edit_item', 'filter', $view, $display);
-  $vars['sorts'] = theme('views_ui_edit_item', 'sort', $view, $display);
+  $vars['fields'] = theme('views_ui_edit_item', array('type' => 'field', 'view' => $view, 'display' => $display, 'no_fields' => !($style_plugin && $style_plugin->uses_fields())));
+  $vars['relationships'] = theme('views_ui_edit_item', array('type' => 'relationship', 'view' => $view, 'display' => $display));
+  $vars['arguments'] = theme('views_ui_edit_item', array('type' => 'argument', 'view' => $view, 'display' => $display));
+  $vars['filters'] = theme('views_ui_edit_item', array('type' => 'filter', 'view' => $view, 'display' => $display));
+  $vars['sorts'] = theme('views_ui_edit_item', array('type' => 'sort', 'view' => $view, 'display' => $display));
 }
 
 /**
@@ -1178,7 +1186,7 @@
     return FALSE;
   }
 
-  $body = theme('views_ui_edit_tab', $view, $display);
+  $body = theme('views_ui_edit_tab', array('view' => $view, 'display' => $display));
   return array($display->display_title, $body);
 }
 
@@ -1194,18 +1202,18 @@
 
   $vars['overridden'] = FALSE;
   $vars['defaulted'] = FALSE;
+  $vars['item_help_icon'] = module_exists('advanced_help') ? theme('advanced_help_topic', array('topic' => 'views', 'type' => $type)) : '';
 
   if ($vars['no_fields']) {
     $vars['title'] = $types[$type]['title'];
-    $vars['item_help_icon'] = theme('advanced_help_topic', 'views', $type);
     $vars['rearrange'] = NULL;
     $vars['add'] = NULL;
     return;
   }
 
-  $vars['rearrange'] = l('<span>' . t('Rearrange') . '</span>', "admin/build/views/nojs/rearrange/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-button-rearrange views-ajax-link', 'title' => t('Rearrange')), 'html' => true));
+  $vars['rearrange'] = l('<span>' . t('Rearrange') . '</span>', "admin/structure/views/nojs/rearrange/$view->name/$display->id/$type", array('attributes' => array('class' => array('views-button-rearrange', 'views-ajax-link'), 'title' => t('Rearrange'), 'id' => 'views-rearrange-' . $type), 'html' => true));
 
-  $vars['add'] = l('<span>' . t('Add') . '</span>', "admin/build/views/nojs/add-item/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-button-add views-ajax-link', 'title' => t('Add')), 'html' => true));
+  $vars['add'] = l('<span>' . t('Add') . '</span>', "admin/structure/views/nojs/add-item/$view->name/$display->id/$type", array('attributes' => array('class' => array('views-button-add', 'views-ajax-link'), 'title' => t('Add'), 'id' => 'views-add-' . $type), 'html' => true));
 
   if (!$display->handler->is_default_display()) {
     if (!$display->handler->is_defaulted($types[$type]['plural'])) {
@@ -1216,8 +1224,7 @@
     }
   }
 
-  $vars['title'] = l($types[$type]['title'], "admin/build/views/nojs/config-type/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-ajax-link')));
-//  $vars['title'] = l($types[$type]['title'], "admin/build/views/nojs/config-type/$view->name/$display->id/$type", array('attributes' => array('class' => 'views-ajax-link')));
+  $vars['title'] = l($types[$type]['title'], "admin/structure/views/nojs/config-type/$view->name/$display->id/$type", array('attributes' => array('class' => array('views-ajax-link'), 'id' => 'views-title-' . $type)));
 
   $fields = array();
 
@@ -1242,7 +1249,7 @@
 
     $handler = views_get_handler($field['table'], $field['field'], $type);
     if (empty($handler)) {
-      $fields[$id]['class'] = 'broken';
+      $fields[$id]['class'][] = 'broken';
       $fields[$id]['title'] = t("Error: handler for @table > @field doesn't exist!", array('@table' => $field['table'], '@field' => $field['field']));
       $fields[$id]['info'] = '';
       continue;
@@ -1254,15 +1261,15 @@
       $field_name = '(' . $relationships[$field['relationship']] . ') ' . $field_name;
     }
 
-    $fields[$id]['title'] = l($field_name, "admin/build/views/nojs/config-item/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-ajax-link'), 'html' => TRUE));
-    $fields[$id]['class'] = views_ui_item_css($display->id . '-' . $type . '-' . $id);
+    $fields[$id]['title'] = l($field_name, "admin/structure/views/nojs/config-item/$view->name/$display->id/$type/$id", array('attributes' => array('class' => array('views-ajax-link')), 'html' => TRUE));
+    $fields[$id]['class'][] = views_ui_item_css($display->id . '-' . $type . '-' . $id);
     if (!empty($view->changed_sections[$display->id . '-' . $type . '-' . $id])) {
       $fields[$id]['changed'] = TRUE;
     }
     $fields[$id]['info'] = $handler->admin_summary();
 
     if ($handler->has_extra_options()) {
-      $fields[$id]['links'] = l('<span>' . t('Settings') . '</span>', "admin/build/views/nojs/config-item-extra/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => t('Settings')), 'html' => true));
+      $fields[$id]['links'] = l('<span>' . t('Settings') . '</span>', "admin/structure/views/nojs/config-item-extra/$view->name/$display->id/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => t('Settings')), 'html' => true));
     }
 
     if ($handler->needs_style_plugin()) {
@@ -1271,11 +1278,11 @@
       $pid = $id . '-style-plugin';
 
       if (!empty($style_plugin['uses options'])) {
-        $fields[$pid]['links'] = l('<span>' . t('Change settings for this style') . '</span>', "admin/build/views/nojs/config-style/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-button-configure views-ajax-link', 'title' => t('Settings')), 'html' => true));
+        $fields[$pid]['links'] = l('<span>' . t('Change settings for this style') . '</span>', "admin/structure/views/nojs/config-style/$view->name/$display->id/$type/$id", array('attributes' => array('class' => array('views-button-configure', 'views-ajax-link'), 'title' => t('Settings')), 'html' => true));
       }
 
-      $fields[$pid]['title'] = ' ' . t('&nbsp; Style: !style', array('!style' => l($style_title, "admin/build/views/nojs/change-style/$view->name/$display->id/$type/$id", array('attributes' => array('class' => 'views-ajax-link')))));
-      $fields[$pid]['class'] = views_ui_item_css($display->id . '-' . $type . '-' . $pid);
+      $fields[$pid]['title'] = ' ' . t('&nbsp; Style: !style', array('!style' => l($style_title, "admin/structure/views/nojs/change-style/$view->name/$display->id/$type/$id", array('attributes' => array('class' => array('views-ajax-link'))))));
+      $fields[$pid]['class'][] = views_ui_item_css($display->id . '-' . $type . '-' . $pid);
       if (!empty($view->changed_sections[$display->id . '-' . $type . '-' . $pid])) {
         $fields[$pid]['changed'] = TRUE;
       }
@@ -1284,13 +1291,12 @@
   }
 
   $vars['fields'] = $fields;
-  $vars['item_help_icon'] = theme('advanced_help_topic', 'views', $type);
 }
 
 /**
  * Regenerate the tabs for AJAX updates.
  */
-function views_ui_regenerate_tabs(&$view, $display_id = NULL, $object = NULL) {
+function views_ui_regenerate_tabs(&$view, &$output, $display_id = NULL) {
   if (empty($display_id)) {
     $displays = array_keys($view->display);
   }
@@ -1305,25 +1311,14 @@
   }
 
   if (!$view->set_display('default')) {
-    views_ajax_render(t('Invalid display id found while regenerating tabs'));
-  }
-
-  if (!is_object($object)) {
-    $object = new stdClass();
-  }
-
-  $object->replace = array();
+    return;
+  }
+
   foreach ($displays as $id) {
     list($title, $body) = views_ui_display_tab($view, $view->display[$id]);
-    $object->replace['#views-tab-' . $id] = $body;
-    $object->replace['#views-tab-title-' . $id] = check_plain($title);
-  }
-
-  if (!empty($view->changed)) {
-    $object->changed = TRUE;
-  }
-
-  views_ajax_render($object);
+    $output[] = ajax_command_html('#views-tab-' . $id, $body);
+    $output[] = ajax_command_html('#views-tab-title-' . $id, check_plain($title));
+  }
 }
 
 /**
@@ -1333,7 +1328,7 @@
  */
 function views_ui_standard_form_buttons(&$form, &$form_state, $form_id, $name = NULL, $third = NULL, $submit = NULL) {
   $form['buttons'] = array(
-    '#prefix' => '<div class="clear-block"><div class="form-buttons">',
+    '#prefix' => '<div class="clearfix"><div class="form-buttons">',
     '#suffix' => '</div></div>',
   );
 
@@ -1407,7 +1402,9 @@
   if (!empty($form['#title'])) {
     drupal_set_title($form['#title']);
   }
-  views_add_css('views-admin');
+  $form['#attached']['css'] = array(
+    drupal_get_path('module', 'views') . "/css/views-admin.css",
+  );
 }
 
 /**
@@ -1423,7 +1420,7 @@
  * Submit handler for cancel button
  */
 function views_ui_standard_cancel($form, &$form_state) {
-  $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
+  $form_state['redirect'] = 'admin/structure/views/edit/' . $form_state['view']->name;
 }
 
 // --------------------------------------------------------------------------
@@ -1523,7 +1520,7 @@
   $form = views_ui_ajax_forms($form_state['form_key']);
   $ajax = empty($form_state['ajax']) ? 'nojs' : 'ajax';
   $name = $form_state['view']->name;
-  $url = "admin/build/views/$ajax/$form_state[form_key]/$name/$form_state[display_id]";
+  $url = "admin/structure/views/$ajax/$form_state[form_key]/$name/$form_state[display_id]";
   foreach ($form['args'] as $arg) {
     $url .= '/' . $form_state[$arg];
   }
@@ -1558,6 +1555,7 @@
  */
 function views_ui_ajax_form($js, $key, &$view, $display_id) {
   $form = views_ui_ajax_forms($key);
+  $js = $js == 'ajax';
   if (empty($form)) {
     return drupal_not_found();
   }
@@ -1580,32 +1578,37 @@
   }
 
   $output = views_ajax_form_wrapper($form_state['form_id'], $form_state);
-
-  if (!$output) {
+  if ($form_state['submitted']) {
     // Sometimes we need to re-generate the form for multi-step type operations.
     $object = NULL;
     if (!empty($view->stack)) {
-      $stack = $view->stack; // copy so the next shift doesn't break the array
+      $stack = $view->stack;
       $top = array_shift($stack);
-      $top[0] = $js; // change identifier into $js setting
+      $top[0] = $js;
       $form_state = call_user_func_array('views_ui_build_form_state', $top);
-      $form_state['input'] = array(); // this is a new form, make sure it
-      // doesn't try to inherit $_POST info.
+      $form_state['input'] = array();
+      $form_state['url'] = url(views_ui_build_form_url($form_state));
       if (!$js) {
         return drupal_goto(views_ui_build_form_url($form_state));
       }
-      $object = views_ajax_form_wrapper($form_state['form_id'], $form_state);
-      $object->url = url(views_ui_build_form_url($form_state));
+      $output = views_ajax_form_wrapper($form_state['form_id'], $form_state);
     }
-    else if (!$js) {
+    elseif (!$js) {
       // if nothing on the stack, non-js forms just go back to the main view editor.
-      return drupal_goto("admin/build/views/edit/$view->name");
-    }
-    // regenerate all tabs because changes to the default tab could ripple.
-    return views_ui_regenerate_tabs($view, NULL, $object);
+      return drupal_goto("admin/structure/views/edit/$view->name");
+    }
+    else {
+      $output = array();
+      $output[] = views_ajax_command_enable_buttons();
+      $output[] = views_ajax_command_dismiss_form();
+    }
+    views_ui_regenerate_tabs($view, $output);
+  }
+  elseif ($js) {
+    $output[] = views_ajax_command_disable_buttons();
   }
 
-  return ($js) ? views_ajax_render($output) : $output;
+  return $js ? array('#type' => 'ajax_commands', '#ajax_commands' => $output) : $output;
 }
 
 /**
@@ -1615,30 +1618,28 @@
   views_include('ajax');
   $form_state = array(
     'view' => &$view,
-    'ajax' => $js,
+    'ajax' => $js == 'ajax',
   );
 
   $output = views_ajax_form_wrapper('views_ui_add_display_form', $form_state);
 
   if ($js) {
-    // If we don't have an output object, it was submitted. Set up the submission.
-    if (empty($output)) {
+    if ($form_state['submitted']) {
       $id = $form_state['id'];
 
       // Make sure the new display is active
       if (!$view->set_display('default')) {
-        views_ajax_render(t('Unable to initialize default display'));
+        views_ajax_error(t('Unable to initialize default display'));
       }
 
       // Render the new display
       list($title, $body) = views_ui_display_tab($view, $view->display[$id]);
 
       // Instruct the javascript on the browser to render the new tab.
-      $output = new stdClass;
-      $output->tab = array('#views-tab-' . $id => array('title' => $title, 'body' => $body));
+      $output = array();
+      $output[] = views_ajax_command_add_tab($id, $title, $body);
     }
-    // Render the command object. This automatically exits.
-    views_ajax_render($output);
+    $output = array('#type' => 'ajax_commands', '#ajax_commands' => $output);
   }
 
   // But the non-js variant will return output if it didn't redirect us.
@@ -1648,7 +1649,7 @@
 /**
  * Form to add a display to a view.
  */
-function views_ui_add_display_form(&$form_state) {
+function views_ui_add_display_form($form, &$form_state) {
   $view = &$form_state['view'];
 
   $form['display']['display'] = array(
@@ -1660,12 +1661,15 @@
   $form['display']['add_display'] = array(
     '#type' => 'submit',
     '#value' => t('Add display'),
+    '#ajax' => array(
+      'path' => "admin/structure/views/ajax/add-display/$view->name",
+    ),
     '#submit' => array('views_ui_add_display_form_submit'),
   );
 
   $form['#id'] = 'views-add-display-form';
-  $form['#attributes'] = array('class' => 'views-ajax-form');
-  $form['#action'] = url("admin/build/views/nojs/add-display/$view->name");
+  $form['#attributes'] = array('class' => array('views-ajax-form'));
+  $form['#action'] = url("admin/structure/views/nojs/add-display/$view->name");
 
   return $form;
 }
@@ -1682,13 +1686,13 @@
   views_ui_cache_set($form_state['view']);
 
   // Send it back
-  $form_state['redirect'] = array('admin/build/views/edit/' . $form_state['view']->name, NULL, 'views-tab-' . $form_state['id']);
+  $form_state['redirect'] = array('admin/structure/views/edit/' . $form_state['view']->name, array('fragment' => 'views-tab-' . $form_state['id']));
 }
 
 /**
  * Form to remove a display from a view.
  */
-function views_ui_remove_display_form(&$form_state) {
+function views_ui_remove_display_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
 
@@ -1714,8 +1718,8 @@
       '#submit' => array('views_ui_remove_display_form_restore'),
     );
   }
-  $form['#action'] = url("admin/build/views/nojs/remove-display/$view->name/$display_id");
-  $form['#attributes'] = array('class' => 'views-ajax-form');
+  $form['#action'] = url("admin/structure/views/nojs/remove-display/$view->name/$display_id");
+  $form['#attributes'] = array('class' => array('views-ajax-form'));
 
   return $form;
 }
@@ -1759,13 +1763,14 @@
 
   $output = views_ajax_form_wrapper('views_ui_analyze_view_form', $form_state);
 
-  if ($js) {
+  if ($js == 'ajax') {
     // If we don't have an output object, it was submitted. Set up the submission.
     if (empty($output)) {
       return views_ui_regenerate_tabs($view);
     }
-    return views_ajax_render($output);
-
+    $commands = array();
+    $commands[] = views_ajax_command_set_form($output, t('Analyse'));
+    return $js ? array('#type' => 'ajax_commands', '#ajax_commands' => $commands) : $commands;
   }
   return $output;
 }
@@ -1777,12 +1782,15 @@
  * It has no submit or anything, as we will never actually submit this form
  * where the form is placed.
  */
-function views_ui_analyze_view_button(&$form_state, $view) {
-  $form['#action'] = url("admin/build/views/nojs/analyze/$view->name");
-  $form['#attributes'] = array('class' => 'views-ajax-form');
+function views_ui_analyze_view_button($form, &$form_state, $view) {
+  $form['#action'] = url("admin/structure/views/nojs/analyze/$view->name");
+  $form['#attributes'] = array('class' => array('views-ajax-form'));
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Analyze'),
+    '#ajax' => array(
+      'path' => "admin/structure/views/ajax/analyze/$view->name",
+    ),
   );
 
   return $form;
@@ -1791,7 +1799,7 @@
 /**
  * Form constructor callback to display analysis information on a view
  */
-function views_ui_analyze_view_form(&$form_state) {
+function views_ui_analyze_view_form($form, &$form_state) {
   $view = &$form_state['view'];
 
   $form['#title'] = t('View analysis');
@@ -1816,7 +1824,7 @@
  * Submit handler for views_ui_analyze_view_form
  */
 function views_ui_analyze_view_form_submit($form, &$form_state) {
-  $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
+  $form_state['redirect'] = 'admin/structure/views/edit/' . $form_state['view']->name;
 }
 
 /**
@@ -1836,7 +1844,7 @@
     if (empty($output)) {
       return views_ui_regenerate_tabs($view);
     }
-    return views_ajax_render($output);
+    return $js ? array('#type' => 'ajax_commands', '#ajax_commands' => $output) : $output;
 
   }
   return $output;
@@ -1845,7 +1853,7 @@
 /**
  * Form constructor callback to edit details of a view
  */
-function views_ui_edit_details_form(&$form_state) {
+function views_ui_edit_details_form($form, &$form_state) {
   $view = &$form_state['view'];
 
   $form['#title'] = t('View details');
@@ -1877,19 +1885,19 @@
   $form_state['view']->description = $form_state['values']['description'];
   $form_state['view']->tag = $form_state['values']['tag'];
   views_ui_cache_set($form_state['view']);
-  $form_state['redirect'] = 'admin/build/views/edit/' . $form_state['view']->name;
+  $form_state['redirect'] = 'admin/structure/views/edit/' . $form_state['view']->name;
 }
 
 /**
  * Form constructor callback to edit display of a view
  */
-function views_ui_edit_display_form(&$form_state) {
+function views_ui_edit_display_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
   $section = $form_state['section'];
 
   if (!$view->set_display($display_id)) {
-    views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
+    views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
   $display = &$view->display[$display_id];
 
@@ -1936,14 +1944,14 @@
 /**
  * Form to config items in the views UI.
  */
-function views_ui_config_type_form(&$form_state) {
+function views_ui_config_type_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
 
   $types = views_object_types();
   if (!$view->set_display($display_id)) {
-    views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
+    views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
   $display = &$view->display[$display_id];
   $form['#title'] = check_plain($display->display_title) . ': ';
@@ -1991,14 +1999,14 @@
 /**
  * Form to rearrange items in the views UI.
  */
-function views_ui_rearrange_form(&$form_state) {
+function views_ui_rearrange_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
 
   $types = views_object_types();
   if (!$view->set_display($display_id)) {
-    views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
+    views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
   $display = &$view->display[$display_id];
   $form['#title'] = check_plain($display->display_title) . ': ';
@@ -2041,7 +2049,7 @@
       }
 
       $form[$id]['name'] = array(
-        '#value' => $name,
+        '#markup' => $name,
       );
     }
     else {
@@ -2050,7 +2058,7 @@
     $form[$id]['removed'] = array(
       '#type' => 'checkbox',
       '#id' => 'views-removed-' . $id,
-      '#attributes' => array('class' => 'views-remove-checkbox'),
+      '#attributes' => array('class' => array('views-remove-checkbox')),
       '#default_value' => 0,
     );
   }
@@ -2077,17 +2085,18 @@
 /**
  * Turn the rearrange form into a proper table
  */
-function theme_views_ui_rearrange_form($form) {
+function theme_views_ui_rearrange_form($variables) {
+  $form = $variables['form'];
+
   $rows = array();
   foreach (element_children($form) as $id) {
     if (isset($form[$id]['name'])) {
       $row = array();
       $row[] = drupal_render($form[$id]['name']);
-      $form[$id]['weight']['#attributes']['class'] = 'weight';
+      $form[$id]['weight']['#attributes']['class'] = array('weight');
       $row[] = drupal_render($form[$id]['weight']);
-      $row[] = drupal_render($form[$id]['removed']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => 'views-button-remove views-remove-link', 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true));
-
-      $rows[] = array('data' => $row, 'class' => 'draggable', 'id' => 'views-row-' . $id);
+      $row[] = drupal_render($form[$id]['removed']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-button-remove', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => true));
+      $rows[] = array('data' => $row, 'class' => array('draggable'), 'id' => 'views-row-' . $id);
     }
   }
   if (empty($rows)) {
@@ -2095,12 +2104,12 @@
   }
 
   $header = array('', t('Weight'), t('Remove'));
+  $output = drupal_render($form['override']);
+  $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'arrange')));
+  $output .= drupal_render_children($form);
   drupal_add_tabledrag('arrange', 'order', 'sibling', 'weight');
-  $output = drupal_render($form['override']);
-  $output .= theme('table', $header, $rows, array('id' => 'arrange'));
-  $output .= drupal_render($form);
+
   return $output;
-
 }
 
 /**
@@ -2138,13 +2147,13 @@
 /**
  * Form to add_item items in the views UI.
  */
-function views_ui_add_item_form(&$form_state) {
+function views_ui_add_item_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
 
   if (!$view->set_display($display_id)) {
-    views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
+    views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
   $display = &$view->display[$display_id];
 
@@ -2163,7 +2172,7 @@
       '#type' => 'select',
       '#title' => t('Groups'),
       '#options' => array(),
-      '#attributes' => array('class' => 'views-master-dependent'),
+      '#attributes' => array('class' => array('views-master-dependent')),
     );
 
     $form['name'] = array(
@@ -2183,7 +2192,7 @@
     }
 
     foreach ($grouped_options as $group => $group_options) {
-      $form['name'][$group . '_start'] = array('#type' => 'markup', '#value' => '<div class="views-dependent-all views-dependent-' . $group . '">');
+      $form['name'][$group . '_start']['#markup'] = '<div class="views-dependent-all views-dependent-' . $group . '">';
       foreach ($group_options as $key => $option) {
         $form['name'][$key] = array(
           '#type' => 'checkbox',
@@ -2192,7 +2201,7 @@
           '#return_value' => $key,
         );
       }
-      $form['name'][$group . '_end'] = array('#type' => 'markup', '#value' => '</div>');
+      $form['name'][$group . '_end']['#markup'] = '</div>';
     }
 
     $form['group']['#options'] = $groups;
@@ -2202,6 +2211,7 @@
       '#value' => '<div class="form-item">' . t('There are no @types available to add.', array('@types' =>  $types[$type]['ltitle'])) . '</div>',
     );
   }
+  views_add_js('dependent');
   views_ui_standard_form_buttons($form, $form_state, 'views_ui_add_item_form', t('Add'));
 
   return $form;
@@ -2238,7 +2248,7 @@
 /**
  * Form to config_item items in the views UI.
  */
-function views_ui_config_item_form(&$form_state) {
+function views_ui_config_item_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
@@ -2246,7 +2256,7 @@
 
   $form = array('options' => array('#tree' => TRUE));
   if (!$view->set_display($display_id)) {
-    views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
+    views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
   $item = $view->get_item($display_id, $type, $id);
 
@@ -2414,7 +2424,7 @@
 /**
  * Form to config_item items in the views UI.
  */
-function views_ui_config_item_extra_form(&$form_state) {
+function views_ui_config_item_extra_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
@@ -2422,7 +2432,7 @@
 
   $form = array('options' => array('#tree' => TRUE));
   if (!$view->set_display($display_id)) {
-    views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
+    views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
   $item = $view->get_item($display_id, $type, $id);
 
@@ -2482,7 +2492,7 @@
 /**
  * Form to change_style items in the views UI.
  */
-function views_ui_change_style_form(&$form_state) {
+function views_ui_change_style_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
@@ -2490,7 +2500,7 @@
 
   $form = array('options' => array('#tree' => TRUE));
   if (!$view->set_display($display_id)) {
-    views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
+    views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
   $item = $view->get_item($display_id, $type, $id);
 
@@ -2567,7 +2577,7 @@
 /**
  * Form to config_style items in the views UI.
  */
-function views_ui_config_style_form(&$form_state) {
+function views_ui_config_style_form($form, &$form_state) {
   $view = &$form_state['view'];
   $display_id = $form_state['display_id'];
   $type = $form_state['type'];
@@ -2575,7 +2585,7 @@
 
   $form = array('options' => array('#tree' => TRUE));
   if (!$view->set_display($display_id)) {
-    views_ajax_render(t('Invalid display id @display', array('@display' => $display_id)));
+    views_ajax_error(t('Invalid display id @display', array('@display' => $display_id)));
   }
   $item = $view->get_item($display_id, $type, $id);
 
@@ -2636,7 +2646,7 @@
   if (!isset($roles)) {
     $roles = array();
     $result = db_query("SELECT r.rid, r.name FROM {role} r ORDER BY r.name");
-    while ($obj = db_fetch_object($result)) {
+    foreach ($result as $obj) {
       $roles[$obj->rid] = $obj->name;
     }
   }
@@ -2656,11 +2666,11 @@
  */
 function views_ui_enable_page($view) {
   $views_status = variable_get('views_defaults', array());
-  $views_status[$view->name] = FALSE; // false is enabled
+  $views_status[$view->name] = FALSE; // FALSE is enabled
   variable_set('views_defaults', $views_status);
   views_invalidate_cache();
   menu_rebuild();
-  drupal_goto('admin/build/views');
+  drupal_goto('admin/structure/views');
 }
 
 /**
@@ -2672,7 +2682,7 @@
   variable_set('views_defaults', $views_status);
   views_invalidate_cache();
   menu_rebuild();
-  drupal_goto('admin/build/views');
+  drupal_goto('admin/structure/views');
 }
 
 /**
@@ -2774,16 +2784,16 @@
  * a templates rescan).
  */
 function views_ui_config_item_form_rescan($form, &$form_state) {
-  drupal_rebuild_theme_registry();
+  drupal_theme_rebuild();
 
   // The 'Theme: Information' page is about to be shown again. That page
   // analyzes the output of theme_get_registry(). However, this latter
   // function uses an internal cache (which was initialized before we
-  // called drupal_rebuild_theme_registry()) so it won't reflect the
+  // called drupal_theme_rebuild()) so it won't reflect the
   // current state of our theme registry. The only way to clear that cache
   // is to re-initialize the theme system:
   unset($GLOBALS['theme']);
-  init_theme();
+  drupal_theme_initialize();
 
   $form_state['rerender'] = TRUE;
   $form_state['rebuild'] = TRUE;
@@ -2815,14 +2825,17 @@
     }
   }
 
+  $count = 10 - count($matches);
   if ($string) {
-    $result = db_query_range("SELECT DISTINCT tag FROM {views_view} WHERE LOWER(tag) LIKE LOWER('%s%%')", $string, 0, 10 - count($matches));
-    while ($view = db_fetch_object($result)) {
+    $result = db_query_range("SELECT DISTINCT tag FROM {views_view} WHERE LOWER(tag) LIKE LOWER(:tag)",
+      0, $count,
+      array(':tag' => $string . '%'));
+    foreach ($result as $view) {
       $matches[$view->tag] = check_plain($view->tag);
     }
   }
 
-  drupal_json($matches);
+  drupal_json_output($matches);
 }
 
 // ------------------------------------------------------------------
@@ -2889,7 +2902,7 @@
   static $fields = array();
   if (empty($fields)) {
     $data = views_fetch_data();
-    $start = views_microtime();
+    $start = microtime(TRUE);
     // This constructs this ginormous multi dimensional array to
     // collect the important data about fields. In the end,
     // the structure looks a bit like this (using nid as an example)
@@ -2959,7 +2972,7 @@
         }
       }
     }
-//    vsm('Views UI data build time: ' . (views_microtime() - $start) * 1000 . ' ms');
+//    vsm('Views UI data build time: ' . (microtime(TRUE) - $start) * 1000 . ' ms');
   }
 
   // If we have an array of base tables available, go through them
@@ -3024,7 +3037,9 @@
 /**
  * Theme the form for the table style plugin
  */
-function theme_views_ui_style_plugin_table($form) {
+function theme_views_ui_style_plugin_table($variables) {
+  $form = $variables['form'];
+
   $output = drupal_render($form['description_markup']);
 
   $header = array(
@@ -3066,8 +3081,7 @@
   // Add the special 'None' row.
   $rows[] = array(t('None'), '', '', '', array('align' => 'center', 'data' => drupal_render($form['default'][-1])));
 
-  $output .= theme('table', $header, $rows);
-  $output .= drupal_render($form);
+  $output .= theme('table', array('header' => $header, 'rows' => $rows));
+  $output .= drupal_render_children($form);
   return $output;
 }
-

=== modified file 'includes/ajax.inc'
--- includes/ajax.inc	2009-10-17 18:33:18 +0000
+++ includes/ajax.inc	2009-10-19 05:17:54 +0000
@@ -22,13 +22,11 @@
     $dom_id = isset($_REQUEST['view_dom_id']) ? $_REQUEST['view_dom_id'] : NULL;
     $pager_element = isset($_REQUEST['pager_element']) ? $_REQUEST['pager_element'] : NULL;
     views_include('ajax');
-    $object = new stdClass();
 
-    $object->status = FALSE;
-    $object->display = '';
+    $commands = array();
 
     $arg = explode('/', $_REQUEST['view_path']);
-    
+
     if ($arg[0] == 'admin' || (variable_get('node_admin_theme', '0') && $arg[0] == 'node' && ($arg[1] == 'add' || $arg[2] == 'edit'))) {
         global $custom_theme;
         $custom_theme = variable_get('admin_theme', '0');
@@ -52,56 +50,134 @@
 
         $errors = $view->validate();
         if ($errors === TRUE) {
-          $object->status = TRUE;
-          $object->title = $view->get_title();
-          $object->display .= $view->preview($display_id, $args);
+          $commands[] = ajax_command_replace('#' . $domid, $view->get_title());
+          $commands[] = ajax_command_replace('#' . $dom_id, $view->preview($display_id, $args));
         }
         else {
           foreach ($errors as $error) {
             drupal_set_message($error, 'error');
           }
         }
-        // Register the standard JavaScript callback.
-        $object->__callbacks = array('Drupal.Views.Ajax.ajaxViewResponse');
-        // Allow other modules to extend the data returned.
-        drupal_alter('ajax_data', $object, 'views', $view);
       }
     }
+
     $messages = theme('status_messages');
-    $object->messages = $messages ? '<div class="views-messages">' . $messages . '</div>' : '';
-
-    views_ajax_render($object);
-  }
-}
-
-/**
- * Simple render function to make sure output is what we want.
- *
- * This function renders an object into JSON, and that object contains
- * commands to the ajax response parser on the other side. The actual
- * commands that can be sent are completely dependent upon the client
- * javascript parser, which can be anything, but this function assumes
- * that 'display', at least, will be displayed in some kind of ajax
- * spot or popup.
- */
-function views_ajax_render($output = NULL, $title = NULL, $url = NULL, $js = NULL) {
-  if (empty($output)) {
-    $output->display = t('Server reports invalid input error.');
-    $output->title = t('Error');
-  }
-  elseif (!is_object($output)) {
-    $temp = new stdClass();
-    $temp->display = $output;
-    $temp->title = $title;
-    $temp->url = $url;
-    $output = $temp;
-  }
-  if (!empty($js)) {
-    $output->js = $js;
-  }
-
-  drupal_json($output);
-  exit;
+    $commands[] = ajax_command_replace('.views-messages', $messages);
+
+    ajax_render($commands);
+  }
+}
+
+/**
+ * Creates a Drupal AJAX 'viewsSetForm' command.
+ *
+ * @param $output
+ *   The form to display in the modal.
+ * @param $title
+ *   The title.
+ * @param $url
+ *   An optional URL.
+ *
+ * @return
+ *   An array suitable for use with the ajax_render() function.
+ */
+function views_ajax_command_set_form($output, $title, $url = NULL) {
+  $command = array(
+    'command' => 'viewsSetForm',
+    'output' => $output,
+    'title' => $title,
+  );
+  if (isset($url)) {
+    $command['url'] = $url;
+  }
+  return $command;
+}
+
+/**
+ * Creates a Drupal AJAX 'viewsDismissForm' command.
+ *
+ * @return
+ *   An array suitable for use with the ajax_render() function.
+ */
+function views_ajax_command_dismiss_form() {
+  $command = array(
+    'command' => 'viewsDismissForm',
+  );
+  return $command;
+}
+
+/**
+ * Creates a Drupal AJAX 'viewsHilite' command.
+ *
+ * @param $selector
+ *   The selector to highlight
+ *
+ * @return
+ *   An array suitable for use with the ajax_render() function.
+ */
+function views_ajax_command_hilite($selector) {
+  return array(
+    'command' => 'viewsHilite',
+    'selector' => $selector,
+  );
+}
+
+/**
+ * Creates a Drupal AJAX 'addTab' command.
+ *
+ * @param $id
+ *   The DOM ID.
+ * @param $title
+ *   The title.
+ * @param $body
+ *   The body.
+ *
+ * @return
+ *   An array suitable for use with the ajax_render() function.
+ */
+function views_ajax_command_add_tab($id, $title, $body) {
+  $command = array(
+    'command' => 'viewsAddTab',
+    'id' => $id,
+    'title' => $title,
+    'body' => $body,
+  );
+  return $command;
+}
+
+/**
+ * Disables Save, Cancel, and Delete buttons.
+ *
+ * @return
+ *   An array suitable for use with the ajax_render() function.
+ */
+function views_ajax_command_disable_buttons() {
+  $command = array(
+    'command' => 'viewsDisableButtons',
+  );
+  return $command;
+}
+
+/**
+ * Enables Save, Cancel, and Delete buttons.
+ *
+ * @return
+ *   An array suitable for use with the ajax_render() function.
+ */
+function views_ajax_command_enable_buttons() {
+  $command = array(
+    'command' => 'viewsEnableButtons',
+  );
+  return $command;
+}
+
+/**
+ * Return an AJAX error.
+ */
+function views_ajax_error($message) {
+  $commands = array();
+  $commands[] = views_ajax_command_set_form($message, t('Error'));
+  ajax_render($commands);
 }
 
 /**
@@ -115,29 +191,38 @@
     'no_redirect' => !empty($form_state['ajax']),
   );
 
-  $output = drupal_build_form($form_id, $form_state);
+  $output = drupal_render(drupal_build_form($form_id, $form_state));
   if (!empty($form_state['ajax']) && empty($form_state['executed'])) {
     // If the form didn't execute and we're using ajax, build up a
-    // json command object to render.
-    $object = new stdClass();
-    $object->display = '';
+    // Ajax command list to execute.
+    $commands = array();
+
+    $display = '';
     if ($messages = theme('status_messages')) {
-      $object->display = '<div class="views-messages">' . $messages . '</div>';
+      $display = '<div class="views-messages">' . $messages . '</div>';
     }
-    $object->display .= $output;
+    $display .= $output;
 
-    $object->title = empty($form_state['title']) ? '' : $form_state['title'];
+    $title = empty($form_state['title']) ? '' : $form_state['title'];
     if (!empty($form_state['help_topic'])) {
       $module = !empty($form_state['help_module']) ? $form_state['help_module'] : 'views';
-      $object->title = theme('advanced_help_topic', $module, $form_state['help_topic']) . $object->title;
-    }
-    $object->url = empty($form_state['url']) ? url($_GET['q'], array('absolute' => TRUE)) : $form_state['url'];
-    $object->js = empty($form_state['js settings']) ? NULL : $form_state['js settings'];
+      if (module_exists('advanced_help')) {
+        $title = theme('advanced_help_topic', array('module' => $module, 'topic' => $form_state['help_topic'])) . $title;
+      }
+    }
+
+    $url = empty($form_state['url']) ? url($_GET['q'], array('absolute' => TRUE)) : $form_state['url'];
+
+    $commands[] = views_ajax_command_set_form($display, $title, $url);
+    if (!empty($form_state['js settings'])) {
+      $commands[] = ajax_command_settings($form_state['js settings']);
+    }
+
     if (!empty($form_state['#section'])) {
-      $object->hilite = '.' . views_ui_item_css($form_state['#section']);
+      $commands[] = views_ajax_command_hilite('.' . views_ui_item_css($form_state['#section']));
     }
 
-    $output = $object;
+    return $commands;
   }
 
   // These forms have the title built in, so set the title here:
@@ -165,9 +250,13 @@
     if (strpos('anonymous', strtolower($last_string)) !== FALSE) {
       $matches[$prefix . 'Anonymous'] = 'Anonymous';
     }
-    $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $last_string, 0, 10);
+    $result = db_query_range("SELECT name FROM {users} WHERE name = :string",
+      0, 1,
+      array(
+        ':string' => $last_string
+      ));
 
-    while ($account = db_fetch_object($result)) {
+    foreach ($result as $account) {
       $n = $account->name;
       // Commas and quotes in terms are special cases, so encode 'em.
       if (strpos($account->name, ',') !== FALSE || strpos($account->name, '"') !== FALSE) {
@@ -177,7 +266,7 @@
     }
   }
 
-  drupal_json($matches);
+  drupal_json_output($matches);
 }
 
 /**

=== modified file 'includes/analyze.inc'
--- includes/analyze.inc	2009-10-17 18:33:18 +0000
+++ includes/analyze.inc	2009-10-18 19:45:49 +0000
@@ -50,9 +50,9 @@
   foreach ($types as $type => $messages) {
     $message = '';
     if (count($messages) > 1) {
-      $message = theme('item_list', $messages);
+      $message = theme('item_list', array('items' => $messages));
     }
-    else if ($messages) {
+    elseif ($messages) {
       $message = array_shift($messages);
     }
 
@@ -91,7 +91,7 @@
 }
 
 /**
- * Implementation of hook_views_analyze().
+ * Implements hook_views_analyze().
  *
  * This is the basic views analysis that checks for very minimal problems.
  * There are other analysis tools in core specific sections, such as

=== modified file 'includes/base.inc'
--- includes/base.inc	2009-10-17 18:33:18 +0000
+++ includes/base.inc	2009-10-18 07:37:31 +0000
@@ -93,7 +93,7 @@
 
         $this->unpack_options($storage[$key], $value, isset($definition[$key]['contains']) ? $definition[$key]['contains'] : array());
       }
-      else if (!empty($definition[$key]['translatable']) && !empty($value)) {
+      elseif (!empty($definition[$key]['translatable']) && !empty($value)) {
         $storage[$key] = t($value);
       }
       else {

=== modified file 'includes/cache.inc'
--- includes/cache.inc	2009-10-17 18:33:18 +0000
+++ includes/cache.inc	2009-10-18 10:24:14 +0000
@@ -27,9 +27,8 @@
 function _views_fetch_data($table = NULL) {
   static $cache = NULL;
   if (!isset($cache)) {
-    $start = views_microtime();
+    $start = microtime(TRUE);
     // NOTE: This happens whether we retrieve them from cache or otherwise.
-    views_include_handlers();
 
     $data = views_cache_get('views_data', TRUE);
     if (!empty($data->data)) {
@@ -37,6 +36,7 @@
     }
 
     if (empty($cache)) {
+      views_include_handlers();
       $cache = module_invoke_all('views_data');
       foreach (module_implements('views_data_alter') as $module) {
         $function = $module . '_views_data_alter';
@@ -46,7 +46,7 @@
       views_cache_set('views_data', $cache, TRUE);
     }
 
-    vpr('Views data build time: ' . (views_microtime() - $start) * 1000 . ' ms');
+    debug('Views data build time: ' . (microtime(TRUE) - $start) * 1000 . ' ms');
   }
 
   if (!$table) {
@@ -66,24 +66,25 @@
 function _views_fetch_plugin_data($type = NULL, $plugin = NULL) {
   static $cache = NULL;
   if (!isset($cache)) {
-    $start = views_microtime();
+    $start = microtime(TRUE);
+    views_include('plugins');
     views_include_handlers();
 
     $cache = views_discover_plugins();
 
-    vpr('Views plugins build time: ' . (views_microtime() - $start) * 1000 . ' ms');
+    //debug('Views plugins build time: ' . (microtime(TRUE) - $start) * 1000 . ' ms');
   }
 
   if (!$type && !$plugin) {
     return $cache;
   }
-  else if (!$plugin) {
+  elseif (!$plugin) {
     // Not in the if above so the else below won't run
     if (isset($cache[$type])) {
       return $cache[$type];
     }
   }
-  else if (isset($cache[$type][$plugin])) {
+  elseif (isset($cache[$type][$plugin])) {
     return $cache[$type][$plugin];
   }
 
@@ -213,9 +214,16 @@
   }
 
   if (!array_key_exists($key, $cache)) {
-    $data = db_fetch_object(db_query("SELECT * FROM {views_object_cache} WHERE sid = '%s' AND obj = '%s' AND name = '%s'", session_id(), $obj, $name));
-    if ($data) {
-      $cache[$key] = unserialize($data->data);
+    $result = db_query("SELECT * FROM {views_object_cache} WHERE sid = :sid AND obj = :obj AND name = :name",
+      array(
+        ':sid' => session_id(),
+        ':obj' => $obj,
+        ':name' => $name
+      ));
+    foreach ($result as $data) {
+      if ($data) {
+        $cache[$key] = unserialize($data->data);
+      }
     }
   }
   return isset($cache[$key]) ? $cache[$key] : NULL;
@@ -234,7 +242,15 @@
  */
 function views_object_cache_set($obj, $name, $cache) {
   views_object_cache_clear($obj, $name);
-  db_query("INSERT INTO {views_object_cache} (sid, obj, name, data, updated) VALUES ('%s', '%s', '%s', '%s', %d)", session_id(), $obj, $name, serialize($cache), time());
+  db_insert('views_object_cache')
+    ->fields(array(
+      'sid' => session_id(),
+      'obj' => $obj,
+      'name' => $name,
+      'data' => serialize($cache),
+      'updated' => REQUEST_TIME,
+    ))
+    ->execute();
 }
 
 /**
@@ -247,7 +263,11 @@
  *   The name of the view (or other object) being stored.
  */
 function views_object_cache_clear($obj, $name) {
-  db_query("DELETE FROM {views_object_cache} WHERE sid = '%s' AND obj = '%s' AND name = '%s'", session_id(), $obj, $name);
+  db_delete('views_object_cache')
+    ->condition('sid', session_id())
+    ->condition('obj', $obj)
+    ->condition('name', $name)
+    ->execute();
 }
 
 /**
@@ -262,7 +282,9 @@
   if (empty($age)) {
     $age = 86400 * 7; // 7 days
   }
-  db_query("DELETE FROM {views_object_cache} WHERE updated < %d", time() - $age);
+  db_delete('views_object_cache')
+    ->condition('updated', REQUEST_TIME - $age, '<')
+    ->execute();
 }
 
 /**

=== modified file 'includes/convert.inc'
--- includes/convert.inc	2009-10-17 18:33:18 +0000
+++ includes/convert.inc	2009-10-19 05:17:54 +0000
@@ -24,15 +24,15 @@
   $current_views = views_get_all_views();
 
   $result = db_query("SELECT v.* FROM {view_view} v");
-  while ($view = db_fetch_object($result)) {
+  foreach ($result as $view) {
     $ops = array();
     if (!isset($current_views[$view->name])) {
-      $ops[] = l(t('Convert'), "admin/build/views1/convert/$view->name");
+      $ops[] = l(t('Convert'), "admin/structure/views1/convert/$view->name");
     }
     else {
       $ops[] = t('Converted');
     }
-    $ops[] = l(t('Delete'), "admin/build/views1/delete/$view->name");
+    $ops[] = l(t('Delete'), "admin/structure/views1/delete/$view->name");
 
     $item = array();
     $item[] = check_plain($view->name);
@@ -66,7 +66,7 @@
     $i[] = $items[$id];
   }
   $output = t('The table below lists Views version 1 views that are stored in the database. You can either convert them to work in Views version 2, or delete them. The views are convertible only if there is no Views 2 view with the same name.');
-  $output .= theme('table', $header, $i);
+  $output .= theme('table', array('header' => $header, 'rows' => $i));
 
   $output .= drupal_get_form('views_ui_convert_cleanup_form');
   return $output;
@@ -133,7 +133,7 @@
 
   if ($view) {
     views_ui_cache_set($view);
-    drupal_goto('admin/build/views/edit/' . $view->name);
+    drupal_goto('admin/structure/views/edit/' . $view->name);
   }
   else {
     return t('Unable to convert view.');
@@ -143,11 +143,11 @@
 /**
  * Page to delete a Views 1 view.
  */
-function views_ui_delete1_confirm(&$form_state, $vid) {
+function views_ui_delete1_confirm($form, &$form_state, $vid) {
   $form_state['vid'] = $vid;
   $form = array();
 
-  $cancel = 'admin/build/views/tools/convert';
+  $cancel = 'admin/structure/views/tools/convert';
   if (!empty($_REQUEST['cancel'])) {
     $cancel = $_REQUEST['cancel'];
   }
@@ -165,16 +165,13 @@
 function views_ui_delete1_confirm_submit(&$form, &$form_state) {
   views1_delete($form_state['vid']);
   drupal_set_message(t('The view has been deleted'));
-  $form_state['redirect'] = 'admin/build/views/tools/convert';
+  $form_state['redirect'] = 'admin/structure/views/tools/convert';
 }
 
 /**
  * Convert a Views 1 view to a Views 2 view.
  */
 function views1_import($imported) {
-  views_include_handlers();
-  views_module_include('views_convert.inc');
-
   $view = views_new_view();
 
   $view->name = $imported->name;
@@ -533,11 +530,23 @@
 
 
 
-  $result = db_query("DELETE FROM {view_sort} WHERE vid = $view->vid");
-  $result = db_query("DELETE FROM {view_argument} WHERE vid = $view->vid");
-  $result = db_query("DELETE FROM {view_tablefield} WHERE vid = $view->vid");
-  $result = db_query("DELETE FROM {view_filter} WHERE vid = $view->vid");
-  $result = db_query("DELETE FROM {view_exposed_filter} WHERE vid = $view->vid");
-  $result = db_query("DELETE FROM {view_view} WHERE vid = $view->vid");
+  db_delete('view_sort')
+    ->condition('vid', $view->vid)
+    ->execute();
+  db_delete('view_argument')
+    ->condition('vid', $view->vid)
+    ->execute();
+  db_delete('view_tablefield')
+    ->condition('vid', $view->vid)
+    ->execute();
+  db_delete('view_filter')
+    ->condition('vid', $view->vid)
+    ->execute();
+  db_delete('view_exposed_filter')
+    ->condition('vid', $view->vid)
+    ->execute();
+  db_delete('view_view')
+    ->condition('vid', $view->vid)
+    ->execute();
 }
 

=== modified file 'includes/form.inc'
--- includes/form.inc	2009-10-17 18:33:18 +0000
+++ includes/form.inc	2009-10-18 19:13:47 +0000
@@ -174,12 +174,12 @@
   if ((!empty($form['#programmed'])) || (!empty($form['#post']) && (isset($form['#post']['form_id']) && ($form['#post']['form_id'] == $form_id)))) {
     drupal_validate_form_new($form_id, $form, $form_state);
 
-    // form_clean_id() maintains a cache of element IDs it has seen,
+    // drupal_html_id() maintains a cache of element IDs it has seen,
     // so it can prevent duplicates. We want to be sure we reset that
     // cache when a form is processed, so scenerios that result in
     // the form being built behind the scenes and again for the
     // browser don't increment all the element IDs needlessly.
-    form_clean_id(NULL, TRUE);
+    drupal_html_id(NULL, TRUE);
 
     if ((!empty($form_state['submitted'])) && !form_get_errors() && empty($form_state['rebuild'])) {
       $form_state['redirect'] = NULL;

=== modified file 'includes/handlers.inc'
--- includes/handlers.inc	2009-10-17 18:33:18 +0000
+++ includes/handlers.inc	2009-10-19 05:17:54 +0000
@@ -9,12 +9,13 @@
  * Instantiate and construct a new handler
  */
 function _views_create_handler($definition, $type = 'handler') {
-//  vpr('Instantiating handler ' . $definition['handler']);
+//  debug('Instantiating handler ' . $definition['handler']);
   if (empty($definition['handler'])) {
     return;
   }
 
-  if (!class_exists($definition['handler']) && !views_include_handler($definition, $type)) {
+  // class_exists will automatically load the code file.
+  if (!class_exists($definition['handler'])) {
     return;
   }
 
@@ -27,61 +28,6 @@
 }
 
 /**
- * Attempt to find the include file for a given handler from its definition.
- *
- * This will also attempt to include all parents, though we're maxing the
- * parent chain to 10 to prevent infinite loops.
- */
-function views_include_handler($definition, $type, $count = 0) {
-  // Do not proceed if the class already exists.
-  if (isset($definition['handler']) && class_exists($definition['handler'])) {
-    return TRUE;
-  }
-
-  // simple infinite loop prevention.
-  if ($count > 10) {
-    vpr(t('Handler @handler include tried to loop infinitely!', array('@handler' => $definition['handler'])));
-    return FALSE;
-  }
-
-  if (!isset($definition['path'])) {
-    if ($type == 'handler') {
-      $definition += views_fetch_handler_data($definition['handler']);
-    }
-    else {
-      $definition += views_fetch_plugin_data($type, $definition['handler']);
-    }
-  }
-
-  if (!empty($definition['parent'])) {
-    if ($type == 'handler') {
-      $parent = views_fetch_handler_data($definition['parent']);
-    }
-    else {
-      $parent = views_fetch_plugin_data($type, $definition['parent']);
-    }
-
-    if ($parent) {
-      $rc = views_include_handler($parent, $type, $count + 1);
-      // If the parent chain cannot be included, don't try; this will
-      // help alleviate problems with modules with cross dependencies.
-      if (!$rc) {
-        return FALSE;
-      }
-    }
-  }
-
-  if (isset($definition['path']) && $definition['file']) {
-    $filename = './' . $definition['path'] . '/' . $definition['file'];
-    if (file_exists($filename)) {
-      require_once $filename;
-    }
-  }
-
-  return class_exists($definition['handler']);
-}
-
-/**
  * Prepare a handler's data by checking defaults and such.
  */
 function _views_prepare_handler($definition, $data, $field) {
@@ -92,7 +38,7 @@
         $definition[$key] = $data[$field][$key];
       }
       // Then if that doesn't work, check the table level
-      else if (!empty($data['table'][$key])) {
+      elseif (!empty($data['table'][$key])) {
         $definition[$key] = $data['table'][$key];
       }
     }
@@ -107,17 +53,17 @@
 function views_fetch_handler_data($handler = NULL) {
   static $cache = NULL;
   if (!isset($cache)) {
-    $start = views_microtime();
+    $start = microtime(TRUE);
 
     $cache = views_discover_handlers();
 
-    vpr('Views handlers build time: ' . (views_microtime() - $start) * 1000 . ' ms');
+    debug('Views handlers build time: ' . (microtime(TRUE) - $start) * 1000 . ' ms');
   }
 
   if (!$handler) {
     return $cache;
   }
-  else if (isset($cache[$handler])) {
+  elseif (isset($cache[$handler])) {
     return $cache[$handler];
   }
 
@@ -134,30 +80,16 @@
   $cache = array();
   // Get handlers from all modules.
   foreach (module_implements('views_handlers') as $module) {
-    $function = $module . '_views_handlers';
-    $result = $function();
+    $result = module_invoke($module, 'views_handlers');
     if (!is_array($result)) {
       continue;
     }
 
-    $module_dir = isset($result['info']['module']) ? $result['info']['module'] : $module;
-    $path = isset($result['info']['path']) ? $result['info']['path'] : drupal_get_path('module', $module_dir);
-
-    foreach ($result['handlers'] as $handler => $def) {
-      if (!isset($def['module'])) {
-        $def['module'] = $module_dir;
-      }
-      if (!isset($def['path'])) {
-        $def['path'] = $path;
-      }
-      if (!isset($def['file'])) {
-        $def['file'] = "$handler.inc";
-      }
-      if (!isset($def['handler'])) {
-        $def['handler'] = $handler;
-      }
-      // merge the new data in
-      $cache[$handler] = $def;
+    foreach ($result['handlers'] as $handler) {
+      $cache[$handler] = array(
+        'module' => $module,
+        'handler' => $handler,
+      );
     }
   }
   return $cache;
@@ -197,7 +129,7 @@
     return $handler;
   }
   // DEBUG -- identify missing handlers
-  vpr("Missing join: $table $base_table");
+  debug("Missing join: $table $base_table");
 }
 
 /**
@@ -355,23 +287,23 @@
    */
   function expose_form(&$form, &$form_state) {
     $form['expose']['start_left'] = array(
-      '#value' => '<div class="views-left-50">',
+      '#markup' => '<div class="views-left-50">',
     );
 
     $this->expose_form_left($form, $form_state);
 
     $form['expose']['end_left'] = array(
-      '#value' => '</div>',
+      '#markup' => '</div>',
     );
 
     $form['expose']['start_checkboxes'] = array(
-      '#value' => '<div class="form-checkboxes views-left-40 clear-block">',
+      '#markup' => '<div class="form-checkboxes views-left-40 clearfix">',
     );
 
     $this->expose_form_right($form, $form_state);
 
     $form['expose']['end_checkboxes'] = array(
-      '#value' => '</div>',
+      '#markup' => '</div>',
     );
   }
 
@@ -395,7 +327,7 @@
    */
   function show_expose_button(&$form, &$form_state) {
     $form['expose_button'] = array(
-      '#prefix' => '<div class="views-expose clear-block">',
+      '#prefix' => '<div class="views-expose clearfix">',
       '#suffix' => '</div>',
     );
     if (empty($this->options['exposed'])) {
@@ -405,9 +337,7 @@
         '#submit' => array('views_ui_config_item_form_expose'),
       );
       $form['expose_button']['markup'] = array(
-        '#prefix' => '<div class="description">',
-        '#value' => t('This item is currently not exposed. If you <strong>expose</strong> it, users will be able to change the filter as they view it.'),
-        '#suffix' => '</div>',
+        '#markup' => '<div class="description">' . t('This item is currently not exposed. If you <strong>expose</strong> it, users will be able to change the filter as they view it.') . '</div>',
       );
     }
     else {
@@ -417,10 +347,7 @@
         '#submit' => array('views_ui_config_item_form_expose'),
       );
       $form['expose_button']['markup'] = array(
-        '#prefix' => '<div class="description">',
-        '#value' => t('This item is currently exposed. If you <strong>hide</strong> it, users will not be able to change the filter as they view it.'),
-        '#suffix' => '</div>',
-      );
+        '#markup' => '<div class="description">' . t('This item is currently exposed. If you <strong>hide</strong> it, users will not be able to change the filter as they view it.') . '</div>',      );
     }
   }
 
@@ -433,7 +360,7 @@
     }
 
     $form['expose'] = array(
-      '#prefix' => '<div class="views-expose-options clear-block">',
+      '#prefix' => '<div class="views-expose-options clearfix">',
       '#suffix' => '</div>',
     );
     $this->expose_form($form, $form_state);
@@ -575,7 +502,7 @@
 
     $join = views_get_table_join($this->table, $base_table);
     if ($join) {
-      return drupal_clone($join);
+      return clone $join;
     }
   }
 
@@ -675,7 +602,7 @@
 
     // Cycle through the joins. This isn't as error-safe as the normal
     // ensure_path logic. Perhaps it should be.
-    $r_join = drupal_clone($join);
+    $r_join = clone $join;
     while ($r_join->left_table != $base_table) {
       $r_join = views_get_table_join($r_join->left_table, $base_table);
     }
@@ -847,32 +774,26 @@
       $options['group'] = 0;
     }
 
-    $placeholder = !empty($this->handler->definition['numeric']) ? '%d' : "'%s'";
-
     if ($operator == 'not') {
-      $this->handler->query->add_where($options['group'], "$field IS NULL");
+      $this->handler->query->add_where($options['group'], $field, NULL, 'IS NULL');
     }
-    else if ($operator == 'or' && empty($options['reduce_duplicates'])) {
+    elseif ($operator == 'or' && empty($options['reduce_duplicates'])) {
       if (count($this->handler->value) > 1) {
-        $replace = array_fill(0, sizeof($this->handler->value), $placeholder);
-        $in = '(' . implode(", ", $replace) . ')';
-        $this->handler->query->add_where($options['group'], "$field IN $in", $this->handler->value);
+        $this->handler->query->add_where($options['group'], $field, $this->handler->value, 'IN');
       }
       else {
-        $this->handler->query->add_where($options['group'], "$field = $placeholder", $this->handler->value);
+        $this->handler->query->add_where($options['group'], $field, $this->handler->value);
       }
     }
     else {
       $field = $this->handler->real_field;
-      $clauses = array();
+      $clause = $operator == 'or' ? db_or() : db_and();
       foreach ($this->handler->table_aliases as $value => $alias) {
-        $clauses[] = "$alias.$field = $placeholder";
+        $clause->condition("$alias.$field", $this->handler->value);
       }
 
-      $group = empty($options['group']) ? 0 : $options['group'];
-
       // implode on either AND or OR.
-      $this->handler->query->add_where($group, implode(' ' . strtoupper($operator) . ' ', $clauses), $this->handler->value);
+      $this->handler->query->add_where($options['group'], $clause);
     }
   }
 }
@@ -913,7 +834,7 @@
     $filter->operator = 'or';
     $filter->value = preg_split('/[+ ]/', $str);
   }
-  else if (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) {
+  elseif (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) {
     $filter->operator = 'and';
     $filter->value = explode(',', $str);
   }
@@ -948,14 +869,14 @@
   }
 
   // set up the database timezone
-  if (in_array($GLOBALS['db_type'], array('mysql', 'mysqli', 'pgsql'))) {
+  if (in_array(db_driver(), array('mysql', 'mysqli', 'pgsql'))) {
     $offset = '+00:00';
-    static $already_set = false;
+    static $already_set = FALSE;
     if (!$already_set) {
-      if ($GLOBALS['db_type'] == 'pgsql') {
+      if (db_driver() == 'pgsql') {
         db_query("SET TIME ZONE INTERVAL '$offset' HOUR TO MINUTE");
       }
-      elseif ($GLOBALS['db_type'] == 'mysqli' || version_compare(mysql_get_server_info(), '4.1.3', '>=')) {
+      elseif (db_driver() == 'mysql') {
         db_query("SET @@session.time_zone = '$offset'");
       }
 
@@ -981,7 +902,7 @@
  *   An appropriate SQL string for the db type and field type.
  */
 function views_date_sql_field($field, $field_type = 'int', $set_offset = NULL) {
-  $db_type = $GLOBALS['db_type'];
+  $db_type = db_driver();
   $offset = $set_offset !== NULL ? $set_offset : views_get_timezone();
   switch ($db_type) {
     case 'mysql':
@@ -1029,7 +950,7 @@
  *   An appropriate SQL string for the db type and field type.
  */
 function views_date_sql_format($format, $field, $field_type = 'int', $set_offset = NULL) {
-  $db_type = $GLOBALS['db_type'];
+  $db_type = db_driver();
   $field = views_date_sql_field($field, $field_type, $set_offset);
   switch ($db_type) {
     case 'mysql':
@@ -1075,7 +996,7 @@
  *   An appropriate SQL string for the db type and field type.
  */
 function views_date_sql_extract($extract_type, $field, $field_type = 'int', $set_offset = NULL) {
-  $db_type = $GLOBALS['db_type'];
+  $db_type = db_driver();
   $field = views_date_sql_field($field, $field_type, $set_offset);
 
   // Note there is no space after FROM to avoid db_rewrite problems
@@ -1126,130 +1047,55 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function views_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/handlers',
-    ),
-    'handlers' => array(
-      // argument handlers
-      'views_handler_argument' => array(
-        'parent' => 'views_handler',
-      ),
-      'views_handler_argument_numeric' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_formula' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_date' => array(
-        'parent' => 'views_handler_argument_formula',
-      ),
-      'views_handler_argument_string' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_many_to_one' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_null' => array(
-        'parent' => 'views_handler_argument',
-      ),
-
-      // field handlers
-      'views_handler_field' => array(
-        'parent' => 'views_handler',
-      ),
-      'views_handler_field_date' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_boolean' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_markup' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_xss' => array(
-        'parent' => 'views_handler_field',
-        'file' => 'views_handler_field.inc',
-      ),
-      'views_handler_field_url' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_file_size' => array(
-        'parent' => 'views_handler_field',
-        'file' => 'views_handler_field.inc',
-      ),
-      'views_handler_field_prerender_list' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_numeric' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_custom' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_counter' => array(
-        'parent' => 'views_handler_field',
-      ),
-
-      // filter handlers
-      'views_handler_filter' => array(
-        'parent' => 'views_handler',
-      ),
-      'views_handler_filter_equality' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      'views_handler_filter_string' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      'views_handler_filter_boolean_operator' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      'views_handler_filter_boolean_operator_string' => array(
-        'parent' => 'views_handler_filter_boolean_operator',
-      ),
-      'views_handler_filter_in_operator' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      'views_handler_filter_numeric' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      'views_handler_filter_float' => array(
-        'parent' => 'views_handler_filter_numeric',
-      ),
-      'views_handler_filter_date' => array(
-        'parent' => 'views_handler_filter_numeric',
-      ),
-      'views_handler_filter_many_to_one' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-
-      // relationship handlers
-      'views_handler_relationship' => array(
-        'parent' => 'views_handler',
-      ),
-
-
-      // sort handlers
-      'views_handler_sort' => array(
-        'parent' => 'views_handler',
-      ),
-      'views_handler_sort_formula' => array(
-        'parent' => 'views_handler_sort',
-      ),
-      'views_handler_sort_date' => array(
-        'parent' => 'views_handler_sort',
-      ),
-      'views_handler_sort_menu_hierarchy' => array(
-        'parent' => 'views_handler_sort',
-      ),
-      'views_handler_sort_random' => array(
-        'parent' => 'views_handler_sort',
-      ),
-    ),
+    // argument handlers
+    'views_handler_argument',
+    'views_handler_argument_numeric',
+    'views_handler_argument_formula',
+    'views_handler_argument_date',
+    'views_handler_argument_string',
+    'views_handler_argument_many_to_one',
+    'views_handler_argument_null',
+
+    // field handlers
+    'views_handler_field',
+    'views_handler_field_date',
+    'views_handler_field_boolean',
+    'views_handler_field_markup',
+    'views_handler_field_xss',
+    'views_handler_field_url',
+    'views_handler_field_file_size',
+    'views_handler_field_prerender_list',
+    'views_handler_field_numeric',
+    'views_handler_field_custom',
+    'views_handler_field_counter',
+
+    // filter handlers
+    'views_handler_filter',
+    'views_handler_filter_equality',
+    'views_handler_filter_string',
+    'views_handler_filter_boolean_operator',
+    'views_handler_filter_boolean_operator_string',
+    'views_handler_filter_in_operator',
+    'views_handler_filter_numeric',
+    'views_handler_filter_float',
+    'views_handler_filter_date',
+    'views_handler_filter_many_to_one',
+
+    // relationship handlers
+    'views_handler_relationship',
+
+
+    // sort handlers
+    'views_handler_sort',
+    'views_handler_sort_formula',
+    'views_handler_sort_date',
+    'views_handler_sort_menu_hierarchy',
+    'views_handler_sort_random',
   );
 }
 
@@ -1321,7 +1167,7 @@
       $this->extra = $extra;
       $this->type = strtoupper($type);
     }
-    else if (!empty($this->definition)) {
+    elseif (!empty($this->definition)) {
       // if no arguments, construct from definition.
       // These four must exist or it will throw notices.
       $this->table = $this->definition['table'];
@@ -1342,7 +1188,7 @@
   /**
    * Build the SQL for the join this object represents.
    */
-  function join($table, &$query) {
+  function join_data($table, $query) {
     if (empty($this->definition['table formula'])) {
       $right_table = "{" . $this->table . "}";
     }
@@ -1359,7 +1205,7 @@
       $left_field = $this->left_field;
     }
 
-    $output = " $this->type JOIN $right_table $table[alias] ON $left_field = $table[alias].$this->field";
+    $condition = "$left_field = $table[alias].$this->field";
 
     // Tack on the extra.
     if (isset($this->extra)) {
@@ -1403,18 +1249,18 @@
 
         if ($extras) {
           if (count($extras) == 1) {
-            $output .= ' AND ' . array_shift($extras);
+            $condition .= ' AND ' . array_shift($extras);
           }
           else {
-            $output .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';
+            $condition .= ' AND (' . implode(' ' . $this->extra_type . ' ', $extras) . ')';
           }
         }
       }
-      else if ($this->extra && is_string($this->extra)) {
-        $output .= " AND ($this->extra)";
+      elseif ($this->extra && is_string($this->extra)) {
+        $condition .= " AND ($this->extra)";
       }
     }
-    return $output;
+    return array('table' => $table['table'], 'alias' => $table['alias'], 'condition' => $condition);
   }
 
   /**
@@ -1434,7 +1280,7 @@
         }
       }
     }
-    else if (empty($info['numeric'])) {
+    elseif (empty($info['numeric'])) {
       $output = db_escape_string($input);
     }
     else {
@@ -1452,7 +1298,7 @@
 // Declare API compatibility on behalf of core modules:
 
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  *
  * This one is used as the base to reduce errors when updating.
  */

=== modified file 'includes/plugins.inc'
--- includes/plugins.inc	2009-10-17 18:33:18 +0000
+++ includes/plugins.inc	2009-10-18 10:19:36 +0000
@@ -7,20 +7,14 @@
  */
 
 /**
- * Implementation of hook_views_plugins
+ * Implements hook_views_plugins
  */
 function views_views_plugins() {
-  $path = drupal_get_path('module', 'views') . '/js';
+  $js_path = drupal_get_path('module', 'views') . '/js';
   return array(
-    'module' => 'views', // This just tells our themes are elsewhere.
+    // display, style, row, argument default, argument validator and access.
     'display' => array(
-      'parent' => array(
-        // this isn't really a display but is necessary so the file can
-        // be included.
-        'no ui' => TRUE,
-        'handler' => 'views_plugin_display',
-        'parent' => '',
-      ),
+      // Default settings for all display plugins.
       'default' => array(
         'title' => t('Defaults'),
         'help' => t('Default settings for this view.'),
@@ -28,7 +22,7 @@
         'theme' => 'views_view',
         'no ui' => TRUE,
         'no remove' => TRUE,
-        'js' => array('misc/collapse.js', 'misc/textarea.js', 'misc/tabledrag.js', 'misc/autocomplete.js', "$path/dependent.js"),
+        'js' => array('misc/collapse.js', 'misc/textarea.js', 'misc/tabledrag.js', 'misc/autocomplete.js', "$js_path/dependent.js"),
         'use ajax' => TRUE,
         'use pager' => TRUE,
         'use more' => TRUE,
@@ -72,7 +66,6 @@
         'title' => t('Feed'),
         'help' => t('Display the view as a feed, such as an RSS feed.'),
         'handler' => 'views_plugin_display_feed',
-        'parent' => 'page', // so it knows to load the page plugin .inc file
         'uses hook menu' => TRUE,
         'use ajax' => FALSE,
         'use pager' => FALSE,
@@ -82,13 +75,7 @@
       ),
     ),
     'style' => array(
-      'parent' => array(
-        // this isn't really a display but is necessary so the file can
-        // be included.
-        'no ui' => TRUE,
-        'handler' => 'views_plugin_style',
-        'parent' => '',
-      ),
+      // Default settings for all style plugins.
       'default' => array(
         'title' => t('Unformatted'),
         'help' => t('Displays rows one after another.'),
@@ -144,7 +131,6 @@
         'title' => t('Unformatted'),
         'help' => t('Displays the summary unformatted, with option for one after another or inline.'),
         'handler' => 'views_plugin_style_summary_unformatted',
-        'parent' => 'default_summary',
         'theme' => 'views_view_summary_unformatted',
         'type' => 'summary', // only shows up as a summary style
         'uses options' => TRUE,
@@ -162,13 +148,6 @@
       ),
     ),
     'row' => array(
-      'parent' => array(
-        // this isn't really a display but is necessary so the file can
-        // be included.
-        'no ui' => TRUE,
-        'handler' => 'views_plugin_row',
-        'parent' => '',
-      ),
       'fields' => array(
         'title' => t('Fields'),
         'help' => t('Displays the fields with an optional template.'),
@@ -181,8 +160,6 @@
       ),
     ),
     'argument default' => array(
-      // This type of plugin does not conform to the standard and
-      // uses 'fixed' as the parent rather than having a separate parent.
       'fixed' => array(
         'title' => t('Fixed entry'),
         'handler' => 'views_plugin_argument_default',
@@ -190,15 +167,9 @@
       'php' => array(
         'title' => t('PHP Code'),
         'handler' => 'views_plugin_argument_default_php',
-        'parent' => 'fixed',
       ),
     ),
     'argument validator' => array(
-      'parent' => array(
-        'no ui' => TRUE,
-        'handler' => 'views_plugin_argument_validate',
-        'parent' => '',
-      ),
       'php' => array(
         'title' => t('PHP Code'),
         'handler' => 'views_plugin_argument_validate_php',
@@ -209,11 +180,6 @@
       ),
     ),
     'access' => array(
-      'parent' => array(
-        'no ui' => TRUE,
-        'handler' => 'views_plugin_access',
-        'parent' => '',
-      ),
       'none' => array(
         'title' => t('None'),
         'help' => t('Will be available to all users.'),

=== modified file 'includes/tabs.inc'
--- includes/tabs.inc	2009-10-17 18:33:18 +0000
+++ includes/tabs.inc	2009-10-18 21:54:34 +0000
@@ -132,7 +132,7 @@
     }
 
     drupal_alter('views_tabset', $this);
-    return theme('views_tabset', $this->tabs, $this->extra, $this->selected);
+    return theme('views_tabset', array('tabs' => $this->tabs, 'extra' => $this->extra, 'selected' => $this->selected));
   }
 }
 
@@ -157,7 +157,7 @@
    * Generate HTML output for a tab.
    */
   function render() {
-    return theme('views_tab', $this->body);
+    return theme('views_tab', array('body' => $this->body));
   }
 }
 
@@ -166,7 +166,10 @@
  *
  * @todo Turn this into a template.
  */
-function theme_views_tabset($tabs, $extra = NULL, $selected = NULL) {
+function theme_views_tabset($variables) {
+  $tabs = $variables['tabs'];
+  $extra = isset($variables['extra']) ? $variables['extra'] : NULL;
+  $selected = isset($variables['selected']) ? $variables['selected'] : NULL;
   $link_output = "<div class=\"views-tabs\"><ul id=\"views-tabset\">\n";
   $tab_output = "<div class=\"views-tab-area\">\n";
 
@@ -182,12 +185,12 @@
 
   $link_output .= "</div>\n";
   $tab_output .= "</div>\n";
-  return '<div class="views-tabset clear-block">' . $link_output . $tab_output . '</div>';
+  return '<div class="views-tabset clearfix">' . $link_output . $tab_output . '</div>';
 }
 
 /**
  * Theme a simple tab.
  */
-function theme_views_tab($body) {
-  return $body;
+function theme_views_tab($variables) {
+  return $variables['body'];
 }

=== modified file 'includes/view.inc'
--- includes/view.inc	2009-10-17 18:33:18 +0000
+++ includes/view.inc	2009-10-19 19:54:49 +0000
@@ -196,7 +196,7 @@
       // has already been set; if it has, but $this->current_display is not
       // set, then something is dreadfully wrong.
       if (!empty($this->display[$id]->handler)) {
-        $this->display[$id] = drupal_clone($this->display[$id]);
+        $this->display[$id] = clone $this->display[$id];
         unset($this->display[$id]->handler);
       }
       $this->display[$id]->handler = views_get_plugin('display', $this->display[$id]->display_plugin);
@@ -212,7 +212,7 @@
         }
       }
     }
-
+    
     $this->current_display = 'default';
     $this->display_handler = &$this->display['default']->handler;
 
@@ -270,7 +270,7 @@
     if (empty($this->display[$display_id])) {
       $display_id = 'default';
       if (empty($this->display[$display_id])) {
-        vpr(t('set_display() called with invalid display id @display.', array('@display' => $display_id)));
+        debug(t('set_display() called with invalid display id @display.', array('@display' => $display_id)));
         return FALSE;
       }
     }
@@ -562,7 +562,7 @@
     // Attempt to load from cache.
     // @todo Load a build_info from cache.
 
-    $start = views_microtime();
+    $start = microtime(TRUE);
     // If that fails, let's build!
     $this->build_info = array(
       'query' => '',
@@ -601,7 +601,7 @@
 
     // Arguments can, in fact, cause this whole thing to abort.
     if (!$this->_build_arguments()) {
-      $this->build_time = views_microtime() - $start;
+      $this->build_time = microtime(TRUE) - $start;
       $this->attach_displays();
       return $this->built;
     }
@@ -645,7 +645,7 @@
     $this->query->build($this);
 
     $this->built = TRUE;
-    $this->build_time = views_microtime() - $start;
+    $this->build_time = microtime(TRUE) - $start;
 
     // Attach displays
     $this->attach_displays();
@@ -693,13 +693,6 @@
       $function($this);
     }
 
-    $query = db_rewrite_sql($this->build_info['query'], $this->base_table, $this->base_field, array('view' => &$this));
-    $count_query = db_rewrite_sql($this->build_info['count_query'], $this->base_table, $this->base_field, array('view' => &$this));
-
-    $args = $this->build_info['query_args'];
-
-    vpr($query);
-
     // Check for already-cached results.
     if (!empty($this->live_preview)) {
       $cache = FALSE;
@@ -708,10 +701,13 @@
       $cache = $this->display_handler->get_cache_plugin();
     }
     if ($cache && $cache->cache_get('results')) {
-      vpr('Used cached results');
+      debug('Used cached results');
     }
     else {
       $this->query->execute($this);
+      if ($cache) {
+        $cache->cache_set('results');
+      }
     }
 
     $this->executed = TRUE;
@@ -728,9 +724,9 @@
       return;
     }
 
-    init_theme();
+    drupal_theme_initialize();
 
-    $start = views_microtime();
+    $start = microtime(TRUE);
     if (!empty($this->live_preview) && variable_get('views_show_additional_queries', FALSE)) {
       $this->start_query_capture();
     }
@@ -743,7 +739,7 @@
       $cache = $this->display_handler->get_cache_plugin();
     }
     if ($cache && $cache->cache_get('output')) {
-      vpr('Used cached output');
+      debug('Used cached output');
     }
     else {
       if ($cache) {
@@ -801,7 +797,7 @@
     if (!empty($this->live_preview) && variable_get('views_show_additional_queries', FALSE)) {
       $this->end_query_capture();
     }
-    $this->render_time = views_microtime() - $start;
+    $this->render_time = microtime(TRUE) - $start;
 
     return $this->display_handler->output;
   }
@@ -951,7 +947,7 @@
    * Called to get hook_block information from the view and the
    * named display handler.
    */
-  function execute_hook_block($display_id = NULL) {
+  function execute_hook_block_list($display_id = NULL) {
     // Prepare the view with the information we have.
 
     // This was probably already called, but it's good to be safe.
@@ -961,7 +957,7 @@
 
     // Execute the view
     if (isset($this->display_handler)) {
-      return $this->display_handler->execute_hook_block();
+      return $this->display_handler->execute_hook_block_list();
     }
   }
 
@@ -1208,35 +1204,42 @@
 
     // We want a NULL value to return TRUE here, so we can't use isset() or empty().
     if (!array_key_exists($arg, $cache) || $reset) {
-      $where = (is_numeric($arg) ? "vid =  %d" : "name = '%s'");
-      $data = db_fetch_object(db_query("SELECT * FROM {views_view} WHERE $where", $arg));
-      if (empty($data)) {
-        $cache[$arg] = NULL;
-      }
-      else {
-        $view = new view();
-        $view->load_row($data);
-        $view->type = t('Normal');
-        // Load all of our subtables.
-        foreach ($view->db_objects() as $key) {
-          $object_name = "views_$key";
-          $result = db_query("SELECT * FROM {{$object_name}} WHERE vid = %d ORDER BY position", $view->vid);
-
-          while ($data = db_fetch_object($result)) {
-            $object = new $object_name(FALSE);
-            $object->load_row($data);
-
-            // Because it can get complicated with this much indirection,
-            // make a shortcut reference.
-            $location = &$view->$key;
-
-            // If we have a basic id field, load the item onto the view based on
-            // this ID, otherwise push it on.
-            if (!empty($object->id)) {
-              $location[$object->id] = $object;
-            }
-            else {
-              $location[] = $object;
+      $result = db_select('views_view', 'v')
+        ->fields('v')
+        ->condition(is_numeric($arg) ? 'vid' : 'name', $arg)
+        ->execute();
+      foreach ($result as $data) {
+        if (empty($data)) {
+          $cache[$arg] = NULL;
+        }
+        else {
+          $view = new view();
+          $view->load_row($data);
+          $view->type = t('Normal');
+          // Load all of our subtables.
+          foreach ($view->db_objects() as $key) {
+            $object_name = "views_$key";
+            $result = db_select($object_name, 'v')
+              ->fields('v')
+              ->condition('vid', $view->vid)
+              ->orderBy('position')
+              ->execute();
+            foreach ($result as $data) {
+              $object = new $object_name(FALSE);
+              $object->load_row($data);
+
+              // Because it can get complicated with this much indirection,
+              // make a shortcut reference.
+              $location = &$view->$key;
+
+              // If we have a basic id field, load the item onto the view based on
+              // this ID, otherwise push it on.
+              if (!empty($object->id)) {
+                $location[$object->id] = $object;
+              }
+              else {
+                $location[] = $object;
+              }
             }
           }
         }
@@ -1262,7 +1265,7 @@
     $vids = array();
 
     // Load all the views.
-    while ($data = db_fetch_object($result)) {
+    foreach ($result as $data) {
       $view = new view;
       $view->load_row($data);
       $view->loaded = TRUE;
@@ -1280,9 +1283,10 @@
     // Now load all the subtables:
     foreach (view::db_objects() as $key) {
       $object_name = "views_$key";
-      $result = db_query("SELECT * FROM {{$object_name}} WHERE vid IN ($vids) ORDER BY vid, position");
+      $result = db_query("SELECT * FROM {{$object_name}} WHERE vid IN (:vids) ORDER BY vid, position",
+        array(':vids' => array_keys($names)));
 
-      while ($data = db_fetch_object($result)) {
+      foreach ($result as $data) {
         $object = new $object_name(FALSE);
         $object->load_row($data);
 
@@ -1316,7 +1320,9 @@
     if (!empty($this->vid)) {
       // remove existing table entries
       foreach ($this->db_objects() as $key) {
-        db_query("DELETE from {views_" . $key . "} WHERE vid = %d", $this->vid);
+        db_delete('views_' . $key)
+          ->condition('vid', $this->vid)
+          ->execute();
       }
     }
 
@@ -1352,10 +1358,14 @@
       return;
     }
 
-    db_query("DELETE FROM {views_view} WHERE vid = %d", $this->vid);
+    db_delete('views_view')
+      ->condition('vid', $this->vid)
+      ->execute();
     // Delete from all of our subtables as well.
     foreach ($this->db_objects() as $key) {
-      db_query("DELETE from {views_" . $key . "} WHERE vid = %d", $this->vid);
+      db_delete('views_'. $key)
+        ->condition('vid', $this->vid)
+        ->execute();
     }
 
     cache_clear_all('views_query:' . $this->name, 'cache_views');
@@ -1452,7 +1462,7 @@
     // *were not cloned*. We must clone them ourselves.
     $displays = array();
     foreach ($clone->display as $id => $display) {
-      $displays[$id] = drupal_clone($display);
+      $displays[$id] = clone $display;
       if (isset($displays[$id]->handler)) {
         unset($displays[$id]->handler);
       }
@@ -1578,7 +1588,7 @@
         if (!empty($info['serialize']) && isset($info['serialized default'])) {
           $this->$field = unserialize($info['serialized default']);
         }
-        else if (isset($info['default'])) {
+        elseif (isset($info['default'])) {
           $this->$field = $info['default'];
         }
         else {
@@ -1595,8 +1605,8 @@
    *   If true this will be an UPDATE query. Otherwise it will be an INSERT.
    */
   function save_row($update = NULL) {
-    $schema = drupal_get_schema($this->db_table);
     $fields = $defs = $values = $serials = array();
+    $schema = drupal_get_schema($this->db_table);
 
     // Go through our schema and build correlations.
     foreach ($schema['fields'] as $field => $info) {
@@ -1605,48 +1615,24 @@
         $serials[] = $field;
         continue;
       }
-      $fields[] = $field;
-      switch ($info['type']) {
-        case 'blob':
-          $defs[] = '%b';
-          break;
-        case 'int':
-          $defs[] = '%d';
-          break;
-        case 'float':
-        case 'numeric':
-          $defs[] = '%f';
-          break;
-        default:
-          $defs[] = "'%s'";
-      }
-      if (empty($info['serialize'])) {
-        $values[] = $this->$field;
-      }
-      else {
-        $values[] = serialize($this->$field);
-      }
+      $fields[$field] = empty($info['serialize']) ? $this->$field : serialize($this->$field);
     }
-    $query = '';
     if (!$update) {
-      $query = "INSERT INTO {" . $this->db_table . "} (" . implode(', ', $fields) . ') VALUES (' . implode(', ', $defs) . ')';
+      $query = db_insert($this->db_table);
     }
     else {
-      $query = '';
-      foreach ($fields as $id => $field) {
-        if ($query) {
-          $query .= ', ';
-        }
-        $query .= $field . ' = ' . $defs[$id];
-      }
-      $query = "UPDATE {" . $this->db_table . "} SET " . $query . " WHERE $update = " . $this->$update;
+      $query = db_update($this->db_table)
+        ->condition($update, $this->$update);
     }
-    db_query($query, $values);
+    $return = $query
+      ->fields($fields)
+      ->execute();
 
     if ($serials && !$update) {
       // get last insert ids and fill them in.
+      // Well, one ID.
       foreach ($serials as $field) {
-        $this->$field = db_last_insert_id($this->db_table, $field);
+        $this->$field = $return;
       }
     }
   }
@@ -1667,7 +1653,7 @@
 
     // Go through our schema and build correlations.
     foreach ($schema['fields'] as $field => $info) {
-      $this->$field = empty($info['serialize']) ? $data->$field : unserialize(db_decode_blob($data->$field));
+      $this->$field = empty($info['serialize']) ? $data->$field : unserialize($data->$field);
     }
   }
 

=== modified file 'js/ajax.js'
--- js/ajax.js	2009-10-17 18:33:18 +0000
+++ js/ajax.js	2009-10-19 05:17:54 +0000
@@ -4,310 +4,76 @@
  *
  * Handles AJAX submission and response in Views UI.
  */
-
-Drupal.Views.Ajax = Drupal.Views.Ajax || {};
-
-/**
- * Handles the simple process of setting the ajax form area with new data.
- */
-Drupal.Views.Ajax.setForm = function(title, output) {
-  $(Drupal.settings.views.ajax.title).html(title);
-  $(Drupal.settings.views.ajax.id).html(output);
-}
-
-/**
- * An ajax responder that accepts a packet of JSON data and acts appropriately.
- *
- * The following fields control behavior.
- * - 'display': Display the associated data in the form area; bind the new
- *   form to 'url' if appropriate. The 'title' field may also be used.
- * - 'add': This is a keyed array of HTML output to add via append. The key is
- *   the id to append via $(key).append(value)
- * - 'replace': This is a keyed array of HTML output to add via replace. The key is
- *   the id to append via $(key).html(value)
- * 
- */
-Drupal.Views.Ajax.ajaxResponse = function(data) {
-  $('a.views-throbbing').removeClass('views-throbbing');
-  $('span.views-throbbing').remove();
-
-  if (data.debug) {
-    alert(data.debug);
-  }
-
-  // See if we have any settings to extend. Do this first so that behaviors
-  // can access the new settings easily.
-
-  if (Drupal.settings.viewsAjax) {
-    Drupal.settings.viewsAjax = {};
-  }
-  if (data.js) {
-    $.extend(Drupal.settings, data.js);
-  }
-
-  // Check the 'display' for data.
-  if (data.display) {
-    Drupal.Views.Ajax.setForm(data.title, data.display);
-
-    // if a URL was supplied, bind the form to it.
-    if (data.url) {
-      var ajax_area = Drupal.settings.views.ajax.id;
-      var ajax_title = Drupal.settings.views.ajax.title;
-    
-      // Bind a click to the button to set the value for the button.
-      $('input[type=submit], button', ajax_area).unbind('click');
-      $('input[type=submit], button', ajax_area).click(function() {
-        $('form', ajax_area).append('<input type="hidden" name="' 
-          + $(this).attr('name') + '" value="' + $(this).val() + '">');
-        $(this).after('<span class="views-throbbing">&nbsp</span>');
-      });
-
-      // Bind forms to ajax submit.
-      $('form', ajax_area).unbind('submit'); // be safe here.
-      $('form', ajax_area).submit(function(arg) {
-        $(this).ajaxSubmit({
-          url: data.url,
-          data: '',
-          type: 'POST',
-          success: Drupal.Views.Ajax.ajaxResponse,
-          error: function() { $('span.views-throbbing').remove(); alert(Drupal.t("An error occurred at @path.", {'@path': data.url})); },
-          dataType: 'json'
-        });
-        return false;
-      });
-    }
-
-    Drupal.attachBehaviors(ajax_area);
-  }
-  else {
-    // If no display, reset the form.
-    Drupal.Views.Ajax.setForm('', Drupal.settings.views.ajax.defaultForm);
-    //Enable the save button.
-    $('#edit-save').removeAttr('disabled');
-    // Trigger an update for the live preview when we reach this state:
-    $('#views-ui-preview-form').trigger('submit');
-  } 
-
-  // Go through the 'add' array and add any new content we're instructed to add.
-  if (data.add) {
-    for (id in data.add) {
-      var newContent = $(id).append(data.add[id]);
-      Drupal.attachBehaviors(newContent);
-    }
-  }
-
-  // Go through the 'replace' array and replace any content we're instructed to.
-  if (data.replace) {
-    for (id in data.replace) {
-      $(id).html(data.replace[id]);
-      Drupal.attachBehaviors(id);
-    }
-  }
-
-  // Go through and add any requested tabs
-  if (data.tab) {
-    for (id in data.tab) {
-      $('#views-tabset').addTab(id, data.tab[id]['title'], 0);
-      $(id).html(data.tab[id]['body']);
-      $(id).addClass('views-tab');
-      Drupal.attachBehaviors(id);
-
-      // This is kind of annoying, but we have to actually to find where the new
-      // tab is.
-      var instance = $.ui.tabs.instances[$('#views-tabset').get(0).UI_TABS_UUID];
-      $('#views-tabset').clickTab(instance.$tabs.length);
-    }
-  }
-  
-  if (data.hilite) {
-    $('.hilited').removeClass('hilited');
-    $(data.hilite).addClass('hilited');
-  }
-
-  if (data.changed) {
-    $('div.views-basic-info').addClass('changed');
-  }
-}
-
-/**
- * An ajax responder that accepts a packet of JSON data and acts appropriately.
- * This one specifically responds to the Views live preview area, so it's
- * hardcoded and specialized.
- */
-Drupal.Views.Ajax.previewResponse = function(data) {
-  $('a.views-throbbing').removeClass('views-throbbing');
-  $('span.views-throbbing').remove();
-
-  if (data.debug) {
-    alert(data.debug);
-  }
-
-  // See if we have any settings to extend. Do this first so that behaviors
-  // can access the new settings easily.
-
-  // Clear any previous viewsAjax settings.
-  if (Drupal.settings.viewsAjax) {
-    Drupal.settings.viewsAjax = {};
-  }
-  if (data.js) {
-    $.extend(Drupal.settings, data.js);
-  }
-
-  // Check the 'display' for data.
-  if (data.display) {
-    var ajax_area = 'div#views-live-preview';
-    $(ajax_area).html(data.display);
-
-    var url = $(ajax_area, 'form').attr('action');
-
-    // if a URL was supplied, bind the form to it.
-    if (url) {   
-      // Bind a click to the button to set the value for the button.
-      $('input[type=submit], button', ajax_area).unbind('click');
-      $('input[type=submit], button', ajax_area).click(function() {
-        $('form', ajax_area).append('<input type="hidden" name="' 
-          + $(this).attr('name') + '" value="' + $(this).val() + '">');
-        $(this).after('<span class="views-throbbing">&nbsp</span>');
-      });
-
-      // Bind forms to ajax submit.
-      $('form', ajax_area).unbind('submit'); // be safe here.
-      $('form', ajax_area).submit(function() {
-        $(this).ajaxSubmit({
-          url: url,
-          data: '',
-          type: 'POST',
-          success: Drupal.Views.Ajax.previewResponse,
-          error: function() { $('span.views-throbbing').remove(); alert(Drupal.t("An error occurred at @path.", {'@path': url})); },
-          dataType: 'json'
-        });
-        return false;
-      });
-    }
-
-    Drupal.attachBehaviors(ajax_area);
-  }
-}
-
-Drupal.Views.updatePreviewForm = function() {
-  var url = $(this).attr('action');
-  url = url.replace('nojs', 'ajax');
-
-  $('input[type=submit], button', this).after('<span class="views-throbbing">&nbsp</span>');
-  $(this).ajaxSubmit({
-    url: url,
-    data: '',
-    type: 'POST',
-    success: Drupal.Views.Ajax.previewResponse,
-    error: function() { $('span.views-throbbing').remove(); alert(Drupal.t("An error occurred at @path.", {'@path': url})); },
-    dataType: 'json'
-  });
-
-  return false;
-}
-
-Drupal.Views.updatePreviewFilterForm = function() {
-  var url = $(this).attr('action');
-  url = url.replace('nojs', 'ajax');
-
-  $('input[type=submit], button', this).after('<span class="views-throbbing">&nbsp</span>');
-  $('input[name=q]', this).remove(); // remove 'q' for live preview.
-  $(this).ajaxSubmit({
-    url: url,
-    data: '',
-    type: 'GET',
-    success: Drupal.Views.Ajax.previewResponse,
-    error: function() { $('span.views-throbbing').remove(); alert(Drupal.t("An error occurred at @path.", {'@path': url})); },
-    dataType: 'json'
-  });
-
-  return false;
-}
-
-Drupal.Views.updatePreviewLink = function() {
-  var url = $(this).attr('href');
-  url = url.replace('nojs', 'ajax');
-  if (url.substring(0, 18) != '/admin/build/views') {
-    return true;
-  }
-
-  $(this).addClass('views-throbbing');
-  $.ajax({
-    url: url,
-    data: '',
-    type: 'POST',
-    success: Drupal.Views.Ajax.previewResponse,
-    error: function() { $(this).removeClass('views-throbbing'); alert(Drupal.t("An error occurred at @path.", {'@path': url})); },
-    dataType: 'json'
-  });
-
-  return false;   
-}
-
-Drupal.behaviors.ViewsAjaxLinks = function() {
-  // Make specified links ajaxy.
-  $('a.views-ajax-link:not(.views-processed)').addClass('views-processed').click(function() {
-    // Translate the href on the link to the ajax href. That way this degrades
-    // into a nice, normal link.
-    var url = $(this).attr('href');
-    url = url.replace('nojs', 'ajax');
-
-    // Turn on the hilite to indicate this is in use.
-    $(this).addClass('hilite');
-
-    // Disable the save button.
-    $('#edit-save').attr('disabled', 'true');
-    
-    $(this).addClass('views-throbbing');
-    $.ajax({
-      type: "POST",
-      url: url,
-      data: '',
-      success: Drupal.Views.Ajax.ajaxResponse,
-      error: function() { $(this).removeClass('views-throbbing'); alert(Drupal.t("An error occurred at @path.", {'@path': url})); },
-      dataType: 'json'
-    });
-    
-    return false;
-  });  
-
-  $('form.views-ajax-form:not(.views-processed)').addClass('views-processed').submit(function(arg) {
-    // Translate the href on the link to the ajax href. That way this degrades
-    // into a nice, normal link.
-    var url = $(this).attr('action');
-    url = url.replace('nojs', 'ajax');
-
-//    $('input[@type=submit]', this).after('<span class="views-throbbing">&nbsp</span>');
-    $(this).ajaxSubmit({
-      url: url,
-      data: '',
-      type: 'POST',
-      success: Drupal.Views.Ajax.ajaxResponse,
-      error: function() { $('span.views-throbbing').remove(); alert(Drupal.t("An error occurred at @path.", {'@path': url})); },
-      dataType: 'json'
-    });
-
-    return false;   
-  });
-
-  // Bind the live preview to where it's supposed to go.
-
-  $('form#views-ui-preview-form:not(.views-processed)')
-    .addClass('views-processed')
-    .submit(Drupal.Views.updatePreviewForm);
-
-  $('div#views-live-preview form:not(.views-processed)')
-    .addClass('views-processed')
-    .submit(Drupal.Views.updatePreviewFilterForm);
-
-  $('div#views-live-preview a:not(.views-processed)')
-    .addClass('views-processed')
-    .click(Drupal.Views.updatePreviewLink);
+(function ($) {
+
+Drupal.ajax.prototype.commands.viewsSetForm = function(ajax, response, status) {
+  var ajax_title = Drupal.settings.views.ajax.title,
+    ajax_area = Drupal.settings.views.ajax.id;
+  $(ajax_title).html(response.title);
+  $(ajax_area).html(response.output);
+  Drupal.attachBehaviors($(ajax_area).add($(ajax_title)), ajax.settings);
+  if (response.url) {
+    var submit = $('input[type=submit]', ajax_area).unbind('click').click(function() {
+      $('form', ajax_area).append('<input type="hidden" name="' + $(this).attr('name') + '" value="' + $(this).val() + '">');
+      $(this).after('<span class="views-throbbing">&nbsp</span>');
+    })
+    $('form', ajax_area).once('views-ajax-submit-processed').each(function() {
+      var element_settings = { 'url': response.url, 'event': 'submit', 'progress': { 'type': 'throbber' } };
+      var form = $(this)[0];
+      form.form = form;
+      Drupal.ajax[$(this).attr('id')] = new Drupal.ajax($(this).attr('id'), form, element_settings);
+    });
+  }
+};
+
+Drupal.ajax.prototype.commands.viewsDismissForm = function(ajax, response, status) {
+  Drupal.ajax.prototype.commands.viewsSetForm({}, {'title': '', 'output': Drupal.settings.views.ajax.defaultForm});
+}
+
+Drupal.ajax.prototype.commands.viewsHilite = function(ajax, response, status) {
+  $('.hilited').removeClass('hilited');
+  $(response.selector).addClass('hilited');
+};
+
+Drupal.ajax.prototype.commands.viewsAddTab = function(ajax, response, status) {
+  var id = '#views-tab-' + response.id;
+  $('#views-tabset').viewsAddTab(id, response.title, 0);
+  $(id).html(response.body).addClass('views-tab');
+  Drupal.attachBehaviors(response.id);
+  var instance = $.viewsUi.tabs.instances[$('#views-tabset').get(0).UI_TABS_UUID];
+  $('#views-tabset').viewsClickTab(instance.$tabs.length);
+};
+
+Drupal.ajax.prototype.commands.viewsDisableButtons = function(ajax, response, status) {
+  $('#views-ui-edit-view-form input').attr('disabled', 'disabled');
+}
+
+Drupal.ajax.prototype.commands.viewsEnableButtons = function(ajax, response, status) {
+  $('#views-ui-edit-view-form input').removeAttr('disabled');
 }
 
 /**
  * Get rid of irritating tabledrag messages
  */
-Drupal.theme.tableDragChangedWarning = function () { 
-  return ' '; 
+Drupal.theme.tableDragChangedWarning = function () {
+  return ' ';
 }
+
+Drupal.behaviors.viewsAjax = {
+  attach: function(context) {
+    // Bind AJAX behaviors to all items showing the class.
+    $('.views-ajax-link', context).once('views-ajax-processed').each(function () {
+      var element_settings = { 'event': 'click' };
+
+      // For anchor tags, these will go to the target of the anchor rather
+      // than the usual location.
+      if ($(this).attr('href')) {
+        element_settings.url = $(this).attr('href');
+      }
+      var base = $(this).attr('id');
+      Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
+    });
+  }
+};
+
+})(jQuery);

=== modified file 'js/ajax_view.js'
--- js/ajax_view.js	2009-10-17 18:33:18 +0000
+++ js/ajax_view.js	2009-10-18 07:37:31 +0000
@@ -5,6 +5,7 @@
  *
  * Handles AJAX fetching of views, including filter submission and response.
  */
+(function ($) {
 
 Drupal.Views.Ajax = Drupal.Views.Ajax || {};
 
@@ -29,7 +30,7 @@
     $view = $newView;
     Drupal.attachBehaviors($view.parent());
   }
- 
+
   if (response.messages) {
     // Show any messages (but first remove old ones, if there are any).
     $view.find('.views-messages').remove().end().prepend(response.messages);
@@ -37,7 +38,7 @@
 };
 
 /**
- * Ajax behavior for views. 
+ * Ajax behavior for views.
  */
 Drupal.behaviors.ViewsAjaxView = function() {
   if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) {
@@ -154,3 +155,5 @@
     }); // .each Drupal.settings.views.ajaxViews
   } // if
 };
+
+})(jQuery);

=== modified file 'js/base.js'
--- js/base.js	2009-10-17 18:33:18 +0000
+++ js/base.js	2009-10-18 21:54:34 +0000
@@ -4,28 +4,29 @@
  *
  * Some basic behaviors and utility functions for Views.
  */
+(function ($) {
 
 Drupal.Views = {};
 
 /**
  * jQuery UI tabs, Views integration component
  */
-Drupal.behaviors.viewsTabs = function (context) {
-  if ($.ui && $.ui.tabs) {
-    $('#views-tabset:not(.views-processed)').addClass('views-processed').tabs({
+Drupal.behaviors.viewsTabs = {
+  attach: function (context) {
+  if ($.viewsUi && $.viewsUi.tabs) {
+    $('#views-tabset').once('views-processed').viewsTabs({
       selectedClass: 'active'
     });
   }
 
-  $('a.views-remove-link')
-    .addClass('views-processed')
-    .click(function() {
+  $('a.views-remove-link').once('views-processed').click(function() {
       var id = $(this).attr('id').replace('views-remove-link-', '');
       $('#views-row-' + id).hide();
       $('#views-removed-' + id).attr('checked', true);
       return false;
     });
-}
+  }
+};
 
 /**
  * For IE, attach some javascript so that our hovers do what they're supposed
@@ -122,4 +123,4 @@
   return href;
 };
 
-
+})(jQuery);
\ No newline at end of file

=== modified file 'js/dependent.js'
--- js/dependent.js	2009-10-17 18:33:18 +0000
+++ js/dependent.js	2009-10-19 05:17:54 +0000
@@ -7,20 +7,20 @@
  *
  * To your $form item definition add:
  * - '#process' => array('views_process_dependency'),
- * - Add '#dependency' => array('id-of-form-item' => array(list, of, values, that, 
+ * - Add '#dependency' => array('id-of-form-item' => array(list, of, values, that,
      make, this, item, show),
  *
  * Special considerations:
  * - radios are harder. Because Drupal doesn't give radio groups individual ids,
- *   use 'radio:name-of-radio' 
+ *   use 'radio:name-of-radio'
  *
- * - Checkboxes don't have their own id, so you need to add one in a div 
+ * - Checkboxes don't have their own id, so you need to add one in a div
  *   around the checkboxes via #prefix and #suffix. You actually need to add TWO
  *   divs because it's the parent that gets hidden. Also be sure to retain the
- *   'expand_checkboxes' in the #process array, because the views process will
+ *   'form_process_checkboxes' in the #process array, because the views process will
  *   override it.
  */
-
+(function ($) {
 Drupal.Views = Drupal.Views || {};
 
 Drupal.Views.dependent = { bindings: {}, activeBindings: {}, activeTriggers: [] };
@@ -38,7 +38,7 @@
 }
 
 
-Drupal.Views.dependent.autoAttach = function() {
+Drupal.Views.dependent.autoAttach = function(settings) {
   // Clear active bindings and triggers.
   for (i in Drupal.Views.dependent.activeTriggers) {
     jQuery(Drupal.Views.dependent.activeTriggers[i]).unbind('change');
@@ -47,20 +47,20 @@
   Drupal.Views.dependent.activeBindings = {};
   Drupal.Views.dependent.bindings = {};
 
-  if (!Drupal.settings.viewsAjax) {
+  if (!settings.viewsAjax) {
     return;
   }
 
   // Iterate through all relationships
-  for (id in Drupal.settings.viewsAjax.formRelationships) {
+  for (id in settings.viewsAjax.formRelationships) {
 
-    // Drupal.Views.dependent.activeBindings[id] is a boolean, 
+    // Drupal.Views.dependent.activeBindings[id] is a boolean,
     // whether the binding is active or not.  Defaults to no.
     Drupal.Views.dependent.activeBindings[id] = 0;
     // Iterate through all possible values
-    for(bind_id in Drupal.settings.viewsAjax.formRelationships[id].values) {
+    for(bind_id in settings.viewsAjax.formRelationships[id].values) {
       // This creates a backward relationship.  The bind_id is the ID
-      // of the element which needs to change in order for the id to hide or become shown.  
+      // of the element which needs to change in order for the id to hide or become shown.
       // The id is the ID of the item which will be conditionally hidden or shown.
       // Here we're setting the bindings for the bind
       // id to be an empty array if it doesn't already have bindings to it
@@ -70,7 +70,7 @@
       // Add this ID
       Drupal.Views.dependent.bindings[bind_id].push(id);
       // Big long if statement.
-      // Drupal.settings.viewsAjax.formRelationships[id].values[bind_id] holds the possible values
+      // settings.viewsAjax.formRelationships[id].values[bind_id] holds the possible values
 
       if (bind_id.substring(0, 6) == 'radio:') {
         var trigger_id = "input[name='" + bind_id.substring(6) + "']";
@@ -93,14 +93,14 @@
           switch (jQuery(trigger).attr('type')) {
             case 'checkbox':
               var val = jQuery(trigger).attr('checked') || 0;
-              
+
               if (val) {
                 $(trigger).parent().removeClass('hidden-options').addClass('expanded-options');
               }
               else {
                 $(trigger).parent().removeClass('expanded-options').addClass('hidden-options');
               }
-              
+
               break;
             default:
               var val = jQuery(trigger).val();
@@ -128,7 +128,7 @@
               Drupal.Views.dependent.activeBindings[id] = {};
             }
 
-            if (Drupal.Views.dependent.inArray(Drupal.settings.viewsAjax.formRelationships[id].values[bind_id], val)) {
+            if (Drupal.Views.dependent.inArray(settings.viewsAjax.formRelationships[id].values[bind_id], val)) {
               Drupal.Views.dependent.activeBindings[id][bind_id] = 'bind';
             }
             else {
@@ -142,10 +142,10 @@
 
             var object = jQuery('#' + id + '-wrapper');
             if (!object.size()) {
-              object = jQuery('#' + id).parent();
+              object = jQuery('#' + id).parents('.form-item:first');
             }
 
-            if (Drupal.settings.viewsAjax.formRelationships[id].num <= len) {
+            if (settings.viewsAjax.formRelationships[id].num <= len) {
               // Show if the element if criteria is matched
               object.show(0);
               object.addClass('dependent-options');
@@ -170,22 +170,26 @@
   }
 }
 
-Drupal.behaviors.viewsDependent = function (context) {
-  Drupal.Views.dependent.autoAttach();
+Drupal.behaviors.viewsDependent = {
+  attach: function (context, settings) {
+    Drupal.Views.dependent.autoAttach(settings);
+    
+    // Really large sets of fields are too slow with the above method, so this
+    // is a sort of hacked one that's faster but much less flexible.
+    $("select.views-master-dependent", context)
+      .once('views-processed')
+      .change(function() {
+        var val = $(this).val();
+        if (val == 'all') {
+          $('.views-dependent-all').show();
+        }
+        else {
+          $('.views-dependent-all').hide();
+          $('.views-dependent-' + val).show();
+        }
+      })
+      .trigger('change');
+  }
+};
 
-  // Really large sets of fields are too slow with the above method, so this
-  // is a sort of hacked one that's faster but much less flexible.
-  $("select.views-master-dependent:not(.views-processed)")
-    .addClass('views-processed')
-    .change(function() {
-      var val = $(this).val();
-      if (val == 'all') {
-        $('.views-dependent-all').show(0);
-      }
-      else {
-        $('.views-dependent-all').hide(0);
-        $('.views-dependent-' + val).show(0);
-      }
-    })
-    .trigger('change');
-}
+})(jQuery);

=== added file 'js/tabs.js'
--- js/tabs.js	1970-01-01 00:00:00 +0000
+++ js/tabs.js	2009-10-18 22:17:20 +0000
@@ -0,0 +1,438 @@
+// $Id: tabs.js,v 1.4 2009/06/02 17:12:13 merlinofchaos Exp $
+
+/**
+ * @file tabs.js
+ * jQuery UI Tabs (Tabs 3)
+ * 
+ * This is nothing more than the pure jquery UI tabs implementation.
+ */
+(function($) {
+
+   // if the UI scope is not availalable, add it
+  $.viewsUi = $.viewsUi || {};
+
+  $.fn.viewsTabs = function(initial, options) {
+    if (initial && initial.constructor == Object) { // shift arguments
+      options = initial;
+      initial = null;
+    }
+    options = options || {};
+
+    // first get initial tab from options
+    initial = initial && initial.constructor == Number && --initial || 0;
+
+    return this.each(function() {
+    new $.viewsUi.tabs(this, $.extend(options, { initial: initial }));
+    });
+  };
+
+  // chainable tabs methods
+  $.each(['Add', 'Remove', 'Enable', 'Disable', 'Click', 'Load'], function(i, method) {
+    $.fn['views' + method + 'Tab'] = function() {
+      var args = arguments;
+      return this.each(function() {
+        var instance = $.viewsUi.tabs.instances[this.UI_TABS_UUID];
+        instance[method.toLowerCase()].apply(instance, args);
+      });
+    };
+  });
+  $.fn.viewsSelectedTab = function(returnElement) {
+    var selected;
+    if (returnElement) {
+
+    } else {
+
+    }
+    return selected;
+  };
+
+  $.viewsUi.tabs = function(el, options) {
+
+    this.source = el;
+
+    this.options = $.extend({
+
+      // basic setup
+      initial: 0,
+      event: 'click',
+      disabled: [],
+      // TODO bookmarkable: $.ajaxHistory ? true : false,
+      unselected: false,
+      toggle: options.unselected ? true : false,
+
+      // Ajax
+      spinner: 'Loading&#8230;',
+      cache: false,
+      hashPrefix: 'tab-',
+
+      // animations
+      /*fxFade: null,
+      fxSlide: null,
+      fxShow: null,
+      fxHide: null,*/
+      fxSpeed: 'normal',
+      /*fxShowSpeed: null,
+      fxHideSpeed: null,*/
+
+      // callbacks
+      add: function() {},
+      remove: function() {},
+      enable: function() {},
+      disable: function() {},
+      click: function() {},
+      hide: function() {},
+      show: function() {},
+      load: function() {},
+
+      // CSS classes
+      navClass: 'ui-tabs-nav',
+      selectedClass: 'ui-tabs-selected',
+      disabledClass: 'ui-tabs-disabled',
+      containerClass: 'ui-tabs-container',
+      hideClass: 'ui-tabs-hide',
+      loadingClass: 'ui-tabs-loading'
+
+    }, options);
+
+    this.tabify(true);
+
+    // save instance for later
+    var uuid = 'instance-' + $.viewsUi.tabs.prototype.count++;
+    $.viewsUi.tabs.instances[uuid] = this;
+    this.source['UI_TABS_UUID'] = uuid;
+
+  };
+
+  // static
+  $.viewsUi.tabs.instances = {};
+
+  $.extend($.viewsUi.tabs.prototype, {
+    animating: false,
+    count: 0,
+    tabify: function(init) {
+
+      this.$tabs = $('a:first-child', this.source);
+      this.$containers = $([]);
+
+      var self = this, o = this.options;
+
+      this.$tabs.each(function(i, a) {
+        // inline tab
+        if (a.hash && a.hash.replace('#', '')) { // safari 2 reports '#' for an empty hash
+          self.$containers = self.$containers.add(a.hash);
+        }
+        // remote tab
+        else {
+          var id = a.title && a.title.replace(/\s/g, '_') || o.hashPrefix + (self.count + 1) + '-' + (i + 1), url = a.href;
+          a.href = '#' + id;
+          a.url = url;
+          self.$containers = self.$containers.add(
+            $('#' + id)[0] || $('<div id="' + id + '" class="' + o.containerClass + '"></div>')
+              .insertAfter( self.$containers[i - 1] || self.source )
+          );
+        }
+      });
+
+      if (init) {
+
+        // Try to retrieve initial tab from fragment identifier in url if present,
+        // otherwise try to find selected class attribute on <li>.
+        this.$tabs.each(function(i, a) {
+          if (location.hash) {
+            if (a.hash == location.hash) {
+              o.initial = i;
+              // prevent page scroll to fragment
+              //if (($.browser.msie || $.browser.opera) && !o.remote) {
+              if ($.browser.msie || $.browser.opera) {
+                var $toShow = $(location.hash), toShowId = $toShow.attr('id');
+                $toShow.attr('id', '');
+                setTimeout(function() {
+                  $toShow.attr('id', toShowId); // restore id
+                }, 500);
+              }
+              scrollTo(0, 0);
+              return false; // break
+            }
+          } else if ( $(a).parents('li:eq(0)').is('li.' + o.selectedClass) ) {
+            o.initial = i;
+            return false; // break
+          }
+        });
+
+        // attach necessary classes for styling if not present
+        $(this.source).is('.' + o.navClass) || $(this.source).addClass(o.navClass);
+        this.$containers.each(function() {
+          var $this = $(this);
+          $this.is('.' + o.containerClass) || $this.addClass(o.containerClass);
+        });
+
+        // highlight tab accordingly
+        var $lis = $('li', this.source);
+        this.$containers.addClass(o.hideClass);
+        $lis.removeClass(o.selectedClass);
+        if (!o.unselected) {
+          this.$containers.slice(o.initial, o.initial + 1).show();
+          $lis.slice(o.initial, o.initial + 1).addClass(o.selectedClass);
+        }
+
+        // trigger load of initial tab is remote tab
+        if (this.$tabs[o.initial].url) {
+          this.load(o.initial + 1, this.$tabs[o.initial].url);
+          if (o.cache) {
+            this.$tabs[o.initial].url = null; // if loaded once do not load them again
+          }
+        }
+
+        // disabled tabs
+        for (var i = 0, position; position = o.disabled[i]; i++) {
+          this.disable(position);
+        }
+
+      }
+
+      // setup animations
+      var showAnim = {}, hideAnim = {}, showSpeed = o.fxShowSpeed || o.fxSpeed, 
+        hideSpeed = o.fxHideSpeed || o.fxSpeed;
+      if (o.fxSlide || o.fxFade) {
+        if (o.fxSlide) {
+          showAnim['height'] = 'show';
+          hideAnim['height'] = 'hide';
+        }
+        if (o.fxFade) {
+          showAnim['opacity'] = 'show';
+          hideAnim['opacity'] = 'hide';
+        }
+      } else {
+        if (o.fxShow) {
+          showAnim = o.fxShow;
+        } else { // use some kind of animation to prevent browser scrolling to the tab
+          showAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
+          showSpeed = 1; // as little as 1 is sufficient
+        }
+        if (o.fxHide) {
+          hideAnim = o.fxHide;
+        } else { // use some kind of animation to prevent browser scrolling to the tab
+          hideAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
+          hideSpeed = 1; // as little as 1 is sufficient
+        }
+      }
+
+      // callbacks
+      var click = o.click, hide = o.hide, show = o.show;
+
+      // reset some styles to maintain print style sheets etc.
+      var resetCSS = { display: '', overflow: '', height: '' };
+      if (!$.browser.msie) { // not in IE to prevent ClearType font issue
+        resetCSS['opacity'] = '';
+      }
+
+      // hide a tab, animation prevents browser scrolling to fragment
+      function hideTab(clicked, $hide, $show) {
+        $hide.animate(hideAnim, hideSpeed, function() { //
+          $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.            
+          hide(clicked, $show, $hide[0]);
+          if ($show) {
+            showTab(clicked, $hide, $show);
+          }
+        });
+      }
+
+      // show a tab, animation prevents browser scrolling to fragment
+      function showTab(clicked, $hide, $show) {
+        // show next tab
+        if (!(o.fxSlide || o.fxFade || o.fxShow)) {
+          $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab containers
+        }
+        $show.animate(showAnim, showSpeed, function() {
+          $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
+          if ($.browser.msie) {
+            $hide[0].style.filter = '';
+            $show[0].style.filter = '';
+          }
+          show(clicked, $show[0], $hide[0]);
+          self.animating = false;
+        });
+
+      }
+
+      // switch a tab
+      function switchTab(clicked, $hide, $show) {
+        /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
+          $.ajaxHistory.update(clicked.hash);
+        }*/
+        $(clicked).parents('li:eq(0)').addClass(o.selectedClass)
+          .siblings().removeClass(o.selectedClass);
+        hideTab(clicked, $hide, $show);
+      }
+
+      // tab click handler
+      function tabClick(e) {
+
+        //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
+        var $li = $(this).parents('li:eq(0)'), $hide = self.$containers.filter(':visible'), $show = $(this.hash);
+
+        // if tab may be closed
+        if (o.toggle && !$li.is('.' + o.disabledClass) && !self.animating) {       
+          if ($li.is('.' + o.selectedClass)) {
+            $li.removeClass(o.selectedClass);
+            hideTab(this, $hide);
+            this.blur();
+            return false;
+          } else if (!$hide.length) {
+            $li.addClass(o.selectedClass);
+            showTab(this, $hide, $show);
+            this.blur();
+            return false;
+          }
+        }
+
+        // If tab is already selected or disabled, animation is still running or click callback 
+        // returns false stop here.
+        // Check if click handler returns false last so that it is not executed for a disabled tab!
+        if ($li.is('.' + o.selectedClass + ', .' + o.disabledClass) 
+          || self.animating || click(this, $show[0], $hide[0]) === false) {
+          this.blur();
+          return false;
+        }
+
+        self.animating = true;
+
+        // show new tab
+        if ($show.length) {
+
+          // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
+          /*if ($.browser.msie && o.bookmarkable) {
+            var showId = this.hash.replace('#', '');
+            $show.attr('id', '');
+            setTimeout(function() {
+              $show.attr('id', showId); // restore id
+            }, 0);
+          }*/
+
+          if (this.url) { // remote tab
+            var a = this;
+            self.load(self.$tabs.index(this) + 1, this.url, function() {
+              switchTab(a, $hide, $show);
+            });
+            if (o.cache) {
+              this.url = null; // if loaded once do not load them again
+            }
+          } else {
+            switchTab(this, $hide, $show);
+          }
+
+          // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
+          /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
+          var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
+          setTimeout(function() {
+            scrollTo(scrollX, scrollY);
+          }, 0);*/
+
+        } else {
+          throw Drupal.t('jQuery UI Tabs: Mismatching fragment identifier.');
+        }
+
+        this.blur(); // prevent IE from keeping other link focussed when using the back button
+
+        //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
+        return false;
+
+      }
+
+      // attach click event, avoid duplicates from former tabifying
+      this.$tabs.unbind(o.event, tabClick).bind(o.event, tabClick);
+
+    },
+    add: function(url, text, position) {
+      if (url && text) {
+        var o = this.options;
+        position = position || this.$tabs.length; // append by default
+        if (position >= this.$tabs.length) {
+          var method = 'insertAfter';
+          position = this.$tabs.length;
+        } else {
+          var method = 'insertBefore';
+        }
+        if (url.indexOf('#') == 0) { // ajax container is created by tabify automatically
+          var $container = $(url);
+          // try to find an existing element before creating a new one
+          ($container.length && $container || $('<div id="' + url.replace('#', '') + '" class="' + o.containerClass + ' ' + o.hideClass + '"></div>'))
+            [method](this.$containers[position - 1]);
+        }
+        $('<li><a href="' + url + '"><span>' + text + '</span></a></li>')
+          [method](this.$tabs.slice(position - 1, position).parents('li:eq(0)'));
+        this.tabify();
+        o.add(this.$tabs[position - 1], this.$containers[position - 1]); // callback
+      } else {
+        throw Drupal.t('jQuery UI Tabs: Not enough arguments to add tab.');
+      }
+    },
+    remove: function(position) {
+      if (position && position.constructor == Number) {
+        this.$tabs.slice(position - 1, position).parents('li:eq(0)').remove();
+        this.$containers.slice(position - 1, position).remove();
+        this.tabify();
+      }
+      this.options.remove(); // callback
+    },
+    enable: function(position) {
+      var $li = this.$tabs.slice(position - 1, position).parents('li:eq(0)'), o = this.options;
+      $li.removeClass(o.disabledClass);
+      if ($.browser.safari) { // fix disappearing tab after enabling in Safari... TODO check Safari 3
+        $li.animate({ opacity: 1 }, 1, function() {
+          $li.css({ opacity: '' });
+        });
+      }
+      o.enable(this.$tabs[position - 1], this.$containers[position - 1]); // callback
+    },
+    disable: function(position) {
+      var $li = this.$tabs.slice(position - 1, position).parents('li:eq(0)'), o = this.options;      
+      if ($.browser.safari) { // fix opacity of tab after disabling in Safari... TODO check Safari 3
+        $li.animate({ opacity: 0 }, 1, function() {
+           $li.css({ opacity: '' });
+        });
+      }
+      $li.addClass(this.options.disabledClass);
+      o.disable(this.$tabs[position - 1], this.$containers[position - 1]); // callback
+    },
+    click: function(position) {
+      this.$tabs.slice(position - 1, position).trigger('click');
+    },
+    load: function(position, url, callback) {
+      var self = this,
+        o = this.options,
+        $a = this.$tabs.slice(position - 1, position).addClass(o.loadingClass),
+        $span = $('span', $a),
+        text = $span.html();
+
+      // shift arguments
+      if (url && url.constructor == Function) {
+        callback = url;
+      }
+
+      // set new URL
+      if (url) {
+        $a[0].url = url;
+      }
+
+      // load
+      if (o.spinner) {
+        $span.html('<em>' + o.spinner + '</em>');
+      }
+      setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
+        $($a[0].hash).load(url, function() {
+          if (o.spinner) {
+            $span.html(text);
+          }
+          $a.removeClass(o.loadingClass);
+          // This callback is needed because the switch has to take place after loading
+          // has completed.
+          if (callback && callback.constructor == Function) {
+            callback();
+          }
+          o.load(self.$tabs[position - 1], self.$containers[position - 1]); // callback
+        });
+      }, 0);
+    }
+  });
+})(jQuery);

=== removed file 'js/tabs.js'
--- js/tabs.js	2009-10-17 18:33:18 +0000
+++ js/tabs.js	1970-01-01 00:00:00 +0000
@@ -1,438 +0,0 @@
-// $Id: tabs.js,v 1.3.2.1 2009/06/02 17:12:03 merlinofchaos Exp $
-
-/**
- * @file tabs.js
- * jQuery UI Tabs (Tabs 3)
- * 
- * This is nothing more than the pure jquery UI tabs implementation.
- */
-(function($) {
-
-   // if the UI scope is not availalable, add it
-  $.ui = $.ui || {};
-
-  $.fn.tabs = function(initial, options) {
-    if (initial && initial.constructor == Object) { // shift arguments
-      options = initial;
-      initial = null;
-    }
-    options = options || {};
-
-    // first get initial tab from options
-    initial = initial && initial.constructor == Number && --initial || 0;
-
-    return this.each(function() {
-    new $.ui.tabs(this, $.extend(options, { initial: initial }));
-    });
-  };
-
-  // chainable tabs methods
-  $.each(['add', 'remove', 'enable', 'disable', 'click', 'load'], function(i, method) {
-    $.fn[method + 'Tab'] = function() {
-      var args = arguments;
-      return this.each(function() {
-        var instance = $.ui.tabs.instances[this.UI_TABS_UUID];
-        instance[method].apply(instance, args);
-      });
-    };
-  });
-  $.fn.selectedTab = function(returnElement) {
-    var selected;
-    if (returnElement) {
-
-    } else {
-
-    }
-    return selected;
-  };
-
-  $.ui.tabs = function(el, options) {
-
-    this.source = el;
-
-    this.options = $.extend({
-
-      // basic setup
-      initial: 0,
-      event: 'click',
-      disabled: [],
-      // TODO bookmarkable: $.ajaxHistory ? true : false,
-      unselected: false,
-      toggle: options.unselected ? true : false,
-
-      // Ajax
-      spinner: 'Loading&#8230;',
-      cache: false,
-      hashPrefix: 'tab-',
-
-      // animations
-      /*fxFade: null,
-      fxSlide: null,
-      fxShow: null,
-      fxHide: null,*/
-      fxSpeed: 'normal',
-      /*fxShowSpeed: null,
-      fxHideSpeed: null,*/
-
-      // callbacks
-      add: function() {},
-      remove: function() {},
-      enable: function() {},
-      disable: function() {},
-      click: function() {},
-      hide: function() {},
-      show: function() {},
-      load: function() {},
-
-      // CSS classes
-      navClass: 'ui-tabs-nav',
-      selectedClass: 'ui-tabs-selected',
-      disabledClass: 'ui-tabs-disabled',
-      containerClass: 'ui-tabs-container',
-      hideClass: 'ui-tabs-hide',
-      loadingClass: 'ui-tabs-loading'
-
-    }, options);
-
-    this.tabify(true);
-
-    // save instance for later
-    var uuid = 'instance-' + $.ui.tabs.prototype.count++;
-    $.ui.tabs.instances[uuid] = this;
-    this.source['UI_TABS_UUID'] = uuid;
-
-  };
-
-  // static
-  $.ui.tabs.instances = {};
-
-  $.extend($.ui.tabs.prototype, {
-    animating: false,
-    count: 0,
-    tabify: function(init) {
-
-      this.$tabs = $('a:first-child', this.source);
-      this.$containers = $([]);
-
-      var self = this, o = this.options;
-
-      this.$tabs.each(function(i, a) {
-        // inline tab
-        if (a.hash && a.hash.replace('#', '')) { // safari 2 reports '#' for an empty hash
-          self.$containers = self.$containers.add(a.hash);
-        }
-        // remote tab
-        else {
-          var id = a.title && a.title.replace(/\s/g, '_') || o.hashPrefix + (self.count + 1) + '-' + (i + 1), url = a.href;
-          a.href = '#' + id;
-          a.url = url;
-          self.$containers = self.$containers.add(
-            $('#' + id)[0] || $('<div id="' + id + '" class="' + o.containerClass + '"></div>')
-              .insertAfter( self.$containers[i - 1] || self.source )
-          );
-        }
-      });
-
-      if (init) {
-
-        // Try to retrieve initial tab from fragment identifier in url if present,
-        // otherwise try to find selected class attribute on <li>.
-        this.$tabs.each(function(i, a) {
-          if (location.hash) {
-            if (a.hash == location.hash) {
-              o.initial = i;
-              // prevent page scroll to fragment
-              //if (($.browser.msie || $.browser.opera) && !o.remote) {
-              if ($.browser.msie || $.browser.opera) {
-                var $toShow = $(location.hash), toShowId = $toShow.attr('id');
-                $toShow.attr('id', '');
-                setTimeout(function() {
-                  $toShow.attr('id', toShowId); // restore id
-                }, 500);
-              }
-              scrollTo(0, 0);
-              return false; // break
-            }
-          } else if ( $(a).parents('li:eq(0)').is('li.' + o.selectedClass) ) {
-            o.initial = i;
-            return false; // break
-          }
-        });
-
-        // attach necessary classes for styling if not present
-        $(this.source).is('.' + o.navClass) || $(this.source).addClass(o.navClass);
-        this.$containers.each(function() {
-          var $this = $(this);
-          $this.is('.' + o.containerClass) || $this.addClass(o.containerClass);
-        });
-
-        // highlight tab accordingly
-        var $lis = $('li', this.source);
-        this.$containers.addClass(o.hideClass);
-        $lis.removeClass(o.selectedClass);
-        if (!o.unselected) {
-          this.$containers.slice(o.initial, o.initial + 1).show();
-          $lis.slice(o.initial, o.initial + 1).addClass(o.selectedClass);
-        }
-
-        // trigger load of initial tab is remote tab
-        if (this.$tabs[o.initial].url) {
-          this.load(o.initial + 1, this.$tabs[o.initial].url);
-          if (o.cache) {
-            this.$tabs[o.initial].url = null; // if loaded once do not load them again
-          }
-        }
-
-        // disabled tabs
-        for (var i = 0, position; position = o.disabled[i]; i++) {
-          this.disable(position);
-        }
-
-      }
-
-      // setup animations
-      var showAnim = {}, hideAnim = {}, showSpeed = o.fxShowSpeed || o.fxSpeed, 
-        hideSpeed = o.fxHideSpeed || o.fxSpeed;
-      if (o.fxSlide || o.fxFade) {
-        if (o.fxSlide) {
-          showAnim['height'] = 'show';
-          hideAnim['height'] = 'hide';
-        }
-        if (o.fxFade) {
-          showAnim['opacity'] = 'show';
-          hideAnim['opacity'] = 'hide';
-        }
-      } else {
-        if (o.fxShow) {
-          showAnim = o.fxShow;
-        } else { // use some kind of animation to prevent browser scrolling to the tab
-          showAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
-          showSpeed = 1; // as little as 1 is sufficient
-        }
-        if (o.fxHide) {
-          hideAnim = o.fxHide;
-        } else { // use some kind of animation to prevent browser scrolling to the tab
-          hideAnim['min-width'] = 0; // avoid opacity, causes flicker in Firefox
-          hideSpeed = 1; // as little as 1 is sufficient
-        }
-      }
-
-      // callbacks
-      var click = o.click, hide = o.hide, show = o.show;
-
-      // reset some styles to maintain print style sheets etc.
-      var resetCSS = { display: '', overflow: '', height: '' };
-      if (!$.browser.msie) { // not in IE to prevent ClearType font issue
-        resetCSS['opacity'] = '';
-      }
-
-      // hide a tab, animation prevents browser scrolling to fragment
-      function hideTab(clicked, $hide, $show) {
-        $hide.animate(hideAnim, hideSpeed, function() { //
-          $hide.addClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.            
-          hide(clicked, $show, $hide[0]);
-          if ($show) {
-            showTab(clicked, $hide, $show);
-          }
-        });
-      }
-
-      // show a tab, animation prevents browser scrolling to fragment
-      function showTab(clicked, $hide, $show) {
-        // show next tab
-        if (!(o.fxSlide || o.fxFade || o.fxShow)) {
-          $show.css('display', 'block'); // prevent occasionally occuring flicker in Firefox cause by gap between showing and hiding the tab containers
-        }
-        $show.animate(showAnim, showSpeed, function() {
-          $show.removeClass(o.hideClass).css(resetCSS); // maintain flexible height and accessibility in print etc.
-          if ($.browser.msie) {
-            $hide[0].style.filter = '';
-            $show[0].style.filter = '';
-          }
-          show(clicked, $show[0], $hide[0]);
-          self.animating = false;
-        });
-
-      }
-
-      // switch a tab
-      function switchTab(clicked, $hide, $show) {
-        /*if (o.bookmarkable && trueClick) { // add to history only if true click occured, not a triggered click
-          $.ajaxHistory.update(clicked.hash);
-        }*/
-        $(clicked).parents('li:eq(0)').addClass(o.selectedClass)
-          .siblings().removeClass(o.selectedClass);
-        hideTab(clicked, $hide, $show);
-      }
-
-      // tab click handler
-      function tabClick(e) {
-
-        //var trueClick = e.clientX; // add to history only if true click occured, not a triggered click
-        var $li = $(this).parents('li:eq(0)'), $hide = self.$containers.filter(':visible'), $show = $(this.hash);
-
-        // if tab may be closed
-        if (o.toggle && !$li.is('.' + o.disabledClass) && !self.animating) {       
-          if ($li.is('.' + o.selectedClass)) {
-            $li.removeClass(o.selectedClass);
-            hideTab(this, $hide);
-            this.blur();
-            return false;
-          } else if (!$hide.length) {
-            $li.addClass(o.selectedClass);
-            showTab(this, $hide, $show);
-            this.blur();
-            return false;
-          }
-        }
-
-        // If tab is already selected or disabled, animation is still running or click callback 
-        // returns false stop here.
-        // Check if click handler returns false last so that it is not executed for a disabled tab!
-        if ($li.is('.' + o.selectedClass + ', .' + o.disabledClass) 
-          || self.animating || click(this, $show[0], $hide[0]) === false) {
-          this.blur();
-          return false;
-        }
-
-        self.animating = true;
-
-        // show new tab
-        if ($show.length) {
-
-          // prevent scrollbar scrolling to 0 and than back in IE7, happens only if bookmarking/history is enabled
-          /*if ($.browser.msie && o.bookmarkable) {
-            var showId = this.hash.replace('#', '');
-            $show.attr('id', '');
-            setTimeout(function() {
-              $show.attr('id', showId); // restore id
-            }, 0);
-          }*/
-
-          if (this.url) { // remote tab
-            var a = this;
-            self.load(self.$tabs.index(this) + 1, this.url, function() {
-              switchTab(a, $hide, $show);
-            });
-            if (o.cache) {
-              this.url = null; // if loaded once do not load them again
-            }
-          } else {
-            switchTab(this, $hide, $show);
-          }
-
-          // Set scrollbar to saved position - need to use timeout with 0 to prevent browser scroll to target of hash
-          /*var scrollX = window.pageXOffset || document.documentElement && document.documentElement.scrollLeft || document.body.scrollLeft || 0;
-          var scrollY = window.pageYOffset || document.documentElement && document.documentElement.scrollTop || document.body.scrollTop || 0;
-          setTimeout(function() {
-            scrollTo(scrollX, scrollY);
-          }, 0);*/
-
-        } else {
-          throw Drupal.t('jQuery UI Tabs: Mismatching fragment identifier.');
-        }
-
-        this.blur(); // prevent IE from keeping other link focussed when using the back button
-
-        //return o.bookmarkable && !!trueClick; // convert trueClick == undefined to Boolean required in IE
-        return false;
-
-      }
-
-      // attach click event, avoid duplicates from former tabifying
-      this.$tabs.unbind(o.event, tabClick).bind(o.event, tabClick);
-
-    },
-    add: function(url, text, position) {
-      if (url && text) {
-        var o = this.options;
-        position = position || this.$tabs.length; // append by default
-        if (position >= this.$tabs.length) {
-          var method = 'insertAfter';
-          position = this.$tabs.length;
-        } else {
-          var method = 'insertBefore';
-        }
-        if (url.indexOf('#') == 0) { // ajax container is created by tabify automatically
-          var $container = $(url);
-          // try to find an existing element before creating a new one
-          ($container.length && $container || $('<div id="' + url.replace('#', '') + '" class="' + o.containerClass + ' ' + o.hideClass + '"></div>'))
-            [method](this.$containers[position - 1]);
-        }
-        $('<li><a href="' + url + '"><span>' + text + '</span></a></li>')
-          [method](this.$tabs.slice(position - 1, position).parents('li:eq(0)'));
-        this.tabify();
-        o.add(this.$tabs[position - 1], this.$containers[position - 1]); // callback
-      } else {
-        throw Drupal.t('jQuery UI Tabs: Not enough arguments to add tab.');
-      }
-    },
-    remove: function(position) {
-      if (position && position.constructor == Number) {
-        this.$tabs.slice(position - 1, position).parents('li:eq(0)').remove();
-        this.$containers.slice(position - 1, position).remove();
-        this.tabify();
-      }
-      this.options.remove(); // callback
-    },
-    enable: function(position) {
-      var $li = this.$tabs.slice(position - 1, position).parents('li:eq(0)'), o = this.options;
-      $li.removeClass(o.disabledClass);
-      if ($.browser.safari) { // fix disappearing tab after enabling in Safari... TODO check Safari 3
-        $li.animate({ opacity: 1 }, 1, function() {
-          $li.css({ opacity: '' });
-        });
-      }
-      o.enable(this.$tabs[position - 1], this.$containers[position - 1]); // callback
-    },
-    disable: function(position) {
-      var $li = this.$tabs.slice(position - 1, position).parents('li:eq(0)'), o = this.options;      
-      if ($.browser.safari) { // fix opacity of tab after disabling in Safari... TODO check Safari 3
-        $li.animate({ opacity: 0 }, 1, function() {
-           $li.css({ opacity: '' });
-        });
-      }
-      $li.addClass(this.options.disabledClass);
-      o.disable(this.$tabs[position - 1], this.$containers[position - 1]); // callback
-    },
-    click: function(position) {
-      this.$tabs.slice(position - 1, position).trigger('click');
-    },
-    load: function(position, url, callback) {
-      var self = this,
-        o = this.options,
-        $a = this.$tabs.slice(position - 1, position).addClass(o.loadingClass),
-        $span = $('span', $a),
-        text = $span.html();
-
-      // shift arguments
-      if (url && url.constructor == Function) {
-        callback = url;
-      }
-
-      // set new URL
-      if (url) {
-        $a[0].url = url;
-      }
-
-      // load
-      if (o.spinner) {
-        $span.html('<em>' + o.spinner + '</em>');
-      }
-      setTimeout(function() { // timeout is again required in IE, "wait" for id being restored
-        $($a[0].hash).load(url, function() {
-          if (o.spinner) {
-            $span.html(text);
-          }
-          $a.removeClass(o.loadingClass);
-          // This callback is needed because the switch has to take place after loading
-          // has completed.
-          if (callback && callback.constructor == Function) {
-            callback();
-          }
-          o.load(self.$tabs[position - 1], self.$containers[position - 1]); // callback
-        });
-      }, 0);
-    }
-  });
-})(jQuery);

=== modified file 'modules/aggregator.views.inc'
--- modules/aggregator.views.inc	2009-10-17 18:33:18 +0000
+++ modules/aggregator.views.inc	2009-10-18 07:37:31 +0000
@@ -15,7 +15,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function aggregator_views_data() {
   // ----------------------------------------------------------------------
@@ -325,42 +325,28 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function aggregator_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/aggregator',
-    ),
-    'handlers' => array(
-      // field handlers
-      'views_handler_field_aggregator_title_link' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_aggregator_category' => array(
-        'parent' => 'views_handler_field',
-      ),
-
-      // argument handlers
-      'views_handler_argument_aggregator_fid' => array(
-        'parent' => 'views_handler_argument_numeric',
-      ),
-      'views_handler_argument_aggregator_category_cid' => array(
-        'parent' => 'views_handler_argument_numeric',
-      ),
-
-      // filter handlers
-      'views_handler_filter_aggregator_category_cid' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-    ),
+
+    // field handlers
+    'views_handler_field_aggregator_title_link',
+    'views_handler_field_aggregator_category',
+
+    // argument handlers
+    'views_handler_argument_aggregator_fid',
+    'views_handler_argument_aggregator_category_cid',
+
+    // filter handlers
+      'views_handler_filter_aggregator_category_cid',
   );
 }
 
 
 /**
- * Implementation of hook_views_plugins
+ * Implements hook_views_plugins
  */
 function aggregator_views_plugins() {
   return array(
@@ -370,7 +356,7 @@
         'title' => t('Aggregator item'),
         'help' => t('Display the aggregator item using the data from the original source.'),
         'handler' => 'views_plugin_row_aggregator_rss',
-        'path' => drupal_get_path('module', 'views') . '/modules/aggregator', // not necessary for most modules
+        'path' => drupal_get_path('module', 'views') . '/modules/node', // not necessary for most modules
         'theme' => 'views_view_row_rss',
         'base' => array('aggregator_item'), // only works with 'node' as base.
         'uses options' => TRUE,

=== modified file 'modules/aggregator/views_handler_argument_aggregator_category_cid.inc'
--- modules/aggregator/views_handler_argument_aggregator_category_cid.inc	2009-10-17 18:33:18 +0000
+++ modules/aggregator/views_handler_argument_aggregator_category_cid.inc	2009-10-18 21:32:04 +0000
@@ -10,10 +10,9 @@
    */
   function title_query() {
     $titles = array();
-    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
 
-    $result = db_query("SELECT c.title FROM {aggregator_category} c WHERE c.cid IN ($placeholders)", $this->value);
-    while ($term = db_fetch_object($result)) {
+    $result = db_query("SELECT c.title FROM {aggregator_category} c WHERE c.cid IN (:cid)", array(':cid' => $this->value)));
+    foreach ($result as $term) {
       $titles[] = check_plain($term->title);
     }
     return $titles;

=== modified file 'modules/aggregator/views_handler_filter_aggregator_category_cid.inc'
--- modules/aggregator/views_handler_filter_aggregator_category_cid.inc	2009-10-17 18:33:18 +0000
+++ modules/aggregator/views_handler_filter_aggregator_category_cid.inc	2009-10-18 21:32:25 +0000
@@ -13,7 +13,7 @@
     $this->value_options = array();
 
     $result = db_query('SELECT * FROM {aggregator_category} ORDER BY title');
-    while ($category = db_fetch_object($result)) {
+    foreach ($result as $category) {
       $this->value_options[$category->cid] = $category->title;
     }
   }

=== modified file 'modules/aggregator/views_plugin_row_aggregator_rss.inc'
--- modules/aggregator/views_plugin_row_aggregator_rss.inc	2009-10-17 18:33:18 +0000
+++ modules/aggregator/views_plugin_row_aggregator_rss.inc	2009-10-18 21:33:05 +0000
@@ -35,9 +35,9 @@
     $sql =  "SELECT ai.iid, ai.fid, ai.title, ai.link, ai.author, ai.description, ";
     $sql .= "ai.timestamp, ai.guid, af.title AS feed_title, ai.link AS feed_LINK ";
     $sql .= "FROM {aggregator_item} ai LEFT JOIN {aggregator_feed} af ON ai.fid = af.fid ";
-    $sql .= "WHERE ai.iid = %d";
+    $sql .= "WHERE ai.iid = :iid";
 
-    $item = db_fetch_object(db_query($sql, $row->iid));
+    $item = db_query($sql, array(':iid' => $row->iid))->fetchObject();
 
     $item->elements = array(
       array('key' => 'pubDate', 'value' => gmdate('r', $item->timestamp)),
@@ -59,7 +59,11 @@
       }
     }
 
-    return theme($this->theme_functions(), $this->view, $this->options, $item);
+    return theme($this->theme_functions(), array(
+      'view' => $this->view,
+      'options' => $this->options,
+      'row' => $item
+    ));
   }
 }
 

=== modified file 'modules/book.views.inc'
--- modules/book.views.inc	2009-10-17 18:33:18 +0000
+++ modules/book.views.inc	2009-10-18 07:37:31 +0000
@@ -12,7 +12,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function book_views_data() {
   // ----------------------------------------------------------------------

=== modified file 'modules/book.views_convert.inc'
--- modules/book.views_convert.inc	2009-10-17 18:33:18 +0000
+++ modules/book.views_convert.inc	2009-10-18 07:37:31 +0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_views_convert().
+ * Implements hook_views_convert().
  */
 function book_views_convert($display, $type, &$view, $field, $id = NULL) {
   switch ($type) {

=== modified file 'modules/comment.views.inc'
--- modules/comment.views.inc	2009-10-17 18:33:18 +0000
+++ modules/comment.views.inc	2009-10-19 05:20:08 +0000
@@ -13,22 +13,22 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 
 function comment_views_data() {
   // Define the base group of this table. Fields that don't
   // have a group defined will go into this field by default.
-  $data['comments']['table']['group']  = t('Comment');
+  $data['comment']['table']['group']  = t('Comment');
 
-  $data['comments']['table']['base'] = array(
+  $data['comment']['table']['base'] = array(
     'field' => 'cid',
     'title' => t('Comment'),
     'help' => t("Comments are responses to node content."),
   );
 
   //joins
-  $data['comments']['table']['join'] = array(
+  $data['comment']['table']['join'] = array(
     //...to the node table
     'node' => array(
       'left_field' => 'nid',
@@ -40,7 +40,7 @@
   // Fields
 
   // subject
-  $data['comments']['subject'] = array(
+  $data['comment']['subject'] = array(
     'title' => t('Title'),
     'help' => t('The title of the comment.'),
     'field' => array(
@@ -59,7 +59,7 @@
   );
 
   // comment (the comment body)
-  $data['comments']['comment'] = array(
+  $data['comment']['comment'] = array(
     'title' => t('Body'),
     'help' => t('The text of the comment.'),
     'field' => array(
@@ -72,7 +72,7 @@
   );
 
   // cid
-  $data['comments']['cid'] = array(
+  $data['comment']['cid'] = array(
     'title' => t('ID'),
     'help' => t('The comment ID of the field'),
     'field' => array(
@@ -91,7 +91,7 @@
   );
 
   // name (of comment author)
-  $data['comments']['name'] = array(
+  $data['comment']['name'] = array(
     'title' => t('Author'),
     'help' => t("The name of the comment's author. Can be rendered as a link to the author's homepage."),
     'field' => array(
@@ -110,7 +110,7 @@
   );
 
   // homepage
-  $data['comments']['homepage'] = array(
+  $data['comment']['homepage'] = array(
     'title' => t("Author's website"),
     'help' => t("The website address of the comment's author. Can be rendered as a link. Will be empty if the author is a registered user."),
     'field' => array(
@@ -129,7 +129,7 @@
   );
 
   // hostname
-  $data['comments']['hostname'] = array(
+  $data['comment']['hostname'] = array(
     'title' => t('Hostname'),
     'help' => t('Hostname of user that posted the comment.'),
     'field' => array(
@@ -148,7 +148,7 @@
   );
 
   // mail
-  $data['comments']['mail'] = array(
+  $data['comment']['mail'] = array(
     'title' => t('Mail'),
     'help' => t('Email of user that posted the comment. Will be empty if the author is a registered user.'),
     'field' => array(
@@ -166,10 +166,26 @@
     ),
   );
 
-  // timestamp (when comment was posted)
-  $data['comments']['timestamp'] = array(
-    'title' => t('Post date'),
-    'help' => t('Date and time of when the comment was posted.'),
+  // created (when comment was posted)
+  $data['comment']['created'] = array(
+    'title' => t('Post date'),
+    'help' => t('Date and time of when the comment was created.'),
+    'field' => array(
+      'handler' => 'views_handler_field_date',
+      'click sortable' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort_date',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_date',
+    ),
+  );
+
+  // changed (when comment was last updated)
+  $data['comment']['changed'] = array(
+    'title' => t('Post date'),
+    'help' => t('Date and time of when the comment was last updated.'),
     'field' => array(
       'handler' => 'views_handler_field_date',
       'click sortable' => TRUE,
@@ -183,7 +199,7 @@
   );
 
   // status (approved or not)
-  $data['comments']['status'] = array(
+  $data['comment']['status'] = array(
     'title' => t('In moderation'),
     'help' => t('Whether or not the comment is currently in moderation.'),
     'field' => array(
@@ -192,7 +208,7 @@
     ),
     'filter' => array(
       'handler' => 'views_handler_filter_boolean_operator',
-      'label' => t('Moderated'),
+      'label' => t('Published'),
       'type' => 'yes-no',
     ),
     'sort' => array(
@@ -201,7 +217,7 @@
   );
 
   // link to view comment
-  $data['comments']['view_comment'] = array(
+  $data['comment']['view_comment'] = array(
     'field' => array(
       'title' => t('View link'),
       'help' => t('Provide a simple link to view the comment.'),
@@ -210,7 +226,7 @@
   );
 
   // link to edit comment
-  $data['comments']['edit_comment'] = array(
+  $data['comment']['edit_comment'] = array(
     'field' => array(
       'title' => t('Edit link'),
       'help' => t('Provide a simple link to edit the comment.'),
@@ -219,7 +235,7 @@
   );
 
   // link to delete comment
-  $data['comments']['delete_comment'] = array(
+  $data['comment']['delete_comment'] = array(
     'field' => array(
       'title' => t('Delete link'),
       'help' => t('Provide a simple link to delete the comment.'),
@@ -228,7 +244,7 @@
   );
 
   // link to reply to comment
-  $data['comments']['replyto_comment'] = array(
+  $data['comment']['replyto_comment'] = array(
     'field' => array(
       'title' => t('Reply-to link'),
       'help' => t('Provide a simple link to reply to the comment.'),
@@ -236,15 +252,15 @@
     ),
   );
 
-  $data['comments']['node_link'] = array(
+  $data['comment']['node_link'] = array(
     'field' => array(
       'title' => t('Node link'),
       'help' => t('Display the standard comment link used on regular nodes.'),
       'handler' => 'views_handler_field_comment_node_link',
     ),
-  );  
+  );
 
-  $data['comments']['thread'] = array(
+  $data['comment']['thread'] = array(
     'field' => array(
       'title' => t('Depth'),
       'help' => t('Display the depth of the comment if it is threaded.'),
@@ -257,7 +273,7 @@
     ),
   );
 
-  $data['comments']['nid'] = array(
+  $data['comment']['nid'] = array(
     'title' => t('Node'),
     'help' => t('The node the comment is a reply to.'),
     'relationship' => array(
@@ -268,7 +284,7 @@
     ),
   );
 
-  $data['comments']['uid'] = array(
+  $data['comment']['uid'] = array(
     'title' => t('User'),
     'help' => t("The User ID of the comment's author."),
     'relationship' => array(
@@ -279,7 +295,7 @@
     ),
   );
 
-  $data['comments']['pid'] = array(
+  $data['comment']['pid'] = array(
     'title' => t('Parent CID'),
     'help' => t('The Comment ID of the parent comment.'),
     'field' => array(
@@ -288,7 +304,7 @@
     'relationship' => array(
       'title' => t('Parent comment'),
       'help' => t('The parent comment.'),
-      'base' => 'comments',
+      'base' => 'comment',
       'field' => 'cid',
       'handler' => 'views_handler_relationship',
       'label' => t('Parent comment'),
@@ -305,7 +321,7 @@
   $data['node_comment_statistics']['table']['join'] = array(
     //...to the node table
     'node' => array(
-      'type' => 'INNER',      
+      'type' => 'INNER',
       'left_field' => 'nid',
       'field' => 'nid',
      ),
@@ -428,18 +444,18 @@
 }
 
 /**
- * Implementation of hook_views_plugins
+ * Implements hook_views_plugins
  */
 function comment_views_plugins() {
   return array(
-    'module' => 'views', // This just tells views our themes are in Views.
+    'module' => 'views',
     'row' => array(
       'comment' => array(
         'title' => t('Comment'),
         'help' => t('Display the comment with standard comment view.'),
         'handler' => 'views_plugin_row_comment_view',
-        'path' => drupal_get_path('module', 'views') . '/modules/comment', // not necessary for most modules
         'theme' => 'views_view_row_comment',
+        'path' => drupal_get_path('module', 'views') . '/modules/comment', // not necessary for most modules
         'base' => array('comments'), // only works with 'comment' as base.
         'uses options' => TRUE,
         'type' => 'normal',
@@ -449,8 +465,8 @@
         'title' => t('Comment'),
         'help' => t('Display the comment as RSS.'),
         'handler' => 'views_plugin_row_comment_rss',
-        'path' => drupal_get_path('module', 'views') . '/modules/comment', // not necessary for most modules
         'theme' => 'views_view_row_rss',
+        'path' => drupal_get_path('module', 'views') . '/modules/comment', // not necessary for most modules
         'base' => array('comments'), // only works with 'comment' as base.
         'type' => 'feed',
         'help topic' => 'style-comment-rss',
@@ -460,79 +476,36 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function comment_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/comment',
-    ),
-    'handlers' => array(
-      'views_handler_field_comment' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_comment_username' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_comment_depth' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_comment_link' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_comment_link_edit' => array(
-        'parent' => 'views_handler_field_comment_link',
-      ),
-      'views_handler_field_comment_link_delete' => array(
-        'parent' => 'views_handler_field_comment_link',
-      ),
-      'views_handler_field_comment_link_reply' => array(
-        'parent' => 'views_handler_field_comment_link',
-      ),
-      'views_handler_field_comment_node_link' => array(
-       'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_ncs_last_comment_name' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_ncs_last_updated' => array(
-        'parent' => 'views_handler_field_date',
-      ),
-      'views_handler_field_node_new_comments' => array(
-        'parent' => 'views_handler_field_numeric',
-      ),
-      'views_handler_field_node_comment' => array(
-        'parent' => 'views_handler_field',
-      ),
-
-      // sort handlers
-      'views_handler_sort_comment_thread' => array(
-        'parent' => 'views_handler_sort',
-      ),
-      'views_handler_sort_ncs_last_comment_name' => array(
-        'parent' => 'views_handler_sort',
-      ),
-      'views_handler_sort_ncs_last_updated' => array(
-        'parent' => 'views_handler_sort_date',
-      ),
-
-      // filter handlers
-      'views_handler_filter_ncs_last_updated' => array(
-        'parent' => 'views_handler_filter_date',
-      ),
-      'views_handler_filter_node_comment' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-      'views_handler_filter_comment_user_uid' => array(
-        'parent' => 'views_handler_filter_user_name',
-      ),
-
-      // argument handlers
-      'views_handler_argument_comment_user_uid' => array(
-        'parent' => 'views_handler_argument',
-      ),
-    ),
+    'views_handler_field_comment',
+    'views_handler_field_comment_username',
+    'views_handler_field_comment_depth',
+    'views_handler_field_comment_link',
+    'views_handler_field_comment_link_edit',
+    'views_handler_field_comment_link_delete',
+    'views_handler_field_comment_link_reply',
+    'views_handler_field_comment_node_link',
+    'views_handler_field_ncs_last_comment_name',
+    'views_handler_field_ncs_last_updated',
+    'views_handler_field_node_new_comments',
+    'views_handler_field_node_comment',
+
+    // sort handlers
+    'views_handler_sort_comment_thread',
+    'views_handler_sort_ncs_last_comment_name',
+    'views_handler_sort_ncs_last_updated',
+
+    // filter handlers
+    'views_handler_filter_ncs_last_updated',
+    'views_handler_filter_node_comment',
+    'views_handler_filter_comment_user_uid',
+
+    // argument handlers
+    'views_handler_argument_comment_user_uid',
   );
 }
 
@@ -554,7 +527,8 @@
     drupal_alter('link', $links, $node);
   }
 
-  $vars['comment'] = theme('comment_view', $comment, $node, $links);
+  // TODO: Check that this corresponds to a real theme template or function.
+  $vars['comment'] = theme('comment_view', array('comment' => $comment, 'node' => $node, 'links' => $links));
 }
 
 /**

=== modified file 'modules/comment.views_convert.inc'
--- modules/comment.views_convert.inc	2009-10-17 18:33:18 +0000
+++ modules/comment.views_convert.inc	2009-10-18 07:37:31 +0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_views_convert().
+ * Implements hook_views_convert().
  *
  * Intervene to convert field values from the Views 1 format to the
  * Views 2 format. Intervene only if $view->add_item() won't produce

=== modified file 'modules/comment.views_default.inc'
--- modules/comment.views_default.inc	2009-10-17 18:33:18 +0000
+++ modules/comment.views_default.inc	2009-10-18 07:37:31 +0000
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_default_view_views().
+ * Implements hook_default_view_views().
  */
 function comment_views_default_views() {
   $view = new view;
@@ -281,7 +281,7 @@
         'table' => 'comments',
         'field' => 'status',
         'operator' => '=',
-        'value' => 0,
+        'value' => 1,
         'group' => 0,
         'exposed' => FALSE,
         'expose' => array(

=== modified file 'modules/comment/views_handler_argument_comment_user_uid.inc'
--- modules/comment/views_handler_argument_comment_user_uid.inc	2009-10-17 18:33:18 +0000
+++ modules/comment/views_handler_argument_comment_user_uid.inc	2009-10-19 05:17:54 +0000
@@ -11,7 +11,7 @@
       $title = variable_get('anonymous', t('Anonymous'));
     }
     else {
-      $title = db_result(db_query("SELECT u.name FROM {users} u WHERE u.uid = %d", $this->argument));
+      $title = db_query('SELECT u.name FROM {users} u WHERE u.uid = :uid', array(':uid' => $this->argument))->fetchField();
     }
     if (empty($title)) {
       return t('No user');
@@ -36,6 +36,17 @@
 
   function query() {
     $this->ensure_my_table();
-    $this->query->add_where(0, "$this->table_alias.uid = %d OR ((SELECT COUNT(*) FROM {comments} c WHERE c.uid = %d AND c.nid = $this->table_alias.nid) > 0)", $this->argument, $this->argument);
+
+    $subselect = db_select('comments', 'c');
+    $subselect->addField('c', 'cid');
+    $subselect->condition('uid', $this->argument);
+    $subselect->condition('nid', "$this->table_alias.nid");
+    $subselect = $subselect->countQuery();
+
+    $condition = db_or()
+      ->condition("$this->table_alias.uid", $this->argument, $this->operator)
+      ->condition(0, $subselect, '<');
+
+    $this->query->add_where(0, $condition);
   }
 }

=== modified file 'modules/comment/views_handler_field_comment_node_link.inc'
--- modules/comment/views_handler_field_comment_node_link.inc	2009-10-17 18:33:18 +0000
+++ modules/comment/views_handler_field_comment_node_link.inc	2009-10-18 20:06:07 +0000
@@ -6,20 +6,20 @@
 class views_handler_field_comment_node_link extends views_handler_field {
   function construct() {
     parent::construct();
-    
+
     // Add the node fields that comment_link will need..
     $this->additional_fields['nid'] = array(
-      'table' => 'node', 
+      'table' => 'node',
       'field' => 'nid',
-    );      
+    );
     $this->additional_fields['type'] = array(
-      'table' => 'node', 
+      'table' => 'node',
       'field' => 'type',
-    );      
+    );
     $this->additional_fields['comment'] = array(
-      'table' => 'node', 
+      'table' => 'node',
       'field' => 'comment',
-    );      
+    );
   }
 
   function option_definition() {
@@ -30,14 +30,14 @@
 
   function options_form(&$form, &$form_state) {
     parent::options_form($form, $form_state);
-    
+
     $form['teaser'] = array(
       '#type' => 'checkbox',
       '#title' => t('Show teaser-style link'),
       '#default_value' => $this->options['teaser'],
       '#description' => 'Show the comment link in the form used on standard node teasers, rather than the full node form.',
     );
-    
+
   }
 
   function query() {
@@ -51,13 +51,16 @@
     $node->nid      = $values->{$this->aliases['nid']};
     $node->type     = $values->{$this->aliases['type']};
     $node->comment  = $values->{$this->aliases['comment']};
-    
-    // Call comment.module's hook_link: comment_link($type, $node = NULL, $teaser = FALSE) 
-    $links = comment_link('node', $node, $this->options['teaser']); 
+
+    // Call comment.module's hook_link: comment_link($type, $node = NULL, $teaser = FALSE)
+    $links = comment_link('node', $node, $this->options['teaser']);
     // question: should we run these through:    drupal_alter('link', $links, $node);
     // might this have unexpected consequences if these hooks expect items in $node that we don't have?
 
-    return !empty($links) ? theme('links', $links, array('class' => 'links inline')) : '';
+    return !empty($links) ? theme('links', array(
+      'links' => $links,
+      'attributes' => array('class' => 'links inline')))
+      : '';
   }
 }
 

=== modified file 'modules/comment/views_handler_field_comment_username.inc'
--- modules/comment/views_handler_field_comment_username.inc	2009-10-17 18:33:18 +0000
+++ modules/comment/views_handler_field_comment_username.inc	2009-10-18 20:06:23 +0000
@@ -34,7 +34,9 @@
       $account->name = $values->{$this->field_alias};
       $account->homepage = $values->{$this->aliases['homepage']};
 
-      return theme('username', $account);
+      return theme('username', array(
+        'account' => $account
+      ));
     }
     else {
       return $data;

=== modified file 'modules/comment/views_handler_field_ncs_last_comment_name.inc'
--- modules/comment/views_handler_field_ncs_last_comment_name.inc	2009-10-17 18:33:18 +0000
+++ modules/comment/views_handler_field_ncs_last_comment_name.inc	2009-10-18 20:06:37 +0000
@@ -37,7 +37,9 @@
       $account = new stdClass();
       $account->name = $values->{$this->field_alias};
       $account->uid = $values->{$this->uid};
-      return theme('username', $account);
+      return theme('username', array(
+        'account' => $account
+      ));
     }
     else {
       return check_plain($values->{$this->field_alias});

=== modified file 'modules/comment/views_handler_field_node_new_comments.inc'
--- modules/comment/views_handler_field_node_new_comments.inc	2009-10-17 18:33:18 +0000
+++ modules/comment/views_handler_field_node_new_comments.inc	2009-10-18 21:34:01 +0000
@@ -7,7 +7,7 @@
 class views_handler_field_node_new_comments extends views_handler_field_numeric {
   function init(&$view, $options) {
     parent::init($view, $options);
-    
+
     // translate an older setting:
     if (!empty($options['no_empty'])) {
       $this->options['hide_empty'] = TRUE;

=== modified file 'modules/comment/views_handler_filter_comment_user_uid.inc'
--- modules/comment/views_handler_filter_comment_user_uid.inc	2009-10-17 18:33:18 +0000
+++ modules/comment/views_handler_filter_comment_user_uid.inc	2009-10-17 22:49:05 +0000
@@ -8,16 +8,17 @@
 class views_handler_filter_comment_user_uid extends views_handler_filter_user_name {
   function query() {
     $this->ensure_my_table();
-    $replace = array_fill(0, sizeof($this->value), '%d');
-    $condition = $this->operator . ' (' . implode(", ", $replace) . ')';
-
-    // We include the WHERE condition twice in the query, so we need two
-    // copies of these argument values.
-    $args = array_values($this->value);
-    $args = array_merge($args, $args);
-
-    $this->query->add_where($this->options['group'], "$this->table_alias.uid " . $condition . " OR
-      ((SELECT COUNT(*) FROM {comments} c WHERE c.uid " . $condition . " AND c.nid = $this->table_alias.nid) > 0)",
-      $args);
+
+    $subselect = db_select('comments', 'c');
+    $subselect->addField('c', 'cid');
+    $subselect->condition('uid', $this->value, $this->operator);
+    $subselect->condition('nid', "$this->table_alias.nid");
+    $subselect = $subselect->countQuery();
+
+    $condition = db_or()
+      ->condition("$this->table_alias.uid", $this->value, $this->operator);
+      ->condition(0, $subselect, '<');
+
+    $this->query->add_where(0, $condition);
   }
 }

=== modified file 'modules/comment/views_plugin_row_comment_rss.inc'
--- modules/comment/views_plugin_row_comment_rss.inc	2009-10-17 18:33:18 +0000
+++ modules/comment/views_plugin_row_comment_rss.inc	2009-10-18 20:04:37 +0000
@@ -14,12 +14,12 @@
     global $base_url;
 
     // Load the specified comment:
-    $comment = _comment_load($row->cid);
+    $comment = comment_load($row->cid);
 
     $item = new stdClass();
     $item->title = $comment->subject;
     $item->link = url('node/' . $comment->nid, array('absolute' => TRUE, 'fragment' => 'comment-' . $comment->cid));
-    $item->description = check_markup($comment->comment, $comment->format, FALSE);
+    $item->description = check_markup($comment->comment, $comment->format);
     $item->elements = array(
       array('key' => 'pubDate', 'value' => gmdate('r', $comment->timestamp)),
       array('key' => 'dc:creator', 'value' => $comment->name),
@@ -37,6 +37,10 @@
       }
     }
 
-    return theme($this->theme_functions(), $this->view, $this->options, $item);
+    return theme($this->theme_functions(), array(
+      'view' => $this->view,
+      'options' => $this->options,
+      'row' => $item
+    ));
   }
 }

=== modified file 'modules/contact.views.inc'
--- modules/contact.views.inc	2009-10-17 18:33:18 +0000
+++ modules/contact.views.inc	2009-10-18 07:37:31 +0000
@@ -16,7 +16,7 @@
   return $data;
 }
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function contact_views_handlers() {

=== modified file 'modules/contact/views_handler_field_contact_link.inc'
--- modules/contact/views_handler_field_contact_link.inc	2009-10-17 18:33:18 +0000
+++ modules/contact/views_handler_field_contact_link.inc	2009-10-18 20:07:33 +0000
@@ -48,7 +48,9 @@
     }
 
     if ($this->options['link_display'] == 'icon') {
-      return l(theme('image', 'misc/forum-new.png'), 'user/'. $account->uid .'/contact', array('html' => TRUE, 'attributes' => array('title' => t('Contact %user', array('%user' => $account->name)))));
+      return l(theme('image', array(
+        'path' => 'misc/forum-new.png'
+      )), 'user/'. $account->uid .'/contact', array('html' => TRUE, 'attributes' => array('title' => t('Contact %user', array('%user' => $account->name)))));
     }
     else {
       return l($this->options['text'], 'user/'. $account->uid .'/contact', array('attributes' => array('title' => t('Contact %user', array('%user' => $account->name)))));

=== modified file 'modules/filter.views.inc'
--- modules/filter.views.inc	2009-10-17 18:33:18 +0000
+++ modules/filter.views.inc	2009-10-18 07:37:31 +0000
@@ -8,17 +8,17 @@
 /**
  * @defgroup views_filter_module filter.module handlers
  *
- * Only includes the table 'filter_formats'. 
+ * Only includes the table 'filter_formats'.
  * @{
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function filter_views_data() {
   // ----------------------------------------------------------------------
   // filter_formats table
-  
+
   // Have not defined $data['filter_formats']['table']['group'] since
   // no fields are defined here yet.
   $data['filter_formats']['table']['join'] = array(

=== modified file 'modules/locale.views.inc'
--- modules/locale.views.inc	2009-10-17 18:33:18 +0000
+++ modules/locale.views.inc	2009-10-18 07:37:31 +0000
@@ -14,7 +14,7 @@
  */
 
 /**
- * Implementation of hook_views_data().
+ * Implements hook_views_data().
  */
 function locale_views_data() {
   // Basic table information.
@@ -203,42 +203,23 @@
 }
 
 /**
- * Implementation of hook_views_handlers().
+ * Implements hook_views_handlers().
  */
 function locale_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/locale',
-    ),
-    'handlers' => array(
-      // Field handlers.
-      'views_handler_field_locale_group' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_locale_language' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_locale_link_edit' => array(
-        'parent' => 'views_handler_field',
-      ),
-      // Argument handlers.
-      'views_handler_argument_locale_group' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_locale_language' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      // Filters.
-      'views_handler_filter_locale_group' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-      'views_handler_filter_locale_language' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-      'views_handler_filter_locale_version' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-    ),
+    // Field handlers.
+    'views_handler_field_locale_group',
+    'views_handler_field_locale_language',
+    'views_handler_field_locale_link_edit',
+
+    // Argument handlers.
+    'views_handler_argument_locale_group',
+    'views_handler_argument_locale_language',
+
+    // Filters.
+    'views_handler_filter_locale_group',
+    'views_handler_filter_locale_language',
+    'views_handler_filter_locale_version',
   );
 }
 

=== modified file 'modules/locale/views_handler_filter_locale_version.inc'
--- modules/locale/views_handler_filter_locale_version.inc	2009-10-17 18:33:18 +0000
+++ modules/locale/views_handler_filter_locale_version.inc	2009-10-18 21:37:38 +0000
@@ -10,10 +10,10 @@
       $this->value_title = t('Version');
       // Enable filtering by the current installed Drupal version.
       $versions = array('***CURRENT_VERSION***' => t('Current installed version'));
-      $result = db_query('SELECT DISTINCT(version) FROM {locales_source} ORDER BY  version');
-      while ($row = db_fetch_array($result)) {
-        if (!empty($row['version'])) {
-          $versions[$row['version']] = $row['version'];
+      $result = db_query('SELECT DISTINCT(version) FROM {locales_source} ORDER BY version');
+      foreach ($result > $row) {
+        if (!empty($row->version)) {
+          $versions[$row->version] = $row->version;
         }
       }
       $this->value_options = $versions;

=== modified file 'modules/node.views.inc'
--- modules/node.views.inc	2009-10-17 18:33:18 +0000
+++ modules/node.views.inc	2009-10-19 05:17:54 +0000
@@ -8,12 +8,12 @@
 /**
  * @defgroup views_node_module node.module handlers
  *
- * Includes the tables 'node', 'node_revisions' and 'history'.
+ * Includes the tables 'node', 'node_revision' and 'history'.
  * @{
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function node_views_data() {
   // ----------------------------------------------------------------
@@ -34,10 +34,10 @@
   // For other base tables, explain how we join
   $data['node']['table']['join'] = array(
     // this explains how the 'node' table (named in the line above)
-    // links toward the node_revisions table.
-    'node_revisions' => array(
+    // links toward the node_revision table.
+    'node_revision' => array(
       'handler' => 'views_join', // this is actually optional
-      'left_table' => 'node_revisions', // Because this is a direct link it could be left out.
+      'left_table' => 'node_revision', // Because this is a direct link it could be left out.
       'left_field' => 'nid',
       'field' => 'nid',
       // also supported:
@@ -64,7 +64,6 @@
     // Information for accepting a nid as an argument
     'argument' => array(
       'handler' => 'views_handler_argument_node_nid',
-      'parent' => 'views_handler_argument_numeric', // make sure parent is included
       'name field' => 'title', // the field to display in the summary.
       'numeric' => TRUE,
       'validate type' => 'nid',
@@ -386,23 +385,23 @@
       'label' => t('user'),
     ),
   );
-  
+
   // ----------------------------------------------------------------------
-  // Node revisions table
+  // Node revision table
 
   // Define the base group of this table. Fields that don't
   // have a group defined will go into this field by default.
-  $data['node_revisions']['table']['group']  = t('Node revision');
+  $data['node_revision']['table']['group']  = t('Node revision');
 
   // Advertise this table as a possible base table
-  $data['node_revisions']['table']['base'] = array(
+  $data['node_revision']['table']['base'] = array(
     'field' => 'vid',
     'title' => t('Node revision'),
-    'help' => t('Node revisions are a history of changes to nodes.'),
+    'help' => t('Node revision are a history of changes to nodes.'),
   );
 
   // For other base tables, explain how we join
-  $data['node_revisions']['table']['join'] = array(
+  $data['node_revision']['table']['join'] = array(
     // Directly links to node table.
     'node' => array(
       'left_field' => 'vid',
@@ -410,8 +409,8 @@
     ),
   );
 
-  // uid field for node revisions
-  $data['node_revisions']['uid'] = array(
+  // uid field for node revision
+  $data['node_revision']['uid'] = array(
     'title' => t('User'),
     'help' => t('Relate a node revision to the user who created the revision.'),
     'relationship' => array(
@@ -422,49 +421,17 @@
     ),
   );
 
-  // Body field
-  $data['node_revisions']['body'] = array(
-    'group' => t('Node'),
-    'title' => t('Body'), // The item it appears as on the UI,
-    'help' => t('The actual, full data in the body field; this may not be valid data on all node types.'), // The help that appears on the UI,
-     // Information for displaying a title as a field
-    'field' => array(
-      'handler' => 'views_handler_field_markup',
-      'format' => 'format', // The name of the format field
-    ),
-    'filter' => array(
-      'handler' => 'views_handler_filter_string',
-    ),
-  );
-
-  // Teaser field
-  $data['node_revisions']['teaser'] = array(
-    'group' => t('Node'),
-    'title' => t('Teaser'), // The item it appears as on the UI,
-    'help' => t('The stored teaser field. This may not be valid or useful data on all node types.'), // The help that appears on the UI,
-     // Information for displaying a title as a field
-    'field' => array(
-      'handler' => 'views_handler_field_markup',
-      'format' => 'format', // The name of the format field
-     ),
-    'filter' => array(
-      'handler' => 'views_handler_filter_string',
-    ),
-  );
-
   // nid
-  $data['node_revisions']['vid'] = array(
+  $data['node_revision']['vid'] = array(
     'title' => t('Vid'),
     'help' => t('The revision ID of the node revision.'), // The help that appears on the UI,
     // Information for displaying the nid
     'field' => array(
-//      'handler' => 'views_handler_field',
       'click sortable' => TRUE,
     ),
     // Information for accepting a nid as an argument
     'argument' => array(
       'handler' => 'views_handler_argument_node_vid',
-      'parent' => 'views_handler_argument_numeric', // make sure parent is included
       'click sortable' => TRUE,
       'numeric' => TRUE,
     ),
@@ -479,7 +446,7 @@
   );
 
   // title
-  $data['node_revisions']['title'] = array(
+  $data['node_revision']['title'] = array(
     'title' => t('Title'), // The item it appears as on the UI,
     'help' => t('The title of the node.'), // The help that appears on the UI,
      // Information for displaying a title as a field
@@ -500,7 +467,7 @@
   );
 
   // log field
-  $data['node_revisions']['log'] = array(
+  $data['node_revision']['log'] = array(
     'title' => t('Log message'), // The item it appears as on the UI,
     'help' => t('The log message entered when the revision was created.'), // The help that appears on the UI,
      // Information for displaying a title as a field
@@ -514,7 +481,7 @@
 
   // revision timestamp
   // changed field
-  $data['node_revisions']['timestamp'] = array(
+  $data['node_revision']['timestamp'] = array(
     'title' => t('Created date'), // The item it appears as on the UI,
     'help' => t('The date the node revision was created.'), // The help that appears on the UI,
     'field' => array(
@@ -529,40 +496,7 @@
     ),
   );
 
-  // input format id
-  $data['node_revisions']['format'] = array(
-    'title' => t('Input format id'), // The item it appears as on the UI,
-    'help' => t('The numeric input format of the node revision. !default means the default input format.', array('!default' => FILTER_FORMAT_DEFAULT)), // The help that appears on the UI,
-     // Information for displaying an input format as a field
-    'field' => array(
-      'handler' => 'views_handler_field_numeric',
-      'click sortable' => TRUE,
-    ),
-    // Information for sorting on input format
-    'sort' => array(
-      'handler' => 'views_handler_sort',
-    ),
-    // Information for accepting input format as a filter
-    'filter' => array(
-      'handler' => 'views_handler_filter_numeric',
-    ),
-  );
-
-  // input format name
-  // A (numeric) format of 0 means the default; Drupal also applies the default
-  // if the format specifed for a node revision has been deleted.
-  // This complexity makes sorting and filtering by format name tricky,
-  // hence these are not yet supported.
-  $data['node_revisions']['format_name'] = array(
-    'title' => t('Input format'), // The item it appears as on the UI,
-    'help' => t('The name of the input format of the node revision.'), // The help that appears on the UI,
-     // Information for displaying an input format as a field
-    'field' => array(
-      'handler' => 'views_handler_field_filter_format_name',
-    ),
-  );
-
-  $data['node_revisions']['revert_revision'] = array(
+  $data['node_revision']['revert_revision'] = array(
     'field' => array(
       'title' => t('Revert link'),
       'help' => t('Provide a simple link to revert to the revision.'),
@@ -570,7 +504,7 @@
     ),
   );
 
-  $data['node_revisions']['delete_revision'] = array(
+  $data['node_revision']['delete_revision'] = array(
     'field' => array(
       'title' => t('Delete link'),
       'help' => t('Provide a simple link to delete the node revision.'),
@@ -619,7 +553,7 @@
       'left_field' => 'nid',
       'field' => 'nid',
       'extra' => array(
-        array('field' => 'uid', 'value' => '***CURRENT_USER***', 'numeric' => TRUE),
+        array('field' => 'uid', 'value' => ':user-current-user', 'numeric' => TRUE),
       ),
     ),
   );
@@ -639,104 +573,43 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function node_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/node',
-    ),
-    'handlers' => array(
-      // field handlers
-      'views_handler_field_node' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_node_type' => array(
-        'parent' => 'views_handler_field_node',
-      ),
-      'views_handler_field_node_link' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_node_type' => array(
-        'parent' => 'views_handler_field_node',
-      ),
-      'views_handler_field_node_link_edit' => array(
-        'parent' => 'views_handler_field_node_link',
-      ),
-      'views_handler_field_node_link_delete' => array(
-        'parent' => 'views_handler_field_node_link',
-      ),
-      'views_handler_field_node_revision_link_revert' => array(
-        'parent' => 'views_handler_field_node_link',
-      ),
-      'views_handler_field_node_revision_link_delete' => array(
-        'parent' => 'views_handler_field_node_link',
-      ),
-      'views_handler_field_history_user_timestamp' => array(
-        'parent' => 'views_handler_field_node',
-      ),
-
-      // argument handlers
-      'views_handler_argument_node_type' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_node_nid' => array(
-        'parent' => 'views_handler_argument_numeric',
-      ),
-      'views_handler_argument_node_vid' => array(
-        'parent' => 'views_handler_argument_numeric',
-      ),
-      'views_handler_argument_node_created_fulldate' => array(
-        // put several handlers in the same file
-        'file' => 'views_handler_argument_dates_various.inc',
-        'parent' => 'views_handler_argument_date',
-      ),
-      'views_handler_argument_node_created_year' => array(
-        // put several handlers in the same file
-        'file' => 'views_handler_argument_dates_various.inc',
-        'parent' => 'views_handler_argument_date',
-      ),
-      'views_handler_argument_node_created_year_month' => array(
-        // put several handlers in the same file
-        'file' => 'views_handler_argument_dates_various.inc',
-        'parent' => 'views_handler_argument_date',
-      ),
-      'views_handler_argument_node_created_month' => array(
-        // put several handlers in the same file
-        'file' => 'views_handler_argument_dates_various.inc',
-        'parent' => 'views_handler_argument_date',
-      ),
-      'views_handler_argument_node_created_day' => array(
-        // put several handlers in the same file
-        'file' => 'views_handler_argument_dates_various.inc',
-        'parent' => 'views_handler_argument_date',
-      ),
-      'views_handler_argument_node_created_week' => array(
-        // put several handlers in the same file
-        'file' => 'views_handler_argument_dates_various.inc',
-        'parent' => 'views_handler_argument_date',
-      ),
-
-      // filters
-      'views_handler_filter_node_type' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-      'views_handler_filter_history_user_timestamp' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      'views_handler_filter_node_status' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      'views_handler_filter_node_access' => array(
-        'parent' => 'views_handler_filter',
-      ),
-    ),
+    // field handlers
+    'views_handler_field_node',
+    'views_handler_field_node_type',
+    'views_handler_field_node_link',
+    'views_handler_field_node_type',
+    'views_handler_field_node_link_edit',
+    'views_handler_field_node_link_delete',
+    'views_handler_field_node_revision_link_revert',
+    'views_handler_field_node_revision_link_delete',
+    'views_handler_field_history_user_timestamp',
+
+    // argument handlers
+    'views_handler_argument_node_type',
+    'views_handler_argument_node_nid',
+    'views_handler_argument_node_vid',
+    'views_handler_argument_node_created_fulldate',
+    'views_handler_argument_node_created_year',
+    'views_handler_argument_node_created_year_month',
+    'views_handler_argument_node_created_month',
+    'views_handler_argument_node_created_day',
+    'views_handler_argument_node_created_week',
+
+    // filters
+    'views_handler_filter_node_type',
+    'views_handler_filter_history_user_timestamp',
+    'views_handler_filter_node_status',
+    'views_handler_filter_node_access',
   );
 }
 
 /**
- * Implementation of hook_views_plugins
+ * Implements hook_views_plugins
  */
 function node_views_plugins() {
   return array(
@@ -769,15 +642,12 @@
       'node' => array(
         'title' => t('Node'),
         'handler' => 'views_plugin_argument_validate_node',
-        'path' => drupal_get_path('module', 'views') . '/modules/node', // not necessary for most modules
       ),
     ),
     'argument default' => array(
       'node' => array(
         'title' => t('Node ID from URL'),
-        'handler' => 'views_plugin_argument_default_node',
-        'path' => drupal_get_path('module', 'views') . '/modules/node', // not necessary for most modules
-        'parent' => 'fixed', // so that the parent class is included
+        'handler' => 'views_plugin_argument_default_node'
       ),
     ),
   );
@@ -805,8 +675,13 @@
   }
 
   $node->view = $vars['view'];
-  $node->build_mode = ($options['build_mode'] == 'teaser' || $options['build_mode'] == 'full') ? NODE_BUILD_NORMAL : $options['build_mode'];
-  $vars['node'] = node_view($node, $options['build_mode'] == 'teaser', FALSE, $options['links']);
+  //$node->build_mode = ($options['build_mode'] == 'teaser' || $options['build_mode'] == 'full') ? NODE_BUILD_NORMAL : $options['build_mode'];
+  //$vars['node'] = node_view($node, $options['build_mode'] == 'teaser', FALSE, $options['links']);
+  $content = node_build($node, $options['build_mode']);
+  if (!$options['links']) {
+    unset($content['links']);
+  }
+  $vars['node'] = drupal_render($content);
 
   if (!empty($options['comments']) && function_exists('comment_render')) {
     $vars['comments'] = comment_render($node);
@@ -814,16 +689,16 @@
 }
 
 /**
- * Implementation of hook_views_query_substitutions().
+ * Implements hook_views_query_substitutions().
  */
 function node_views_query_substitutions() {
   return array(
-    '***ADMINISTER_NODES***' => intval(user_access('administer nodes')),
+    ':node-administer-nodes' => intval(user_access('administer nodes')),
   );
 }
 
 /**
- * Implementation of hook_views_analyze().
+ * Implements hook_views_analyze().
  */
 function node_views_analyze($view) {
   $ret = array();

=== modified file 'modules/node.views_convert.inc'
--- modules/node.views_convert.inc	2009-10-17 18:33:18 +0000
+++ modules/node.views_convert.inc	2009-10-18 07:37:31 +0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_views_convert().
+ * Implements hook_views_convert().
  *
  * Intervene to convert field values from the Views 1 format to the
  * Views 2 format. Intervene only if $view->add_item() won't produce

=== modified file 'modules/node.views_default.inc'
--- modules/node.views_default.inc	2009-10-17 18:33:18 +0000
+++ modules/node.views_default.inc	2009-10-18 07:37:31 +0000
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_default_view_views().
+ * Implements hook_default_view_views().
  */
 function node_views_default_views() {
   $view = new view;

=== modified file 'modules/node/views_handler_argument_node_nid.inc'
--- modules/node/views_handler_argument_node_nid.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_handler_argument_node_nid.inc	2009-10-18 21:39:02 +0000
@@ -14,10 +14,9 @@
    */
   function title_query() {
     $titles = array();
-    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
 
-    $result = db_query("SELECT n.title FROM {node} n WHERE n.nid IN ($placeholders)", $this->value);
-    while ($term = db_fetch_object($result)) {
+    $result = db_query("SELECT n.title FROM {node} n WHERE n.nid IN (:nids)", array(':nids' => $this->value));
+    foreach ($result as $term) {
       $titles[] = check_plain($term->title);
     }
     return $titles;

=== modified file 'modules/node/views_handler_argument_node_type.inc'
--- modules/node/views_handler_argument_node_type.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_handler_argument_node_type.inc	2009-10-18 07:37:32 +0000
@@ -25,7 +25,7 @@
   }
 
   function node_type($type) {
-    $output = node_get_types('name', $type);
+    $output = node_type_get_name($type);
     if (empty($output)) {
       $output = t('Unknown node type');
     }

=== modified file 'modules/node/views_handler_argument_node_vid.inc'
--- modules/node/views_handler_argument_node_vid.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_handler_argument_node_vid.inc	2009-10-18 21:39:42 +0000
@@ -16,10 +16,9 @@
    */
   function title_query() {
     $titles = array();
-    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
 
-    $result = db_query("SELECT n.title FROM {node_revisions} n WHERE n.nid IN ($placeholders)", $this->value);
-    while ($term = db_fetch_object($result)) {
+    $result = db_query("SELECT n.title FROM {node_revision} n WHERE n.nid IN (:nids)", array(':nids' => $this->value));
+    foreach ($result as $term) {
       $titles[] = check_plain($term->title);
     }
     return $titles;

=== modified file 'modules/node/views_handler_field_history_user_timestamp.inc'
--- modules/node/views_handler_field_history_user_timestamp.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_handler_field_history_user_timestamp.inc	2009-10-18 19:52:27 +0000
@@ -66,7 +66,7 @@
       elseif ($last_comment > $last_read && $last_comment > NODE_NEW_LIMIT) {
         $mark = MARK_UPDATED;
       }
-      return $this->render_link(theme('mark', $mark), $values);
+      return $this->render_link(theme('mark', array('type' => $mark)), $values);
     }
   }
 }

=== modified file 'modules/node/views_handler_field_node_type.inc'
--- modules/node/views_handler_field_node_type.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_handler_field_node_type.inc	2009-10-18 19:13:47 +0000
@@ -6,7 +6,7 @@
  */
 class views_handler_field_node_type extends views_handler_field_node {
   function render($values) {
-    $value = node_get_types('name', $values->{$this->field_alias});
+    $value = node_type_get_name($values->{$this->field_alias});
     return $this->render_link(t(check_plain($value)), $values);
   }
 }

=== modified file 'modules/node/views_handler_filter_history_user_timestamp.inc'
--- modules/node/views_handler_filter_history_user_timestamp.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_handler_filter_history_user_timestamp.inc	2009-10-17 19:26:01 +0000
@@ -45,7 +45,7 @@
     // Hey, Drupal kills old history, so nodes that haven't been updated
     // since NODE_NEW_LIMIT are bzzzzzzzt outta here!
 
-    $limit = time() - NODE_NEW_LIMIT;
+    $limit = REQUEST_TIME - NODE_NEW_LIMIT;
 
     $this->ensure_my_table();
     $field = "$this->table_alias.$this->real_field";

=== modified file 'modules/node/views_handler_filter_node_access.inc'
--- modules/node/views_handler_filter_node_access.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_handler_filter_node_access.inc	2009-10-17 22:49:05 +0000
@@ -16,18 +16,18 @@
   function query() {
     if (!user_access('administer nodes')) {
       $table = $this->ensure_my_table();
-      $grants = array();
+      $grants = db_or();
       foreach (node_access_grants('view') as $realm => $gids) {
         foreach ($gids as $gid) {
-          $grants[] = "($table.gid = $gid AND $table.realm = '$realm')";
+          $grants->condition(db_and()
+            ->condition($table . '.gid', $gid)
+            ->condition($table . '.realm', $realm)
+          );
         }
       }
-      $grants_sql = '';
-      if (count($grants)) {
-        $grants_sql = implode(' OR ', $grants);
-      }
-      $this->query->add_where('AND', $grants_sql);
-      $this->query->add_where('AND', "$table.grant_view >= 1");
+
+      $this->query->add_where('AND', $grants);
+      $this->query->add_where('AND', $table . '.grant_view', 1, '>=');
     }
   }
 }

=== modified file 'modules/node/views_handler_filter_node_type.inc'
--- modules/node/views_handler_filter_node_type.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_handler_filter_node_type.inc	2009-10-18 07:37:32 +0000
@@ -7,7 +7,7 @@
   function get_value_options() {
     if (!isset($this->value_options)) {
       $this->value_title = t('Node type');
-      $types = node_get_types();
+      $types = node_type_get_types();
       foreach ($types as $type => $info) {
         $options[$type] = t($info->name);
       }

=== modified file 'modules/node/views_plugin_argument_validate_node.inc'
--- modules/node/views_plugin_argument_validate_node.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_plugin_argument_validate_node.inc	2009-10-18 21:40:49 +0000
@@ -12,7 +12,7 @@
   var $option_name = 'validate_argument_node_type';
 
   function validate_form(&$form, &$form_state) {
-    $types = node_get_types();
+    $types = node_type_get_types();
     foreach ($types as $type => $info) {
       $options[$type] = check_plain(t($info->name));
     }
@@ -30,7 +30,7 @@
       '#options' => $options,
       '#default_value' => $arg,
       '#description' => t('If you wish to validate for specific node types, check them; if none are checked, all nodes will pass.'),
-      '#process' => array('expand_checkboxes', 'views_process_dependency'),
+      '#process' => array('form_process_checkboxes', 'views_process_dependency'),
       '#dependency' => array('edit-options-validate-type' => array($this->id)),
     );
 
@@ -93,13 +93,11 @@
           return FALSE;
         }
 
-        $placeholders = implode(', ', array_fill(0, sizeof($nids->value), '%d'));
-
         $test = drupal_map_assoc($nids->value);
         $titles = array();
 
-        $result = db_query("SELECT * FROM {node} WHERE nid IN ($placeholders)", $nids->value);
-        while ($node = db_fetch_object($result)) {
+        $result = db_query("SELECT * FROM {node} WHERE nid IN (:nids)", array(':nids' =>  $nids->value));
+        foreach ($result as $node) {
           if ($types && empty($types[$node->type])) {
             return FALSE;
           }

=== modified file 'modules/node/views_plugin_row_node_rss.inc'
--- modules/node/views_plugin_row_node_rss.inc	2009-10-17 18:33:18 +0000
+++ modules/node/views_plugin_row_node_rss.inc	2009-10-18 14:23:21 +0000
@@ -58,83 +58,44 @@
       return;
     }
 
-    $node->build_mode = NODE_BUILD_RSS;
-
-    if ($item_length != 'title') {
-      $teaser = ($item_length == 'teaser') ? TRUE : FALSE;
-
-      // Filter and prepare node teaser
-      if (node_hook($node, 'view')) {
-        $node = node_invoke($node, 'view', $teaser, FALSE);
-      }
-      else {
-        $node = node_prepare($node, $teaser);
-      }
-
-      // Allow modules to change $node->teaser before viewing.
-      node_invoke_nodeapi($node, 'view', $teaser, FALSE);
-    }
-
-    // Set the proper node part, then unset unused $node part so that a bad
-    // theme can not open a security hole.
-    $content = drupal_render($node->content);
-    if ($teaser) {
-      $node->teaser = $content;
-      unset($node->body);
-    }
-    else {
-      $node->body = $content;
-      unset($node->teaser);
-    }
-
-    // Allow modules to modify the fully-built node.
-    node_invoke_nodeapi($node, 'alter', $teaser, FALSE);
-
-    $item = new stdClass();
-    $item->title = $node->title;
-    $item->link = url("node/$row->nid", array('absolute' => TRUE));
-
-    // Allow modules to add additional item fields and/or modify $item
-    $extra = node_invoke_nodeapi($node, 'rss item');
-    $item->elements = array_merge($extra,
-      array(
-        array('key' => 'pubDate', 'value' => gmdate('r', $node->created)),
-        array(
-          'key' => 'dc:creator',
-          'value' => $node->name,
-          'namespace' => array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/'),
-        ),
-        array(
-          'key' => 'guid',
-          'value' => $node->nid . ' at ' . $base_url,
-          'attributes' => array('isPermaLink' => 'false')
-        ),
-      )
+    $item_text = '';
+
+    $node->link = url("node/$node->nid", array('absolute' => TRUE));
+    $node->rss_namespaces = array();
+    $node->rss_elements = array(
+      array('key' => 'pubDate', 'value' => gmdate('r', $node->created)),
+      array('key' => 'dc:creator', 'value' => $node->name),
+      array('key' => 'guid', 'value' => $node->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))
     );
 
-    foreach ($item->elements as $element) {
+    // The node gets built and modules add to or modify $node->rss_elements
+    // and $node->rss_namespaces.
+    node_build_content($node, 'rss');
+
+    foreach ($node->rss_namespaces as $element) {
       if (isset($element['namespace'])) {
         $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $element['namespace']);
       }
     }
 
-    // Prepare the item description
-    switch ($item_length) {
-      case 'fulltext':
-        $item->description = $node->body;
-        break;
-      case 'teaser':
-        $item->description = $node->teaser;
-        if (!empty($item->readmore)) {
-          $item->description .= '<p>' . l(t('read more'), 'node/' . $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . '</p>';
-        }
-        break;
-      case 'title':
-        $item->description = '';
-        break;
+    if ($item_length != 'title' && !empty($node->content)) {
+      // We render node contents and force links to be last.
+      $links = drupal_render($node->content['links']);
+      $item_text .= drupal_render($node->content) . $links;
     }
 
-    return theme($this->theme_functions(), $this->view, $this->options, $item);
+    $item->description = $item_text;
+    $item->title = $node->title[FIELD_LANGUAGE_NONE][0]['value'];
+    $item->link = $node->link;
+    $item->elements = $node->rss_elements;
+
+
+    return theme($this->theme_functions(),
+      array(
+        'view' => $this->view,
+        'options' => $this->options,
+        'row' => $item
+      ));
   }
 }
 

=== modified file 'modules/poll.views.inc'
--- modules/poll.views.inc	2009-10-17 18:33:18 +0000
+++ modules/poll.views.inc	2009-10-18 07:37:31 +0000
@@ -13,7 +13,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function poll_views_data() {
   // Basic table information.

=== modified file 'modules/profile.views.inc'
--- modules/profile.views.inc	2009-10-17 18:33:18 +0000
+++ modules/profile.views.inc	2009-10-18 21:53:12 +0000
@@ -12,7 +12,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function profile_views_data() {
   // Define the base group of this table. Fields that don't
@@ -72,7 +72,7 @@
     $fields = array();
     $results = db_query("SELECT * FROM {profile_fields} ORDER BY category, weight");
 
-    while ($row = db_fetch_object($results)) {
+    foreach ($results as $row) {
       if (!empty($row->options)) {
         if (!in_array(substr($row->options, 0, 2), array('a:', 'b:', 'i:', 'f:', 'o:', 's:', ))) {
           // unserialized fields default version
@@ -126,7 +126,7 @@
         'help' => t('Profile textarea'),
         'field' => array(
           'handler' => 'views_handler_field_markup',
-          'format' => FILTER_FORMAT_DEFAULT,
+          'format' => filter_default_format(),
         ),
         'sort' => array(
           'handler' => 'views_handler_sort',
@@ -218,25 +218,14 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function profile_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/profile',
-    ),
-    'handlers' => array(
-      'views_handler_field_profile_date' => array(
-        'parent' => 'views_handler_field_date',
-      ),
-      'views_handler_field_profile_list' => array(
-        'parent' => 'views_handler_field_prerender_list',
-      ),
-      'views_handler_filter_profile_selection' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-    ),
+    'views_handler_field_profile_date',
+    'views_handler_field_profile_list',
+    'views_handler_filter_profile_selection',
   );
 }
 

=== modified file 'modules/profile.views_convert.inc'
--- modules/profile.views_convert.inc	2009-10-17 18:33:18 +0000
+++ modules/profile.views_convert.inc	2009-10-18 07:37:31 +0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_views_convert().
+ * Implements hook_views_convert().
  *
  * Intervene to convert field values from the Views 1 format to the
  * Views 2 format. Intervene only if $view->add_item() won't produce

=== modified file 'modules/search.views.inc'
--- modules/search.views.inc	2009-10-17 18:33:18 +0000
+++ modules/search.views.inc	2009-10-18 22:12:14 +0000
@@ -13,7 +13,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function search_views_data() {
   // Basic table information.
@@ -128,30 +128,19 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function search_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/search',
-    ),
-    'handlers' => array(
-      'views_handler_field_search_score' => array(
-        'parent' => 'views_handler_field_numeric',
-      ),
-      'views_handler_sort_search_score' => array(
-        'parent' => 'views_handler_sort',
-      ),
-      'views_handler_filter_search' => array(
-        'parent' => 'views_handler_filter',
-      ),
-    ),
+    'views_handler_field_search_score',
+    'views_handler_sort_search_score',
+    'views_handler_filter_search',
   );
 }
 
 /**
- * Implementation of hook_views_plugins
+ * Implements hook_views_plugins
  */
 function search_views_plugins() {
   return;
@@ -163,8 +152,8 @@
         'title' => t('Search'),
         'help' => t('Display the results with standard search view.'),
         'handler' => 'views_plugin_row_search_view',
+        'theme' => 'views_view_row_search',
         'path' => drupal_get_path('module', 'views') . '/modules/search', // not necessary for most modules
-        'theme' => 'views_view_row_search',
         'base' => array('node'), // only works with 'node' as base.
         'type' => 'normal',
       ),
@@ -202,10 +191,10 @@
   $vars['title'] = check_plain($node->title);
 
   $info = array();
-  $info['type'] = node_get_types('name', $node);
-  $info['user'] = theme('username', $node);
+  $info['type'] = node_type_get_name($node);
+  $info['user'] = theme('username', array('acccount' => $node));
   $info['date'] = format_date($node->changed, 'small');
-  $extra = node_invoke_nodeapi($node, 'search result');
+  $extra = module_invoke_all('node_search_result', $node);
   if (isset($extra) && is_array($extra)) {
     $info = array_merge($info, $extra);
   }

=== modified file 'modules/search.views_default.inc'
--- modules/search.views_default.inc	2009-10-17 18:33:18 +0000
+++ modules/search.views_default.inc	2009-10-18 07:37:31 +0000
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_default_view_views().
+ * Implements hook_default_view_views().
  */
 function search_views_default_views() {
   $view = new view;

=== modified file 'modules/search/views_handler_filter_search.inc'
--- modules/search/views_handler_filter_search.inc	2009-10-17 18:33:18 +0000
+++ modules/search/views_handler_filter_search.inc	2009-10-17 22:49:05 +0000
@@ -107,7 +107,7 @@
       }
 
       $this->query->add_groupby("$search_index.sid");
-      $this->query->add_having($this->options['group'], 'COUNT(*) >= %d', $this->search_query[4]);
+      $this->query->add_having($this->options['group'], 'COUNT(*)', $this->search_query[4], '>=');
     }
   }
 }

=== modified file 'modules/search/views_plugin_row_search_view.inc'
--- modules/search/views_plugin_row_search_view.inc	2009-10-17 18:33:18 +0000
+++ modules/search/views_plugin_row_search_view.inc	2009-10-18 20:00:57 +0000
@@ -29,6 +29,11 @@
    * Override the behavior of the render() function.
    */
   function render($row) {
-    return theme($this->theme_functions(), $this->view, $this->options, $row);
+    return theme($this->theme_functions(),
+      array(
+        'view' => $this->view,
+        'options' => $this->options,
+        'row' => $row
+      ));
   }
 }

=== modified file 'modules/statistics.views.inc'
--- modules/statistics.views.inc	2009-10-17 18:33:18 +0000
+++ modules/statistics.views.inc	2009-10-18 07:37:31 +0000
@@ -13,7 +13,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function statistics_views_data() {
   // Basic table information.
@@ -247,20 +247,11 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function statistics_views_handlers() {
-  return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/statistics',
-    ),
-    'handlers' => array(
-      'views_handler_field_accesslog_path' => array(
-        'parent' => 'views_handler_field',
-      ),
-    ),
-  );
+  return array('views_handler_field_accesslog_path');
 }
 
 /**

=== modified file 'modules/statistics.views_convert.inc'
--- modules/statistics.views_convert.inc	2009-10-17 18:33:18 +0000
+++ modules/statistics.views_convert.inc	2009-10-18 07:37:31 +0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_views_convert().
+ * Implements hook_views_convert().
  *
  * Intervene to convert field values from the Views 1 format to the
  * Views 2 format. Intervene only if $view->add_item() won't produce

=== modified file 'modules/statistics.views_default.inc'
--- modules/statistics.views_default.inc	2009-10-17 18:33:18 +0000
+++ modules/statistics.views_default.inc	2009-10-18 07:37:31 +0000
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_default_view_views().
+ * Implements hook_default_view_views().
  */
 function statistics_views_default_views() {
   $view = new view;

=== modified file 'modules/system.views.inc'
--- modules/system.views.inc	2009-10-17 18:33:18 +0000
+++ modules/system.views.inc	2009-10-18 07:37:32 +0000
@@ -14,7 +14,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function system_views_data() {
   $data = array();
@@ -174,34 +174,21 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function system_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/system',
-    ),
-    'handlers' => array(
-      'views_handler_field_file' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_file_status' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_filter_file_status' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-      'views_handler_argument_file_fid' => array(
-        'parent' => 'views_handler_argument',
-      ),
-    ),
+    'views_handler_field_file',
+    'views_handler_field_file_status',
+    'views_handler_filter_file_status',
+    'views_handler_argument_file_fid',
   );
 }
 
 function _views_file_status($choice = NULL) {
   $status = array(
-    FILE_STATUS_TEMPORARY => t('Temporary'),
+    0 => t('Temporary'),
     FILE_STATUS_PERMANENT => t('Permanent'),
   );
 

=== modified file 'modules/system/views_handler_argument_file_fid.inc'
--- modules/system/views_handler_argument_file_fid.inc	2009-10-17 18:33:18 +0000
+++ modules/system/views_handler_argument_file_fid.inc	2009-10-18 08:51:22 +0000
@@ -8,7 +8,11 @@
    * Override the behavior of title(). Get the title of the file.
    */
   function title() {
-    $title = db_result(db_query(db_rewrite_sql("SELECT f.filename FROM {files} f WHERE f.fid = %d", $this->argument)));
+    $title = db_select('files', 'f')
+      ->addField('f', 'filename')
+      ->condition('fid', $this->argument)
+      ->execute()
+      ->fetchField();
     if (empty($title)) {
       return t('No title');
     }

=== modified file 'modules/taxonomy.views.inc'
--- modules/taxonomy.views.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy.views.inc	2009-10-19 05:11:59 +0000
@@ -13,17 +13,17 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function taxonomy_views_data() {
   $data = array();
 
   // ----------------------------------------------------------------------
-  // vocabulary table
-
-  $data['vocabulary']['table']['group']  = t('Taxonomy');
-
-  $data['vocabulary']['table']['join'] = array(
+  // taxonomy_vocabulary table
+
+  $data['taxonomy_vocabulary']['table']['group']  = t('Taxonomy');
+
+  $data['taxonomy_vocabulary']['table']['join'] = array(
     // vocabulary links to term_data directly via vid.
     'term_data' => array(
       'left_field' => 'vid',
@@ -44,7 +44,7 @@
   );
 
   // vocabulary name
-  $data['vocabulary']['name'] = array(
+  $data['taxonomy_vocabulary']['name'] = array(
     'title' => t('Vocabulary name'), // The item it appears as on the UI,
     'field' => array(
       'help' => t('Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'),
@@ -52,7 +52,15 @@
       'click sortable' => TRUE,
     ),
   );
-  $data['vocabulary']['vid'] = array(
+  $data['taxonomy_vocabulary']['machine_name'] = array(
+    'title' => t('Vocabulary machine name'), // The item it appears as on the UI,
+    'field' => array(
+      'help' => t('Machine-Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'),
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE,
+    ),
+  );
+  $data['taxonomy_vocabulary']['vid'] = array(
     'title' => t('Vocabulary ID'), // The item it appears as on the UI,
     'help' => t('The taxonomy vocabulary ID'),
     'argument' => array(
@@ -154,7 +162,7 @@
       'field' => 'description', // the real field
       'group' => t('Taxonomy'), // The group it appears in on the UI,
       'handler' => 'views_handler_field_markup',
-      'format' => FILTER_FORMAT_DEFAULT,
+      'format' => filter_default_format(),
     ),
   );
 
@@ -265,7 +273,7 @@
     'argument' => array(
       'help' => t('The parent term of the term.'),
       'handler' => 'views_handler_argument_numeric',
-    ),    
+    ),
   );
 
   // ----------------------------------------------------------------------
@@ -304,7 +312,7 @@
 }
 
 /**
- * Implementation of hook_views_data_alter().
+ * Implements hook_views_data_alter().
  */
 function taxonomy_views_data_alter(&$data) {
   $data['node']['term_node_tid'] = array(
@@ -343,54 +351,26 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function taxonomy_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/taxonomy',
-    ),
-    'handlers' => array(
-      'views_handler_argument_term_node_tid_depth' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_term_node_tid_depth_modifier' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_taxonomy' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_vocabulary_vid' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_term_node_tid' => array(
-        'parent' => 'views_handler_argument_many_to_one',
-      ),
-      'views_handler_field_term_node_tid' => array(
-        'parent' => 'views_handler_field_prerender_list',
-      ),
-      'views_handler_field_taxonomy' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_filter_vocabulary_vid' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-      'views_handler_filter_term_node_tid' => array(
-        'parent' => 'views_handler_filter_many_to_one',
-      ),
-      'views_handler_filter_term_node_tid_depth' => array(
-        'parent' => 'views_handler_filter_term_node_tid',
-      ),
-      'views_handler_relationship_node_term_data' => array(
-        'parent' => 'views_handler_relationship',
-      ),
-    ),
+    'views_handler_argument_term_node_tid_depth_modifier',
+    'views_handler_argument_taxonomy',
+    'views_handler_argument_vocabulary_vid',
+    'views_handler_argument_term_node_tid',
+    'views_handler_field_term_node_tid',
+    'views_handler_field_taxonomy',
+    'views_handler_filter_vocabulary_vid',
+    'views_handler_filter_term_node_tid',
+    'views_handler_filter_term_node_tid_depth',
+    'views_handler_relationship',
   );
 }
 
 /**
- * Implementation of hook_views_plugins
+ * Implements hook_views_plugins
  */
 function taxonomy_views_plugins() {
   return array(
@@ -399,7 +379,7 @@
       'taxonomy_term' => array(
         'title' => t('Taxonomy term'),
         'handler' => 'views_plugin_argument_validate_taxonomy_term',
-        'path' => drupal_get_path('module', 'views') . '/modules/taxonomy',
+        'path' => drupal_get_path('module', 'views') . '/modules/taxonomy', // not necessary for most modules
       ),
     ),
   );

=== modified file 'modules/taxonomy.views_convert.inc'
--- modules/taxonomy.views_convert.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy.views_convert.inc	2009-10-18 07:37:32 +0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_views_convert().
+ * Implements hook_views_convert().
  *
  * Intervene to convert field values from the Views 1 format to the
  * Views 2 format. Intervene only if $view->add_item() won't produce

=== modified file 'modules/taxonomy.views_default.inc'
--- modules/taxonomy.views_default.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy.views_default.inc	2009-10-18 07:37:32 +0000
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_default_view_views().
+ * Implements hook_default_view_views().
  */
 function taxonomy_views_default_views() {
   $view = new view;

=== modified file 'modules/taxonomy/views_handler_argument_taxonomy.inc'
--- modules/taxonomy/views_handler_argument_taxonomy.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_handler_argument_taxonomy.inc	2009-10-18 07:37:32 +0000
@@ -10,7 +10,7 @@
    * Override the behavior of title(). Get the title of the node.
    */
   function title() {
-    $term = taxonomy_get_term($this->argument);
+    $term = taxonomy_term_load($this->argument);
     if (!empty($term)) {
       return check_plain($term->name);
     }

=== modified file 'modules/taxonomy/views_handler_argument_term_node_tid.inc'
--- modules/taxonomy/views_handler_argument_term_node_tid.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_handler_argument_term_node_tid.inc	2009-10-18 21:41:48 +0000
@@ -30,10 +30,9 @@
 
   function title_query() {
     $titles = array();
-    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
 
-    $result = db_query("SELECT name FROM {term_data} WHERE tid IN ($placeholders)", $this->value);
-    while ($term = db_fetch_object($result)) {
+    $result = db_query("SELECT name FROM {taxonomy_term_data} WHERE tid IN (:tids)", array(':tids' => $this->value));
+    foreach ($result as $term) {
       $titles[] = check_plain($term->name);
     }
     return $titles;

=== modified file 'modules/taxonomy/views_handler_argument_term_node_tid_depth.inc'
--- modules/taxonomy/views_handler_argument_term_node_tid_depth.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_handler_argument_term_node_tid_depth.inc	2009-10-18 07:37:32 +0000
@@ -77,10 +77,10 @@
       }
 
       if (count($tids->value) > 1) {
-        $placeholder = " IN (" . implode(', ', array_fill(0, sizeof($tids->value), '%d')) . ")";
+        $operator = 'IN';# = " IN (" . implode(', ', array_fill(0, sizeof($tids->value), '%d')) . ")";
       }
       else {
-        $placeholder = " = %d";
+        $operator = '=';#$placeholder = " = %d";
       }
 
       $tids = $tids->value;
@@ -89,35 +89,35 @@
       $placeholder = "= %d";
       $tids = array($this->argument);
     }
-    $subquery = "\n  SELECT tn.vid FROM {term_node} tn\n";
-    $where = "  WHERE tn.tid $placeholder\n";
-    $args = $tids;
+    // Now build the subqueries.
+    $subquery = db_select('term_node', 'tn');
+    $subquery->addField('tn', 'vid');
+    $where = db_or()->condition('tn.tid', $this->value, $operator);
     $last = "tn";
 
     if ($this->options['depth'] > 0) {
-      $subquery .= "    LEFT JOIN {term_hierarchy} th ON th.tid = tn.tid\n";
+      $subquery->leftJoin('term_hierarchy', 'th', "th.tid = tn.tid");
       $last = "th";
       foreach (range(1, abs($this->options['depth'])) as $count) {
-        $subquery .= "    LEFT JOIN {term_hierarchy} th$count ON $last.parent = th$count.tid\n";
-        $where .= "    OR th$count.tid $placeholder\n";
-        $args = array_merge($args, $tids);
+        $subquery->leftJoin('term_hierarchy', "th$count", "$last.parent = th$count.tid");
+        $where->condition("th$count.tid", $tids, $operator);
         $last = "th$count";
       }
     }
-    else if ($this->options['depth'] < 0) {
+    elseif ($this->options['depth'] < 0) {
       foreach (range(1, abs($this->options['depth'])) as $count) {
-        $subquery .= "    LEFT JOIN {term_hierarchy} th$count ON $last.tid = th$count.parent\n";
-        $where .= "    OR th$count.tid $placeholder\n";
-        $args = array_merge($args, $tids);
+        $subquery->leftJoin('term_hierarchy', "th$count", "$last.tid = th$count.parent");
+        $where->condition("th$count.tid", $tids, $operator);
         $last = "th$count";
       }
     }
 
-    $this->query->add_where(0, "$this->table_alias.$this->real_field IN ($subquery$where  )", $args);
+    $subquery->condition($where);
+    $this->query->add_where(0, "$this->table_alias.$this->real_field", $subquery, 'IN');
   }
 
   function title() {
-    $term = taxonomy_get_term($this->argument);
+    $term = taxonomy_term_load($this->argument);
     if (!empty($term)) {
       return check_plain($term->name);
     }

=== modified file 'modules/taxonomy/views_handler_argument_vocabulary_vid.inc'
--- modules/taxonomy/views_handler_argument_vocabulary_vid.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_handler_argument_vocabulary_vid.inc	2009-10-18 21:42:19 +0000
@@ -9,7 +9,7 @@
    * Override the behavior of title(). Get the name of the user.
    */
   function title() {
-    $title = db_result(db_query("SELECT v.name FROM {vocabulary} v WHERE v.vid = %d", $this->argument));
+    $title = db_query("SELECT v.name FROM {taxonomy_vocabulary} v WHERE v.vid = :vid", array(':vid' => $this->argument))->fetchField();
 
     if (empty($title)) {
       return t('No vocabulary');

=== modified file 'modules/taxonomy/views_handler_field_term_node_tid.inc'
--- modules/taxonomy/views_handler_field_term_node_tid.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_handler_field_term_node_tid.inc	2009-10-18 21:56:30 +0000
@@ -55,7 +55,7 @@
       '#title' => t('Vocabularies'),
       '#options' => $options,
       '#default_value' => $this->options['vids'],
-      '#process' => array('expand_checkboxes', 'views_process_dependency'),
+      '#process' => array('form_process_checkboxes', 'views_process_dependency'),
       '#dependency' => array('edit-options-limit' => array(TRUE)),
     );
   }
@@ -82,14 +82,14 @@
         $voc = " AND td.vid IN (" . implode(', ', array_keys(array_filter($this->options['vids']))) . ")";
       }
 
-      $result = db_query("SELECT tn.vid AS node_vid, td.*, v.name as vocabulary FROM {term_data} td INNER JOIN {term_node} tn ON td.tid = tn.tid INNER JOIN {vocabulary} v ON v.vid = td.vid WHERE tn.vid IN (" . implode(', ', $vids) . ")$voc ORDER BY td.weight, td.name");
+      $result = db_query("SELECT tn.vid AS node_vid, td.*, v.name as vocabulary FROM {taxonomy_term_data} td INNER JOIN {taxonomy_term_node} tn ON td.tid = tn.tid INNER JOIN {taxonomy_vocabulary} v ON v.vid = td.vid WHERE tn.vid IN (" . implode(', ', $vids) . ")$voc ORDER BY td.weight, td.name");
 
       while ($term = db_fetch_object($result)) {
         $this->items[$term->node_vid][$term->tid]['name'] = check_plain($term->name);
         $this->items[$term->node_vid][$term->tid]['tid'] = $term->tid;
         $this->items[$term->node_vid][$term->tid]['vid'] = $term->vid;
         $this->items[$term->node_vid][$term->tid]['vocabulary'] = check_plain($term->vocabulary);
-        
+
         if (!empty($this->options['link_to_taxonomy'])) {
           $this->items[$term->node_vid][$term->tid]['make_link'] = TRUE;
           $this->items[$term->node_vid][$term->tid]['path'] = taxonomy_term_path($term);

=== modified file 'modules/taxonomy/views_handler_filter_term_node_tid.inc'
--- modules/taxonomy/views_handler_filter_term_node_tid.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_handler_filter_term_node_tid.inc	2009-10-18 21:42:37 +0000
@@ -29,7 +29,7 @@
       // We only do this when the form is displayed so this query doesn't run
       // unnecessarily just when the object is constructed.
       if ($this->options['vid'] == 0) {
-        $this->options['vid'] = db_result(db_query('SELECT MIN(vid) FROM {vocabulary} v'));
+        $this->options['vid'] = db_query('SELECT MIN(vid) FROM {taxonomy_vocabulary} v')->fetchField();
       }
 
       $form['vid'] = array(
@@ -44,7 +44,7 @@
     }
 
     $form['markup_start'] = array(
-      '#value' => '<div class="views-left-40">',
+      '#markup' => '<div class="views-left-40">',
     );
 
     $form['type'] = array(
@@ -63,7 +63,7 @@
     );
 
     $form['markup_end'] = array(
-      '#value' => '</div>',
+      '#markup' => '</div>',
     );
   }
 
@@ -71,9 +71,7 @@
     $vocabulary = taxonomy_vocabulary_load($this->options['vid']);
     if (empty($vocabulary) && $this->options['limit']) {
       $form['markup'] = array(
-        '#prefix' => '<div class="form-item">',
-        '#suffix' => '</div>',
-        '#value' => t('An invalid vocabulary is selected. Please change it in the options.'),
+        '#markup' => '<div class="form-item">' . t('An invalid vocabulary is selected. Please change it in the options.') . '</div>',
       );
       return;
     }
@@ -81,8 +79,9 @@
     if ($this->options['type'] == 'textfield') {
       $default = '';
       if ($this->value) {
-        $result = db_query("SELECT * FROM {term_data} td WHERE td.tid IN (" . implode(', ', $this->value) . ')');
-        while ($term = db_fetch_object($result)) {
+        $result = db_query("SELECT * FROM {taxonomy_term_data} td WHERE td.tid IN (:tids)", array(
+          ':tids' => $this->value));
+        foreach ($result as $term) {
           if ($default) {
             $default .= ', ';
           }
@@ -116,12 +115,12 @@
       else {
         $options = array();
         if ($this->options['limit']) {
-          $result = db_query("SELECT * FROM {term_data} WHERE vid = %d ORDER BY weight, name", $vocabulary->vid);
+          $result = db_query("SELECT * FROM {taxonomy_term_data} WHERE vid = :vid ORDER BY weight, name", array(':vid' => $vocabulary->vid));
         }
         else {
-          $result = db_query("SELECT td.* FROM {term_data} td INNER JOIN {vocabulary} v ON td.vid = v.vid ORDER BY v.weight, v.name, td.weight, td.name");
+          $result = db_query("SELECT td.* FROM {taxonomy_term_data} td INNER JOIN {taxonomy_vocabulary} v ON td.vid = v.vid ORDER BY v.weight, v.name, td.weight, td.name");
         }
-        while ($term = db_fetch_object($result)) {
+        foreach ($result as $term) {
           $options[$term->tid] = $term->name;
         }
       }
@@ -143,7 +142,7 @@
           if (!empty($this->options['expose']['optional']) && (empty($default_value) || !empty($this->options['expose']['reduce']))) {
             $default_value = 'All';
           }
-          else if (empty($default_value)) {
+          elseif (empty($default_value)) {
             $keys = array_keys($options);
             $default_value = array_shift($keys);
           }
@@ -252,19 +251,20 @@
     $results = array();
     foreach ($values as $value) {
       $missing[strtolower($value)] = TRUE;
-      $args[] = $value;
-      $placeholders[] = "'%s'";
+      $names[] = $value;
     }
 
-    if (!$args) {
+    if (!$names) {
       return;
     }
 
-    // add the taxonomy vid to the argument list.
-    $args[] = $this->options['vid'];
-
-    $result = db_query("SELECT * FROM {term_data} WHERE name IN (" . implode(', ', $placeholders) . ") AND vid = %d", $args);
-    while ($term = db_fetch_object($result)) {
+    //$result = db_query("SELECT * FROM {taxonomy_term_data} WHERE name IN (" . implode(', ', $placeholders) . ") AND vid = %d", $args);
+    $result = db_query("SELECT * FROM {taxonomy_term_data} WHERE name IN (:name) AND vid = :vid",
+      array(
+        ':vid' => $this->options['vid'],
+        ':name' => $names
+      ));
+    foreach ($result as $term) {
       unset($missing[strtolower($term->name)]);
       $tids[] = $term->tid;
     }
@@ -292,9 +292,9 @@
     $this->value_options = array();
 
     if ($this->value) {
-      $result = db_query("SELECT * FROM {term_data} td WHERE td.tid IN ("  . implode(', ', $this->value) . ")");
+      $result = db_query("SELECT * FROM {taxonomy_term_data} td WHERE td.tid IN (:tids)", array(':tids' => $this->value));
 
-      while ($term = db_fetch_object($result)) {
+      foreach ($result as $term) {
         $this->value_options[$term->tid] = $term->name;
       }
     }

=== modified file 'modules/taxonomy/views_handler_filter_term_node_tid_depth.inc'
--- modules/taxonomy/views_handler_filter_term_node_tid_depth.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_handler_filter_term_node_tid_depth.inc	2009-10-18 07:37:32 +0000
@@ -12,7 +12,7 @@
       'or' => t('Is one of'),
     );
   }
-  
+
   function option_definition() {
     $options = parent::option_definition();
 
@@ -20,7 +20,7 @@
 
     return $options;
   }
-  
+
   function extra_options_form(&$form, &$form_state) {
     parent::extra_options_form($form, $form_state);
 
@@ -36,12 +36,12 @@
     // If no filter values are present, then do nothing.
     if (count($this->value) == 0) {
       return;
-    } 
-    else if (count($this->value) == 1) {
-      $placeholder = " = %d";
-    } 
+    }
+    elseif (count($this->value) == 1) {
+      $operator = '=';
+    }
     else {
-      $placeholder = " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")";
+      $operator = 'IN';# " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")";
     }
 
     // The normal use of ensure_my_table() here breaks Views.
@@ -52,7 +52,7 @@
       $this->table_alias = $this->relationship;
     }
     // If no relationship, then use the alias of the base table.
-    else if (isset($this->query->table_queue[$this->query->base_table]['alias'])) {
+    elseif (isset($this->query->table_queue[$this->query->base_table]['alias'])) {
       $this->table_alias = $this->query->table_queue[$this->query->base_table]['alias'];
     }
     // This should never happen, but if it does, we fail quietly.
@@ -61,30 +61,29 @@
     }
 
     // Now build the subqueries.
-    $subquery = "\n  SELECT tn.vid FROM {term_node} tn\n";
-    $where = "  WHERE tn.tid $placeholder\n";
-    $args = $this->value;
+    $subquery = dbtng_select('term_node', 'tn');
+    $subquery->addField('tn', 'vid');
+    $where = db_or()->condition('tn.tid', $this->value, $operator);
     $last = "tn";
 
     if ($this->options['depth'] > 0) {
-      $subquery .= "    LEFT JOIN {term_hierarchy} th ON th.tid = tn.tid\n";
+      $subquery->leftJoin('term_hierarchy', 'th', "th.tid = tn.tid");
       $last = "th";
       foreach (range(1, abs($this->options['depth'])) as $count) {
-        $subquery .= "    LEFT JOIN {term_hierarchy} th$count ON $last.parent = th$count.tid\n";
-        $where .= "    OR th$count.tid $placeholder\n";
-        $args = array_merge($args, $this->value);
+        $subquery->leftJoin('term_hierarchy', "th$count", "$last.parent = th$count.tid");
+        $where->condition("th$count.tid", $this->value, $operator);
         $last = "th$count";
       }
     }
-    else if ($this->options['depth'] < 0) {
+    elseif ($this->options['depth'] < 0) {
       foreach (range(1, abs($this->options['depth'])) as $count) {
-        $subquery .= "    LEFT JOIN {term_hierarchy} th$count ON $last.tid = th$count.parent\n";
-        $where .= "    OR th$count.tid $placeholder\n";
-        $args = array_merge($args, $this->value);
+        $subquery->leftJoin('term_hierarchy', "th$count", "$last.tid = th$count.parent");
+        $where->condition("th$count.tid", $this->value, $operator);
         $last = "th$count";
       }
     }
-    
-    $this->query->add_where(0, "$this->table_alias.$this->real_field IN ($subquery$where  )", $args);
+
+    $subquery->condition($where);
+    $this->query->add_where(0, "$this->table_alias.$this->real_field", $subquery, 'IN');
   }
 }

=== modified file 'modules/taxonomy/views_handler_relationship_node_term_data.inc'
--- modules/taxonomy/views_handler_relationship_node_term_data.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_handler_relationship_node_term_data.inc	2009-10-18 07:37:32 +0000
@@ -58,7 +58,7 @@
       $def['field'] = 'revision';
       // fapi ensures vids are safe here.
       $vids = implode(', ', array_filter($this->options['vids']));
-      $def['table formula'] = "(SELECT td.*, tn.vid AS revision FROM {term_data} td INNER JOIN {term_node} tn ON tn.tid = td.tid WHERE td.vid IN ($vids))";
+      $def['table formula'] = "(SELECT td.*, tn.vid AS revision FROM {taxonomy_term_data} td INNER JOIN {taxonomy_term_node} tn ON tn.tid = td.tid WHERE td.vid IN ($vids))";
     }
 
     $join = new views_join();

=== modified file 'modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc'
--- modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc	2009-10-17 18:33:18 +0000
+++ modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc	2009-10-18 21:30:54 +0000
@@ -24,7 +24,7 @@
       '#options' => $options,
       '#default_value' => isset($this->argument->options['validate_argument_vocabulary']) ? $this->argument->options['validate_argument_vocabulary'] : array(),
       '#description' => t('If you wish to validate for specific vocabularies, check them; if none are checked, all terms will pass.'),
-      '#process' => array('expand_checkboxes', 'views_process_dependency'),
+      '#process' => array('form_process_checkboxes', 'views_process_dependency'),
       '#dependency' => array('edit-options-validate-type' => array($this->id)),
     );
 
@@ -63,7 +63,7 @@
           return FALSE;
         }
 
-        $result = db_fetch_object(db_query("SELECT * FROM {term_data} WHERE tid = %d", $argument));
+        $result = db_query("SELECT * FROM {taxonomy_term_data} WHERE tid = :tid", array(':tid' => $argument))->fetchObject();
         if (!$result) {
           return FALSE;
         }
@@ -77,13 +77,11 @@
           return FALSE;
         }
 
-        $placeholders = implode(', ', array_fill(0, sizeof($tids->value), '%d'));
-
         $test = drupal_map_assoc($tids->value);
         $titles = array();
 
-        $result = db_query("SELECT * FROM {term_data} WHERE tid IN ($placeholders)", $tids->value);
-        while ($term = db_fetch_object($result)) {
+        $result = db_query("SELECT * FROM {taxonomy_term_data} WHERE tid IN (:tid)", array(':tid' => $this->value));
+        foreach ($result as $term) {
           if ($vids && empty($vids[$term->vid])) {
             return FALSE;
           }
@@ -105,10 +103,10 @@
           $and = " AND td.vid IN(" . implode(', ', $vids) . ')';
         }
         if ($transform) {
-          $result = db_fetch_object(db_query("SELECT td.* FROM {term_data} td LEFT JOIN {term_synonym} ts ON ts.tid = td.tid WHERE (replace(td.name, ' ', '-') = '%s' OR replace(ts.name, ' ', '-') = '%s')$and", $argument, $argument));
+          $result = db_fetch_object(db_query("SELECT td.* FROM {taxonomy_term_data} td LEFT JOIN {taxonomy_term_synonym} ts ON ts.tid = td.tid WHERE (replace(td.name, ' ', '-') = '%s' OR replace(ts.name, ' ', '-') = '%s')$and", $argument, $argument));
         }
         else {
-          $result = db_fetch_object(db_query("SELECT td.* FROM {term_data} td LEFT JOIN {term_synonym} ts ON ts.tid = td.tid WHERE (td.name = '%s' OR ts.name = '%s')$and", $argument, $argument));
+          $result = db_fetch_object(db_query("SELECT td.* FROM {taxonomy_term_data} td LEFT JOIN {taxonomy_term_synonym} ts ON ts.tid = td.tid WHERE (td.name = '%s' OR ts.name = '%s')$and", $argument, $argument));
         }
         if (!$result) {
           return FALSE;

=== modified file 'modules/translation.views.inc'
--- modules/translation.views.inc	2009-10-17 18:33:18 +0000
+++ modules/translation.views.inc	2009-10-18 21:53:51 +0000
@@ -14,7 +14,7 @@
  */
 
 /**
- * Implementation of hook_views_data_alter().
+ * Implements hook_views_data_alter().
  *
  * Add translation information to the node table.
  */
@@ -22,8 +22,8 @@
 
   // Joins
   $data['node']['table']['join']['node'] = array(
-	  'left_field' => 'tnid',
-	  'field' => 'tnid',
+    'left_field' => 'tnid',
+    'field' => 'tnid',
   );
 
   // Language field
@@ -57,7 +57,6 @@
     ),
     'argument' => array(
       'handler' => 'views_handler_argument_node_tnid',
-      'parent' => 'views_handler_argument_numeric', // make sure parent is included
       'name field' => 'title', // the field to display in the summary.
       'numeric' => TRUE,
       'validate type' => 'tnid',
@@ -134,41 +133,25 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function translation_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/translation',
-    ),
-    'handlers' => array(
-      // field handlers
-      'views_handler_field_node_language' => array(
-        'parent' => 'views_handler_field_node',
-      ),
-      // argument handlers
-      'views_handler_argument_node_language' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      'views_handler_argument_node_tnid' => array(
-        'parent' => 'views_handler_argument',
-      ),
-      // filters
-      'views_handler_filter_node_language' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-      'views_handler_filter_node_tnid' => array(
-        'parent' => 'views_handler_filter',
-      ),
-      // relationships
-      'views_handler_relationship_translation' => array(
-        'parent' => 'views_handler_relationship',
-      ),
-      'views_handler_filter_node_tnid_child' => array(
-        'parent' => 'views_handler_filter',
-      ),
-
+    // field handlers
+    'views_handler_field_node_language',
+
+    // argument handlers
+    'views_handler_argument_node_language',
+    'views_handler_argument_node_tnid',
+
+    // filters
+    'views_handler_filter_node_language',
+    'views_handler_filter_node_tnid',
+
+    // relationships
+    'views_handler_relationship_translation',
+    'views_handler_filter_node_tnid_child',
     ),
   );
 }

=== removed file 'modules/translation/views_handler_argument_node_language.inc'
--- modules/translation/views_handler_argument_node_language.inc	2009-10-17 18:33:18 +0000
+++ modules/translation/views_handler_argument_node_language.inc	1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
-<?php
-// $Id: views_handler_argument_node_language.inc,v 1.1 2008/09/30 22:07:15 merlinofchaos Exp $
-/**
- * Argument handler to accept a language.
- */
-class views_handler_argument_node_language extends views_handler_argument {
-  function construct() {
-    parent::construct('language');
-  }
-
-  /**
-   * Override the behavior of summary_name(). Get the user friendly version
-   * of the language.
-   */
-  function summary_name($data) {
-    return $this->node_language($data->{$this->name_alias});
-  }
-
-  /**
-   * Override the behavior of title(). Get the user friendly version of the
-   * node type.
-   */
-  function title() {
-    return $this->node_language($this->argument);
-  }
-
-  function node_language($langcode) {
-    $languages = locale_language_list();
-    return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
-  }
-}
-

=== modified file 'modules/translation/views_handler_argument_node_tnid.inc'
--- modules/translation/views_handler_argument_node_tnid.inc	2009-10-17 18:33:18 +0000
+++ modules/translation/views_handler_argument_node_tnid.inc	2009-10-18 21:43:17 +0000
@@ -14,10 +14,9 @@
    */
   function title_query() {
     $titles = array();
-    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
 
-    $result = db_query("SELECT n.title FROM {node} n WHERE n.tnid IN ($placeholders)", $this->value);
-    while ($term = db_fetch_object($result)) {
+    $result = db_query("SELECT n.title FROM {node} n WHERE n.tnid IN (:tnids)", array(':tnis' => $this->value));
+    foreach ($result as $term) {
       $titles[] = check_plain($term->title);
     }
     return $titles;

=== modified file 'modules/upload.views.inc'
--- modules/upload.views.inc	2009-10-17 18:33:18 +0000
+++ modules/upload.views.inc	2009-10-18 07:37:32 +0000
@@ -14,7 +14,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function upload_views_data() {
   $data = array();
@@ -106,7 +106,7 @@
 }
 
 /**
- * Implementation of hook_views_data_alter()
+ * Implements hook_views_data_alter()
  */
 function upload_views_data_alter(&$data) {
   $data['node']['upload_fid'] = array(
@@ -137,25 +137,14 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function upload_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/upload',
-    ),
-    'handlers' => array(
-      'views_handler_field_upload_fid' => array(
-        'parent' => 'views_handler_field_prerender_list',
-      ),
-      'views_handler_field_upload_description' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_filter_upload_fid' => array(
-        'parent' => 'views_handler_filter_boolean_operator',
-      ),
-    ),
+     'views_handler_field_upload_fid',
+     'views_handler_field_upload_description',
+     'views_handler_filter_upload_fid',
   );
 }
 

=== modified file 'modules/upload.views_convert.inc'
--- modules/upload.views_convert.inc	2009-10-17 18:33:18 +0000
+++ modules/upload.views_convert.inc	2009-10-18 07:37:32 +0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_views_convert().
+ * Implements hook_views_convert().
  *
  * Intervene to convert field values from the Views 1 format to the
  * Views 2 format. Intervene only if $view->add_item() won't produce

=== modified file 'modules/upload/views_handler_field_upload_description.inc'
--- modules/upload/views_handler_field_upload_description.inc	2009-10-17 18:33:18 +0000
+++ modules/upload/views_handler_field_upload_description.inc	2009-10-18 21:44:01 +0000
@@ -43,8 +43,8 @@
     }
 
     if ($fids) {
-      $result = db_query("SELECT f.fid, f.filepath FROM {files} f WHERE f.fid IN (" . implode(', ', $fids) . ")");
-      while ($file = db_fetch_object($result)) {
+      $result = db_query("SELECT f.fid, f.filepath FROM {files} f WHERE f.fid IN (:fids)", array(':fids' => $fids));
+      foreach ($result as $file) {
         $this->items[$file->fid] = $file;
       }
     }

=== modified file 'modules/upload/views_handler_field_upload_fid.inc'
--- modules/upload/views_handler_field_upload_fid.inc	2009-10-17 18:33:18 +0000
+++ modules/upload/views_handler_field_upload_fid.inc	2009-10-18 21:46:19 +0000
@@ -44,7 +44,7 @@
       if (!empty($this->options['only_listed'])) {
         $where = " AND u.list <> 0";
       }
-      $result = db_query("SELECT u.vid, u.fid, f.filename, f.filepath, f.filesize, f.filemime, u.description FROM {upload} u LEFT JOIN {files} f ON f.fid = u.fid WHERE u.vid IN (" . implode(', ', $vids) . ")$where ORDER BY u.weight");
+       => $fids$result = db_query("SELECT u.vid, u.fid, f.filename, f.filepath, f.filesize, f.filemime, u.description FROM {upload} u LEFT JOIN {files} f ON f.fid = u.fid WHERE u.vid IN (" . implode(', ', $vids) . ")$where ORDER BY u.weight");
       while ($file = db_fetch_array($result)) {
         $file['filename'] = check_plain($file['filename']);
         $file['filemime'] = check_plain($file['filemime']);

=== modified file 'modules/user.views.inc'
--- modules/user.views.inc	2009-10-17 18:33:18 +0000
+++ modules/user.views.inc	2009-10-18 22:15:16 +0000
@@ -12,7 +12,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function user_views_data() {
   // ----------------------------------------------------------------
@@ -320,7 +320,7 @@
 }
 
 /**
- * Implementation of hook_views_plugins
+ * Implements hook_views_plugins
  */
 function user_views_plugins() {
   return array(
@@ -330,13 +330,11 @@
         'title' => t('User ID from URL'),
         'handler' => 'views_plugin_argument_default_user',
         'path' => drupal_get_path('module', 'views') . '/modules/user', // not necessary for most modules
-        'parent' => 'fixed', // so that the parent class is included
       ),
       'current_user' => array(
         'title' => t('User ID from logged in user'),
         'handler' => 'views_plugin_argument_default_current_user',
         'path' => drupal_get_path('module', 'views') . '/modules/user', // not necessary for most modules
-        'parent' => 'fixed', // so that the parent class is included
       ),
     ),
     'argument validator' => array(
@@ -350,58 +348,25 @@
 }
 
 /**
- * Implementation of hook_views_handlers() to register all of the basic handlers
+ * Implements hook_views_handlers() to register all of the basic handlers
  * views uses.
  */
 function user_views_handlers() {
   return array(
-    'info' => array(
-      'path' => drupal_get_path('module', 'views') . '/modules/user',
-    ),
-    'handlers' => array(
-      'views_handler_argument_user_uid' => array(
-        'parent' => 'views_handler_argument_numeric',
-      ),
-      'views_handler_field_user' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_user_name' => array(
-        'parent' => 'views_handler_field_user',
-      ),
-      'views_handler_field_user_link' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_user_link_edit' => array(
-        'parent' => 'views_handler_field_user_link',
-      ),
-      'views_handler_field_user_link_delete' => array(
-        'parent' => 'views_handler_field_user_link',
-      ),
-      'views_handler_field_user_mail' => array(
-        'parent' => 'views_handler_field_user',
-      ),
-      'views_handler_field_user_language' => array(
-        'parent' => 'views_handler_field_user',
-      ),
-      'views_handler_field_user_picture' => array(
-        'parent' => 'views_handler_field',
-      ),
-      'views_handler_field_user_roles' => array(
-        'parent' => 'views_handler_field_prerender_list',
-      ),
-      'views_handler_filter_user_name' => array(
-        'parent' => 'views_handler_filter_in_operator',
-      ),
-      'views_handler_filter_user_current' => array(
-        'parent' => 'views_handler_filter_boolean_operator',
-      ),
-      'views_handler_filter_user_roles' => array(
-        'parent' => 'views_handler_filter_many_to_one',
-      ),
-      'views_handler_argument_users_roles_rid' => array(
-        'parent' => 'views_handler_argument_many_to_one',
-      ),
-    ),
+    'views_handler_argument_user_uid',
+    'views_handler_field_user',
+    'views_handler_field_user_name',
+    'views_handler_field_user_link',
+    'views_handler_field_user_link_edit',
+    'views_handler_field_user_link_delete',
+    'views_handler_field_user_mail',
+    'views_handler_field_user_language',
+    'views_handler_field_user_picture',
+    'views_handler_field_user_roles',
+    'views_handler_filter_user_name',
+    'views_handler_filter_user_current',
+    'views_handler_filter_user_roles',
+    'views_handler_argument_users_roles_rid',
   );
 }
 
@@ -411,7 +376,7 @@
  */
 function user_views_query_substitutions($view) {
   global $user;
-  return array('***CURRENT_USER***' => intval($user->uid));
+  return array(':user-current-user' => intval($user->uid));
 }
 
 /**

=== modified file 'modules/user.views_convert.inc'
--- modules/user.views_convert.inc	2009-10-17 18:33:18 +0000
+++ modules/user.views_convert.inc	2009-10-18 07:37:32 +0000
@@ -7,7 +7,7 @@
  */
 
 /**
- * Implementation of hook_views_convert().
+ * Implements hook_views_convert().
  */
 function user_views_convert($display, $type, &$view, $field, $id = NULL) {
   switch ($type) {

=== modified file 'modules/user/views_handler_argument_user_uid.inc'
--- modules/user/views_handler_argument_user_uid.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_handler_argument_user_uid.inc	2009-10-18 21:46:58 +0000
@@ -18,10 +18,9 @@
     }
 
     $titles = array();
-    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
 
-    $result = db_query("SELECT u.name FROM {users} u WHERE u.uid IN ($placeholders)", $this->value);
-    while ($term = db_fetch_object($result)) {
+    $result = db_query("SELECT u.name FROM {users} u WHERE u.uid IN (:uids)", array(':uids' => $this->value));
+    foreach ($result as $term) {
       $titles[] = check_plain($term->name);
     }
     return $titles;

=== modified file 'modules/user/views_handler_argument_users_roles_rid.inc'
--- modules/user/views_handler_argument_users_roles_rid.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_handler_argument_users_roles_rid.inc	2009-10-18 21:47:39 +0000
@@ -6,10 +6,9 @@
 class views_handler_argument_users_roles_rid extends views_handler_argument_many_to_one {
   function title_query() {
     $titles = array();
-    $placeholders = implode(', ', array_fill(0, sizeof($this->value), '%d'));
 
-    $result = db_query("SELECT name FROM {role} WHERE rid IN ($placeholders)", $this->value);
-    while ($term = db_fetch_object($result)) {
+    $result = db_query("SELECT name FROM {role} WHERE rid IN (:rids)", array(':rids' => $this->value));
+    foreach ($result as $term) {
       $titles[] = check_plain($term->name);
     }
     return $titles;

=== modified file 'modules/user/views_handler_field_user_language.inc'
--- modules/user/views_handler_field_user_language.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_handler_field_user_language.inc	2009-10-18 07:37:32 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: views_handler_field_user_language.inc,v 1.1.2.2 2009/06/02 20:18:31 merlinofchaos Exp $ 
+// $Id: views_handler_field_user_language.inc,v 1.1.2.2 2009/06/02 20:18:31 merlinofchaos Exp $
 /**
  * @file
  *   Views field handler for userlanguage.

=== modified file 'modules/user/views_handler_field_user_name.inc'
--- modules/user/views_handler_field_user_name.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_handler_field_user_name.inc	2009-10-18 19:32:03 +0000
@@ -53,7 +53,7 @@
       }
       elseif (!empty($this->options['link_to_user'])) {
         $account->name = $values->{$this->field_alias};
-        return theme('username', $account);
+        return theme('username', array('account' => $account));
       }
     }
     // Otherwise, there's no special handling, so return the data directly.

=== modified file 'modules/user/views_handler_field_user_picture.inc'
--- modules/user/views_handler_field_user_picture.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_handler_field_user_picture.inc	2009-10-18 20:02:33 +0000
@@ -18,6 +18,6 @@
     $account->name = $values->{$this->aliases['name']};
     $account->picture = $values->{$this->field_alias};
 
-    return theme('user_picture', $account);
+    return theme('user_picture', array('account' => $account));
   }
 }

=== modified file 'modules/user/views_handler_field_user_roles.inc'
--- modules/user/views_handler_field_user_roles.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_handler_field_user_roles.inc	2009-10-18 21:49:18 +0000
@@ -23,8 +23,9 @@
     }
 
     if ($uids) {
-      $result = db_query("SELECT u.uid, u.rid, r.name FROM {role} r INNER JOIN {users_roles} u ON u.rid = r.rid WHERE u.uid IN (" . implode(', ', $uids) . ") ORDER BY r.name");
-      while ($role = db_fetch_object($result)) {
+      $result = db_query("SELECT u.uid, u.rid, r.name FROM {role} r INNER JOIN {users_roles} u ON u.rid = r.rid WHERE u.uid IN (:uids) ORDER BY r.name",
+        array(':uids' => $uids));
+      foreach ($result as $role) {
         $this->items[$role->uid][$role->rid]['role'] = check_plain($role->name);
         $this->items[$role->uid][$role->rid]['rid'] = $role->rid;
       }

=== modified file 'modules/user/views_handler_filter_user_current.inc'
--- modules/user/views_handler_filter_user_current.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_handler_filter_user_current.inc	2009-10-18 07:37:32 +0000
@@ -12,7 +12,11 @@
 
   function query() {
     $this->ensure_my_table();
-    $where = "$this->table_alias.$this->real_field ";
+
+    // OLD: $this->query->add_where($this->options['group'], "$this->table_alias.$this->real_field " . (empty($this->value) ? '!=' : '=') . " ***CURRENT_USER***");
+    // NEW: $this->query->add_where($this->table_alias . '.' . $this->real_field, CURRENT_USER, empty($this->value) ? '!=' : '=');
+
+    $where = $this->table_alias . '.' . $this->real_field . ' ';
 
     if (empty($this->value)) {
       $where .= '<> ***CURRENT_USER***';
@@ -23,6 +27,6 @@
     else {
       $where .= '= ***CURRENT_USER***';
     }
-    $this->query->add_where($this->options['group'], $where);    
+    $this->query->add_where($this->options['group'], $where);
   }
 }

=== modified file 'modules/user/views_handler_filter_user_name.inc'
--- modules/user/views_handler_filter_user_name.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_handler_filter_user_name.inc	2009-10-18 21:51:51 +0000
@@ -10,8 +10,8 @@
   function value_form(&$form, &$form_state) {
     $values = array();
     if ($this->value) {
-      $result = db_query("SELECT * FROM {users} u WHERE uid IN ("  . implode(', ', $this->value) . ")");
-      while ($account = db_fetch_object($result)) {
+      $result = db_query("SELECT * FROM {users} u WHERE uid IN (:uids)", array(':uids' => $this->value));
+      foreach ($result as $account) {
         if ($account->uid) {
           $values[] = $account->name;
         }
@@ -102,8 +102,8 @@
       return $uids;
     }
 
-    $result = db_query("SELECT * FROM {users} WHERE name IN (" . implode(', ', $placeholders) . ")", $args);
-    while ($account = db_fetch_object($result)) {
+    $result = db_query("SELECT * FROM {users} WHERE name IN (:names)", array(':names' => $args));
+    foreach ($result as $account) {
       unset($missing[strtolower($account->name)]);
       $uids[] = $account->uid;
     }
@@ -127,9 +127,9 @@
     $this->value_options = array();
 
     if ($this->value) {
-      $result = db_query("SELECT * FROM {users} u WHERE uid IN ("  . implode(', ', $this->value) . ")");
+      $result = db_query("SELECT * FROM {users} u WHERE uid IN (:uids)", array(':uids' => $this->value));
 
-      while ($account = db_fetch_object($result)) {
+      foreach ($result as $account) {
         if ($account->uid) {
           $this->value_options[$account->uid] = $account->name;
         }

=== modified file 'modules/user/views_plugin_argument_validate_user.inc'
--- modules/user/views_plugin_argument_validate_user.inc	2009-10-17 18:33:18 +0000
+++ modules/user/views_plugin_argument_validate_user.inc	2009-10-18 21:52:34 +0000
@@ -26,7 +26,7 @@
         'either' => t('Allow both numeric UIDs and string usernames'),
       ),
       '#default_value' => $this->argument->options['validate_user_argument_type'],
-      '#process' => array('expand_radios', 'views_process_dependency'),
+      '#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>',
@@ -48,7 +48,7 @@
       '#options' => user_roles(TRUE),
       '#default_value' => $this->argument->options['validate_user_roles'],
       '#description' => t('If no roles are selected, users from any role will be allowed.'),
-      '#process' => array('expand_checkboxes', 'views_process_dependency'),
+      '#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),
@@ -89,8 +89,8 @@
       $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);
-      while ($role = db_fetch_object($result)) {
+      $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)) {

=== modified file 'modules/views.views.inc'
--- modules/views.views.inc	2009-10-17 18:33:18 +0000
+++ modules/views.views.inc	2009-10-18 22:14:12 +0000
@@ -12,7 +12,7 @@
  */
 
 /**
- * Implementation of hook_views_data()
+ * Implements hook_views_data()
  */
 function views_views_data() {
   $data['views']['table']['group'] = t('Global');
@@ -43,7 +43,7 @@
       'handler' => 'views_handler_field_custom',
     ),
   );
-  
+
   $data['views']['counter'] = array(
     'title' => t('View result counter'),
     'help' => t('Displays the actual position of the view result'),

=== modified file 'plugins/views_plugin_access_perm.inc'
--- plugins/views_plugin_access_perm.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_access_perm.inc	2009-10-19 05:17:54 +0000
@@ -24,9 +24,10 @@
   function options_form(&$form, &$form_state) {
     $perms = array();
     // Get list of permissions
-    foreach (module_list(FALSE, FALSE, TRUE) as $module) {
-      if ($permissions = module_invoke($module, 'perm')) {
-        $perms[$module] = drupal_map_assoc($permissions);
+    foreach (module_implements('permission') as $module) {
+      $permissions = module_invoke($module, 'permission');
+      foreach ($permissions as $name => $perm) {
+        $perms[$module][$name] = $perm['title'];
       }
     }
     $form['perm'] = array(

=== modified file 'plugins/views_plugin_access_role.inc'
--- plugins/views_plugin_access_role.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_access_role.inc	2009-10-18 07:37:32 +0000
@@ -20,7 +20,7 @@
     if ($count < 1) {
       return t('No role(s) selected');
     }
-    else if ($count > 1) {
+    elseif ($count > 1) {
       return t('Multiple roles');
     }
     else {

=== modified file 'plugins/views_plugin_argument_default_php.inc'
--- plugins/views_plugin_argument_default_php.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_argument_default_php.inc	2009-10-18 07:37:32 +0000
@@ -33,7 +33,7 @@
    * default plugin.
    */
   function access() {
-    return user_access('use PHP for block visibility');
+    return user_access('use PHP for settings');
   }
 
   function get_argument($raw = FALSE) {

=== modified file 'plugins/views_plugin_argument_validate_php.inc'
--- plugins/views_plugin_argument_validate_php.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_argument_validate_php.inc	2009-10-18 07:37:32 +0000
@@ -31,7 +31,7 @@
    * validate plugin.
    */
   function access() {
-    return user_access('use PHP for block visibility');
+    return user_access('use PHP for settings');
   }
 
   function validate_argument($argument) {

=== modified file 'plugins/views_plugin_cache.inc'
--- plugins/views_plugin_cache.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_cache.inc	2009-10-19 05:17:54 +0000
@@ -73,7 +73,7 @@
       case 'results':
         $data = array(
           'result' => $this->view->result,
-          'total_rows' => $this->view->total_rows,
+          'total_rows' => isset($this->view->total_rows) ? $this->view->total_rows : 0,
           'pager' => $this->view->pager,
         );
         cache_set($this->get_results_key(), $data, $this->table);
@@ -164,11 +164,13 @@
    * will be removed so that we don't hold onto it.
    */
   function cache_start() {
-    $this->storage['head'] = drupal_set_html_head();
-    $this->storage['css'] = drupal_add_css();
-
-    foreach (array('header', 'footer') as $scope) {
-      $this->storage['js'][$scope] = drupal_add_js(NULL, NULL, $scope);
+    $this->storage['head'] = drupal_add_html_head();
+    $this->storage['css'] = drupal_add_css();  
+    $js = drupal_add_js();
+    foreach ($js as $key => $data) {
+      if ($data['scope'] == 'header' || $data['scope'] == 'footer') {
+        $this->storage['js'][$file['scope']][$key] = $data;
+      }
     }
   }
 
@@ -177,20 +179,21 @@
    */
   function gather_headers() {
     // Simple replacement for head
-    $this->storage['head'] = str_replace($this->storage['head'], '', drupal_set_html_head());
+    if (isset($this->storage['head'])) {
+      $this->storage['head'] = str_replace($this->storage['head'], '', drupal_add_html_head());
+    }
+    else {
+      $this->storage['head'] = '';
+    }
 
     // Slightly less simple for CSS:
     $css = drupal_add_css();
-    $start = $this->storage['css'];
+    $start = isset($this->storage['css']) ? $this->storage['css'] : array();
     $this->storage['css'] = array();
 
-    foreach ($css as $media => $medias) {
-      foreach ($medias as $type => $types) {
-        foreach ($types as $path => $preprocess) {
-          if (!isset($start[$media][$type][$path])) {
-            $this->storage['css'][] = array($path, $type, $media, $preprocess);
-          }
-        }
+    foreach ($css as $file => $data) {
+      if (!isset($this->storage['css'][$file])) {
+        $this->storage['css'][$file] = $data;
       }
     }
 
@@ -200,27 +203,14 @@
       $js[$scope] = drupal_add_js(NULL, NULL, $scope);
     }
 
-    $start = $this->storage['js'];
+    $start = isset($this->storage['js']) ? $this->storage['js'] : array();
     $this->storage['js'] = array();
 
-    foreach ($js as $scope => $scopes) {
-      foreach ($scopes as $type => $types) {
-        foreach ($types as $id => $info) {
-          if (!isset($start[$scope][$type][$id])) {
-            switch ($type) {
-              case 'setting':
-                $this->storage['js'][] = array($info, $type, $scope);
-                break;
-
-              case 'inline':
-                $this->storage['js'][] = array($info['code'], $type, $scope, $info['defer']);
-                break;
-
-              default:
-                $this->storage['js'][] = array($id, $type, $scope, $info['defer'], $info['cache']);
-            }
-          }
-        }
+return; // @TODO: fixme
+
+    foreach ($js as $key => $data) {
+      if (!isset($start[$key][$data['scope']][$key]) && ($data['scope'] == 'header' || $data['scope'] == 'footer')) {
+        $this->storage['js'][$file['scope']][$key] = $data;
       }
     }
   }
@@ -230,7 +220,7 @@
    */
   function restore_headers() {
     if (!empty($this->storage['head'])) {
-      drupal_set_html_head($this->storage['head']);
+      drupal_add_html_head($this->storage['head']);
     }
     if (!empty($this->storage['css'])) {
       foreach ($this->storage['css'] as $args) {
@@ -239,7 +229,7 @@
     }
     if (!empty($this->storage['js'])) {
       foreach ($this->storage['js'] as $args) {
-        call_user_func_array('drupal_add_js', $args);
+        drupal_add_js($data);
       }
     }
   }
@@ -248,8 +238,16 @@
     global $user;
 
     if (!isset($this->_results_key)) {
+      
+      $build_info = $this->view->build_info;
+      
+      foreach (array('query', 'count_query') as $index) {
+        $query = clone $build_info[$index];
+        $query->preExecute();
+        $build_info[$index] = (string)$query;
+      }
       $key_data = array(
-        'build_info' => $this->view->build_info,
+        'build_info' => $build_info,
         'roles' => array_keys($user->roles),
         'super-user' => $user->uid == 1, // special caching for super user.
       );

=== modified file 'plugins/views_plugin_cache_none.inc'
--- plugins/views_plugin_cache_none.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_cache_none.inc	2009-10-18 07:37:32 +0000
@@ -11,9 +11,9 @@
     return t('None');
   }
 
-  function cache_get($type) {
+  function get($type) {
     return FALSE;
   }
 
-  function cache_set($type) { }
+  function set($type) { }
 }

=== modified file 'plugins/views_plugin_cache_time.inc'
--- plugins/views_plugin_cache_time.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_cache_time.inc	2009-10-18 07:37:32 +0000
@@ -37,7 +37,7 @@
 
   function cache_expire($type) {
     if ($lifespan = $this->options[$type . '_lifespan']) {
-      $cutoff = time() - $lifespan;
+      $cutoff = REQUEST_TIME - $lifespan;
       return $cutoff;
     }
     else {

=== modified file 'plugins/views_plugin_display.inc'
--- plugins/views_plugin_display.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_display.inc	2009-10-19 19:59:12 +0000
@@ -32,7 +32,7 @@
     $this->display = &$display;
 
     // Make some modifications:
-    if (!isset($options)) {
+    if (!isset($options) && isset($display->display_options)) {
       $options = $display->display_options;
     }
 
@@ -297,7 +297,7 @@
         'translatable' => TRUE,
       ),
       'header_format' => array(
-        'default' => FILTER_FORMAT_DEFAULT,
+        'default' => filter_default_format(),
       ),
       'header_empty' => array(
         'default' => FALSE,
@@ -307,7 +307,7 @@
         'translatable' => TRUE,
       ),
       'footer_format' => array(
-        'default' => FILTER_FORMAT_DEFAULT,
+        'default' => filter_default_format(),
       ),
       'footer_empty' => array(
         'default' => FALSE,
@@ -317,7 +317,7 @@
         'translatable' => TRUE,
       ),
       'empty_format' => array(
-        'default' => FILTER_FORMAT_DEFAULT,
+        'default' => filter_default_format(),
       ),
       'use_ajax' => array(
         'default' => FALSE,
@@ -588,6 +588,7 @@
    * an easy URL to exactly the right section. Don't override this.
    */
   function option_link($text, $section, $class = '', $title = '') {
+    views_add_js('ajax');
     if (!empty($class)) {
       $text = '<span>' . $text . '</span>';
     }
@@ -600,7 +601,7 @@
       $title = $text;
     }
 
-    return l($text, 'admin/build/views/nojs/display/' . $this->view->name . '/' . $this->display->id . '/' . $section, array('attributes' => array('class' => 'views-ajax-link ' . $class, 'title' => $title), 'html' => TRUE));
+    return l($text, 'admin/structure/views/nojs/display/' . $this->view->name . '/' . $this->display->id . '/' . $section, array('attributes' => array('class' => 'views-ajax-link ' . $class, 'title' => $title, 'id' => drupal_html_id('views-' . $this->display->id . '-' . $section)), 'html' => TRUE));
   }
 
   /**
@@ -781,12 +782,11 @@
       }
       else {
         // A lot of code to get the name of the filter format.
-        $fmt_string = $this->get_option($type . '_format');
-        if (empty($fmt_string)) {
-          $fmt_string = FILTER_FORMAT_DEFAULT;
+        $format_id = $this->get_option($type . '_format');
+        if (empty($format_id)) {
+          $format_id = filter_default_format();
         }
-        $format_val = filter_resolve_format($fmt_string);
-        $format = filter_formats($format_val);
+        $format = filter_format_load($format_id);
         if ($format) {
           $field = check_plain($format->name);
         }
@@ -851,9 +851,7 @@
       case 'use_ajax':
         $form['#title'] .= t('Use AJAX when available to load this view');
         $form['description'] = array(
-          '#prefix' => '<div class="description form-item">',
-          '#suffix' => '</div>',
-          '#value' => t('If set, this view will use an AJAX mechanism for paging, table sorting and exposed filters. This means the entire page will not refresh. It is not recommended that you use this if this view is the main content of the page as it will prevent deep linking to specific pages, but it is very useful for side content.'),
+          '#markup' => '<div class="description form-item">' . t('If set, this view will use an AJAX mechanism for paging, table sorting and exposed filters. This means the entire page will not refresh. It is not recommended that you use this if this view is the main content of the page as it will prevent deep linking to specific pages, but it is very useful for side content.') . '</div>',
         );
         $form['use_ajax'] = array(
           '#type' => 'radios',
@@ -918,7 +916,7 @@
       case 'access':
         $form['#title'] .= t('Access restrictions');
         $form['access'] = array(
-          '#prefix' => '<div class="clear-block">',
+          '#prefix' => '<div class="clearfix">',
           '#suffix' => '</div>',
           '#tree' => TRUE,
         );
@@ -934,8 +932,8 @@
         if (!empty($access_plugin['uses options'])) {
           $form['markup'] = array(
             '#prefix' => '<div class="form-item description">',
+            '#markup' => t('You may also adjust the !settings for the currently selected access restriction by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'access_options'))),
             '#suffix' => '</div>',
-            '#value' => t('You may also adjust the !settings for the currently selected access restriction by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'access_options'))),
           );
         }
 
@@ -960,7 +958,7 @@
       case 'cache':
         $form['#title'] .= t('Caching');
         $form['cache'] = array(
-          '#prefix' => '<div class="clear-block">',
+          '#prefix' => '<div class="clearfix">',
           '#suffix' => '</div>',
           '#tree' => TRUE,
         );
@@ -977,7 +975,7 @@
           $form['markup'] = array(
             '#prefix' => '<div class="form-item description">',
             '#suffix' => '</div>',
-            '#value' => t('You may also adjust the !settings for the currently selected cache mechanism by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'cache_options'))),
+            '#markup' => t('You may also adjust the !settings for the currently selected cache mechanism by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'cache_options'))),
           );
         }
         break;
@@ -1054,9 +1052,7 @@
         $style_plugin = views_fetch_plugin_data('style', $this->get_option('style_plugin'));
         if (!empty($style_plugin['uses options'])) {
           $form['markup'] = array(
-            '#prefix' => '<div class="form-item description">',
-            '#suffix' => '</div>',
-            '#value' => t('You may also adjust the !settings for the currently selected style by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'style_options'))),
+            '#markup' => '<div class="form-item description">' . t('You may also adjust the !settings for the currently selected style by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'style_options'))) . '</div>',
           );
         }
 
@@ -1099,9 +1095,7 @@
         $row_plugin = views_fetch_plugin_data('row', $this->get_option('row_plugin'));
         if (!empty($row_plugin['uses options'])) {
           $form['markup'] = array(
-            '#prefix' => '<div class="form-item description">',
-            '#suffix' => '</div>',
-            '#value' => t('You may also adjust the !settings for the currently selected row style by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'row_options'))),
+            '#markup' => '<div class="form-item description">' . t('You may also adjust the !settings for the currently selected row style by clicking on the icon.', array('!settings' => $this->option_link(t('settings'), 'row_options'))) . '</div>',
           );
         }
 
@@ -1127,13 +1121,13 @@
         if (isset($_POST['theme'])) {
           $this->view->theme = $_POST['theme'];
         }
-        else if (empty($this->view->theme)) {
+        elseif (empty($this->view->theme)) {
           $this->view->theme = variable_get('theme_default', 'garland');
         }
 
         global $custom_theme;
         $custom_theme = $this->view->theme;
-        init_theme();
+        drupal_theme_initialize();
 
         $funcs = array();
         // Get theme functions for the display. Note that some displays may
@@ -1180,9 +1174,7 @@
         }
 
         $form['important'] = array(
-          '#prefix' => '<div class="form-item description">',
-          '#suffix' => '</div>',
-          '#value' => '<p>' . t('This section lists all possible templates for the display plugin and for the style plugins, ordered roughly from the least specific to the most specific. The active template for each plugin -- which is the most specific template found on the system -- is highlighted in bold.') . '</p>',
+          '#markup' => '<div class="form-item description"><p>' . t('This section lists all possible templates for the display plugin and for the style plugins, ordered roughly from the least specific to the most specific. The active template for each plugin -- which is the most specific template found on the system -- is highlighted in bold.') . '</p></div>',
         );
 
         foreach (list_themes() as $key => $theme) {
@@ -1206,9 +1198,7 @@
         );
 
         $form['analysis'] = array(
-          '#prefix' => '<div class="form-item">',
-          '#suffix' => '</div>',
-          '#value' => theme('item_list', $funcs),
+          '#markup' => '<div class="form-item">' . theme('item_list', array('items' => $funcs)) . '</div>',
         );
 
         $form['rescan_button'] = array(
@@ -1221,9 +1211,7 @@
           '#submit' => array('views_ui_config_item_form_rescan'),
         );
         $form['rescan_button']['markup'] = array(
-          '#prefix' => '<div class="description">',
-          '#suffix' => '</div>',
-          '#value' => t("<strong>Important!</strong> When adding, removing, or renaming template files, it is necessary to make Drupal aware of the changes by making it rescan the files on your system. By clicking this button you clear Drupal's theme registry and thereby trigger this rescanning process. The highlighted templates above will then reflect the new state of your system."),
+          '#markup' => '<div class="description">' . t("<strong>Important!</strong> When adding, removing, or renaming template files, it is necessary to make Drupal aware of the changes by making it rescan the files on your system. By clicking this button you clear Drupal's theme registry and thereby trigger this rescanning process. The highlighted templates above will then reflect the new state of your system.") . '</div>',
         );
 
         $form_state['ok_button'] = TRUE;
@@ -1248,9 +1236,7 @@
         }
 
         $form['analysis'] = array(
-          '#prefix' => '<div class="form-item">',
-          '#suffix' => '</div>',
-          '#value' => $output,
+          '#markup' => '<div class="form-item">' . $output . '</div>',
         );
 
         $form_state['ok_button'] = TRUE;
@@ -1277,9 +1263,7 @@
         }
 
         $form['analysis'] = array(
-          '#prefix' => '<div class="form-item">',
-          '#suffix' => '</div>',
-          '#value' => $output,
+          '#markup' => '<div class="form-item">' . $output . '</div>',
         );
 
         $form_state['ok_button'] = TRUE;
@@ -1306,9 +1290,7 @@
         }
 
         $form['analysis'] = array(
-          '#prefix' => '<div class="form-item">',
-          '#suffix' => '</div>',
-          '#value' => $output,
+          '#markup' => '<div class="form-item">' . $output . '</div>',
         );
 
         $form_state['ok_button'] = TRUE;
@@ -1324,9 +1306,7 @@
         $output .= '<pre>' . check_plain(file_get_contents(drupal_get_path('module', 'views') . '/theme/views-view-field.tpl.php')) . '</pre>';
 
         $form['analysis'] = array(
-          '#prefix' => '<div class="form-item">',
-          '#suffix' => '</div>',
-          '#value' => $output,
+          '#markup' => '<div class="form-item">' . $output . '</div>',
         );
         $form_state['ok_button'] = TRUE;
         break;
@@ -1334,9 +1314,7 @@
       case 'exposed_block':
         $form['#title'] .= t('Put the exposed form in a block');
         $form['description'] = array(
-          '#prefix' => '<div class="description form-item">',
-          '#suffix' => '</div>',
-          '#value' => t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.'),
+          '#markup' => '<div class="description form-item">' . t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '</div>',
         );
         $form['exposed_block'] = array(
           '#type' => 'radios',
@@ -1561,7 +1539,7 @@
     }
 
     $form['override'] = array(
-      '#prefix' => '<div class="views-override clear-block">',
+      '#prefix' => '<div class="views-override clearfix">',
       '#suffix' => '</div>',
     );
     if ($this->is_defaulted($section)) {
@@ -1570,10 +1548,12 @@
         '#value' => t('Override'),
         '#submit' => array('views_ui_edit_display_form_override'),
       );
+      $help = '';
+      if (module_exists('advanced_help')) {
+        $help = theme('advanced_help_topic', array('topic' => 'views', 'type' => 'overrides'));
+      }
       $form['override']['markup'] = array(
-        '#prefix' => '<div class="description">',
-        '#value' => theme('advanced_help_topic', 'views', 'overrides') . t('Status: using default values.'),
-        '#suffix' => '</div>',
+        '#markup' => '<div class="description">' . $help . t('Status: using default values.') . '</div>',
       );
 
       $form_state['update_name'] = t('Update default display');
@@ -1584,10 +1564,12 @@
         '#value' => t('Use default'),
         '#submit' => array('views_ui_edit_display_form_override'),
       );
+      $help = '';
+      if (module_exists('advanced_help')) {
+        $help = theme('advanced_help_topic', array('topic' => 'views', 'type' => 'overrides'));
+      }
       $form['override']['markup'] = array(
-        '#prefix' => '<div class="description">',
-        '#value' => theme('advanced_help_topic', 'views', 'overrides') . t('Status: using overridden values.'),
-        '#suffix' => '</div>',
+        '#markup' => '<div class="description">' . $help . t('Status: using overridden values.') . '</div>',
       );
 
       $form_state['update_name'] = NULL;
@@ -1660,7 +1642,8 @@
         }
         $theme = views_theme_functions('views_more', $this->view, $this->display);
         $path = check_url(url($path, $url_options));
-        return theme($theme, $path, $this->use_more_text());
+        
+        return theme($theme, array('more_url' => $path, 'link_text' => $this->use_more_text()));
       }
     }
   }
@@ -1674,10 +1657,12 @@
     $value = $this->get_option($area);
     // Check to make sure the filter format exists; if not, we don't
     // display anything.
-    $format = filter_resolve_format($this->get_option($area . '_format'));
+    //$format = filter_resolve_format($this->get_option($area . '_format'));
+    $format = $this->get_option($area . '_format');
 
     if (!array_key_exists($format, $formats)) {
-      $formats[$format] = db_result(db_query("SELECT name FROM {filter_formats} WHERE format = %d", $format));
+      $filter = filter_format_load($format);
+      $formats[$format] = $filter->name;
     }
 
     if (!$formats[$format]) {
@@ -1685,7 +1670,7 @@
     }
 
     if ($value) {
-      return check_markup($value, $format, FALSE);
+      return check_markup($value, $format, '', FALSE);
     }
   }
 
@@ -1714,7 +1699,7 @@
   /**
    * If this display creates a block, implement one of these.
    */
-  function hook_block($op = 'list', $delta = 0, $edit = array()) { return array(); }
+  function hook_block_save($delta = 0, $edit = array()) { return array(); }
 
   /**
    * If this display creates a page with a menu item, implement it here.
@@ -1725,7 +1710,7 @@
    * Render this display.
    */
   function render() {
-    return theme($this->theme_functions(), $this->view);
+    return theme($this->theme_functions(), array('view' => $this->view));
   }
 
   /**

=== modified file 'plugins/views_plugin_display_attachment.inc'
--- plugins/views_plugin_display_attachment.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_display_attachment.inc	2009-10-18 07:37:32 +0000
@@ -79,7 +79,7 @@
     if (count($displays) > 1) {
       $attach_to = t('Multiple displays');
     }
-    else if (count($displays) == 1) {
+    elseif (count($displays) == 1) {
       $display = array_shift($displays);
       if (!empty($this->view->display[$display])) {
         $attach_to = check_plain($this->view->display[$display]->display_title);

=== modified file 'plugins/views_plugin_display_block.inc'
--- plugins/views_plugin_display_block.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_display_block.inc	2009-10-18 07:37:32 +0000
@@ -15,7 +15,7 @@
     $options = parent::option_definition();
 
     $options['block_description'] = array('default' => '', 'translatable' => TRUE);
-    $options['block_caching'] = array('default' => BLOCK_NO_CACHE);
+    $options['block_caching'] = array('default' => DRUPAL_NO_CACHE);
 
     return $options;
   }
@@ -25,21 +25,19 @@
    * but extended block handlers might be able to do interesting
    * stuff with it.
    */
-  function execute_hook_block($op = 'list', $delta = 0, $edit = array()) {
-    if ($op == 'list') {
-      $delta = $this->view->name . '-' . $this->display->id;
-      $desc = $this->get_option('block_description');
+  function execute_hook_block_list($delta = 0, $edit = array()) {
+    $delta = $this->view->name . '-' . $this->display->id;
+    $desc = $this->get_option('block_description');
 
-      if (empty($desc)) {
-        $desc = t('@view: @display', array('@view' => $this->view->name, '@display' => $this->display->display_title));
-      }
-      return array(
-        $delta => array(
-          'info' => $desc,
-          'cache' => $this->get_cache_type()
-        )
-      );
+    if (empty($desc)) {
+      $desc = t('@view: @display', array('@view' => $this->view->name, '@display' => $this->display->display_title));
     }
+    return array(
+      $delta => array(
+        'info' => $desc,
+        'cache' => $this->get_cache_type()
+      ),
+    );
   }
 
   /**
@@ -85,7 +83,7 @@
 
     $cache_type = $this->get_option('block_caching');
     if (empty($cache_type)) {
-      $cache_type = BLOCK_NO_CACHE;
+      $cache_type = DRUPAL_NO_CACHE;
     }
 
     $types = $this->block_caching_modes();
@@ -101,13 +99,13 @@
    */
   function block_caching_modes() {
     return array(
-      BLOCK_NO_CACHE => t('Do not cache'),
-      BLOCK_CACHE_GLOBAL => t('Cache once for everything (global)'),
-      BLOCK_CACHE_PER_PAGE => t('Per page'),
-      BLOCK_CACHE_PER_ROLE => t('Per role'),
-      BLOCK_CACHE_PER_ROLE | BLOCK_CACHE_PER_PAGE => t('Per role per page'),
-      BLOCK_CACHE_PER_USER => t('Per user'),
-      BLOCK_CACHE_PER_USER | BLOCK_CACHE_PER_PAGE => t('Per user per page'),
+      DRUPAL_NO_CACHE => t('Do not cache'),
+      DRUPAL_CACHE_GLOBAL => t('Cache once for everything (global)'),
+      DRUPAL_CACHE_PER_PAGE => t('Per page'),
+      DRUPAL_CACHE_PER_ROLE => t('Per role'),
+      DRUPAL_CACHE_PER_ROLE | DRUPAL_CACHE_PER_PAGE => t('Per role per page'),
+      DRUPAL_CACHE_PER_USER => t('Per user'),
+      DRUPAL_CACHE_PER_USER | DRUPAL_CACHE_PER_PAGE => t('Per user per page'),
     );
   }
 
@@ -118,7 +116,7 @@
   function get_cache_type() {
     $cache_type = $this->get_option('block_caching');
     if (empty($cache_type)) {
-      $cache_type = BLOCK_NO_CACHE;
+      $cache_type = DRUPAL_NO_CACHE;
     }
     return $cache_type;
   }
@@ -180,9 +178,9 @@
 
     return FALSE;
   }
-  
+
   /**
-   * Save the block cache setting in the blocks table if this block allready 
+   * Save the block cache setting in the blocks table if this block allready
    * exists in the blocks table. Dirty fix untill http://drupal.org/node/235673 gets in.
    */
   function save_block_cache($delta, $cache_setting) {

=== modified file 'plugins/views_plugin_display_feed.inc'
--- plugins/views_plugin_display_feed.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_display_feed.inc	2009-10-18 07:37:32 +0000
@@ -100,7 +100,7 @@
     if (count($displays) > 1) {
       $attach_to = t('Multiple displays');
     }
-    else if (count($displays) == 1) {
+    elseif (count($displays) == 1) {
       $display = array_shift($displays);
       if (!empty($this->view->display[$display])) {
         $attach_to = check_plain($this->view->display[$display]->display_title);
@@ -195,7 +195,7 @@
       $plugin->attach_to($display_id, $this->get_path(), $clone->get_title());
     }
   }
-  
+
   function uses_link_display() {
     return TRUE;
   }

=== modified file 'plugins/views_plugin_display_page.inc'
--- plugins/views_plugin_display_page.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_display_page.inc	2009-10-18 19:13:47 +0000
@@ -267,7 +267,7 @@
         $form['#title'] .= t('Menu item entry');
         $form['#help_topic'] = 'menu';
         $form['menu'] = array(
-          '#prefix' => '<div class="clear-block">',
+          '#prefix' => '<div class="clearfix">',
           '#suffix' => '</div>',
           '#tree' => TRUE,
         );
@@ -305,15 +305,6 @@
           '#process' => array('views_process_dependency'),
           '#dependency' => array('radio:menu[type]' => array('normal', 'tab', 'default tab')),
         );
-        $form['menu']['name-warning'] = array(
-          '#type' => 'markup',
-          '#prefix' => '<div class="warning">',
-          '#value' => t("Warning: Changing this item's menu will not work reliably in Drupal 6.4 or earlier. Please upgrade your copy of Drupal at !url.", array('!url' => l('drupal.org', 'http://drupal.org/project/Drupal+project'))),
-          '#suffix' => '</div>',
-          '#process' => array('views_process_dependency'),
-          '#dependency' => array('radio:menu[type]' => array('normal')),
-          '#access' => version_compare(VERSION, '6.5', '<'),
-        );
 
         // Only display the menu selector if menu module is enabled.
         if (module_exists('menu')) {
@@ -333,7 +324,7 @@
             '#value' => $menu['name'],
           );
           $form['menu']['markup'] = array(
-            '#value' => t('Menu selection requires the activation of menu module.'),
+            '#markup' => t('Menu selection requires the activation of menu module.'),
           );
         }
         $form['menu']['weight'] = array(
@@ -354,13 +345,11 @@
         }
 
         $form['tab_markup'] = array(
-          '#prefix' => '<div class="form-item description">',
-          '#suffix' => '</div>',
-          '#value' => t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.'),
+          '#markup' => '<div class="form-item description">' . t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is <em>foo/bar/baz</em>, the parent path would be <em>foo/bar</em>.') . '</div>',
         );
 
         $form['tab_options'] = array(
-          '#prefix' => '<div class="clear-block">',
+          '#prefix' => '<div class="clearfix">',
           '#suffix' => '</div>',
           '#tree' => TRUE,
         );

=== modified file 'plugins/views_plugin_query.inc'
--- plugins/views_plugin_query.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_query.inc	2009-10-18 07:37:32 +0000
@@ -23,12 +23,12 @@
    *   Provide a countquery if this is true, otherwise provide a normal query.
    */
   function query($get_count = FALSE) { }
-  
+
   /**
    * Let modules modify the query just prior to finalizing it.
    */
   function alter(&$view) {  }
-  
+
   /**
    * Builds the necessary info to execute the query.
    */
@@ -37,7 +37,7 @@
   /**
    * Executes the query and fills the associated view object with according
    * values.
-   * 
+   *
    * Values to set: $view->result, $view->total_rows, $view->execute_time,
    * $view->pager['current_page'].
    */

=== modified file 'plugins/views_plugin_query_default.inc'
--- plugins/views_plugin_query_default.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_query_default.inc	2009-10-19 05:17:54 +0000
@@ -9,7 +9,7 @@
 /**
  * Object used to create a SELECT query.
  */
-class views_plugin_query_default extends views_plugin_query{
+class views_plugin_query_default extends views_plugin_query {
 
   /**
    * A list of tables in the order they should be added, keyed by alias.
@@ -66,6 +66,8 @@
    */
   var $distinct = FALSE;
 
+  var $placeholder_counter = 0;
+
   /**
    * Constructor; Create the basic query object and fill with default values.
    */
@@ -191,7 +193,7 @@
     if (empty($link_point)) {
       $link_point = $this->base_table;
     }
-    else if (!array_key_exists($link_point, $this->relationships)) {
+    elseif (!array_key_exists($link_point, $this->relationships)) {
       return FALSE;
     }
 
@@ -541,7 +543,7 @@
       // be the prior relationship. Unless it's a direct link.
 
       // Safety! Don't modify an original here.
-      $join = drupal_clone($join);
+      $join = clone $join;
 
       // Do we need to try to ensure a path?
       if ($join->left_table != $this->relationships[$relationship]['table'] &&
@@ -555,11 +557,11 @@
         $join->left_table = $relationship;
       }
       // then, try the base alias.
-      else if (isset($this->tables[$relationship][$join->left_table]['alias'])) {
+      elseif (isset($this->tables[$relationship][$join->left_table]['alias'])) {
         $join->left_table = $this->tables[$relationship][$join->left_table]['alias'];
       }
       // But if we're already looking at an alias, use that instead.
-      else if (isset($this->table_queue[$relationship]['alias'])) {
+      elseif (isset($this->table_queue[$relationship]['alias'])) {
         $join->left_table = $this->table_queue[$relationship]['alias'];
       }
     }
@@ -700,16 +702,6 @@
   }
 
   /**
-   * Control how all WHERE and HAVING groups are put together.
-   *
-   * @param $type
-   *   Either 'AND' or 'OR'
-   */
-  function set_group_operator($type = 'AND') {
-    $this->group_operator = strtoupper($type);
-  }
-
-  /**
    * Add a simple WHERE clause to the query. The caller is responsible for
    * ensuring that all fields are fully qualified (TABLE.FIELD) and that
    * the table already exists in the query.
@@ -718,25 +710,18 @@
    *   The WHERE group to add these to; groups are used to create AND/OR
    *   sections. Groups cannot be nested. Use 0 as the default group.
    *   If the group does not yet exist it will be created as an AND group.
-   * @param $clause
-   *   The actual clause to add. When adding a where clause it is important
-   *   that all tables are addressed by the alias provided by add_table or
-   *   ensure_table and that all fields are addressed by their alias wehn
-   *   possible. Please use %d and %s for arguments.
-   * @param ...
-   *   A number of arguments as used in db_query(). May be many args or one
-   *   array full of args.
+   * @param $field
+   *   The name of the field to check.
+   * @param $value
+   *   The value to test the field against. In most cases, this is a scalar. For more
+   *   complex options, it is an array. The meaning of each element in the array is
+   *   dependent on the $operator.
+   * @param $operator
+   *   The comparison operator, such as =, <, or >=. It also accepts more complex
+   *   options such as IN, LIKE, or BETWEEN. Defaults to IN if $value is an array
+   *   = otherwise.
    */
-  function add_where($group, $clause) {
-    $args = func_get_args();
-    array_shift($args); // ditch $group
-    array_shift($args); // ditch $clause
-
-    // Expand an array of args if it came in.
-    if (count($args) == 1 && is_array(reset($args))) {
-      $args = current($args);
-    }
-
+  function add_where($group, $field, $value = NULL, $operator = NULL) {
     // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all
     // the default group.
     if (empty($group)) {
@@ -748,13 +733,11 @@
       $this->set_where_group('AND', $group);
     }
 
-    // Add the clause and the args.
-    if (is_array($args)) {
-      $this->where[$group]['clauses'][] = $clause;
-      // we use array_values() here to prevent array_merge errors as keys from multiple
-      // sources occasionally collide.
-      $this->where[$group]['args'] = array_merge($this->where[$group]['args'], array_values($args));
-    }
+    $this->where[$group]['conditions'][] = array(
+      'field' => $field,
+      'value' => $value,
+      'operator' => $operator,
+    );
   }
 
   /**
@@ -766,25 +749,18 @@
    *   The HAVING group to add these to; groups are used to create AND/OR
    *   sections. Groups cannot be nested. Use 0 as the default group.
    *   If the group does not yet exist it will be created as an AND group.
-   * @param $clause
-   *   The actual clause to add. When adding a having clause it is important
-   *   that all tables are addressed by the alias provided by add_table or
-   *   ensure_table and that all fields are addressed by their alias wehn
-   *   possible. Please use %d and %s for arguments.
-   * @param ...
-   *   A number of arguments as used in db_query(). May be many args or one
-   *   array full of args.
+   * @param $field
+   *   The name of the field to check.
+   * @param $value
+   *   The value to test the field against. In most cases, this is a scalar. For more
+   *   complex options, it is an array. The meaning of each element in the array is
+   *   dependent on the $operator.
+   * @param $operator
+   *   The comparison operator, such as =, <, or >=. It also accepts more complex
+   *   options such as IN, LIKE, or BETWEEN. Defaults to IN if $value is an array
+   *   = otherwise.
    */
-  function add_having($group, $clause) {
-    $args = func_get_args();
-    array_shift($args); // ditch $group
-    array_shift($args); // ditch $clause
-
-    // Expand an array of args if it came in.
-    if (count($args) == 1 && is_array(reset($args))) {
-      $args = current($args);
-    }
-
+  function add_having($group, $field, $value = NULL, $operator = NULL) {
     // Ensure all variants of 0 are actually 0. Thus '', 0 and NULL are all
     // the default group.
     if (empty($group)) {
@@ -797,10 +773,11 @@
     }
 
     // Add the clause and the args.
-    if (is_array($args)) {
-      $this->having[$group]['clauses'][] = $clause;
-      $this->having[$group]['args'] = array_merge($this->having[$group]['args'], array_values($args));
-    }
+    $this->having[$group]['conditions'][] = array(
+      'field' => $field,
+      'value' => $value,
+      'operator' => $operator,
+    );
   }
 
   /**
@@ -837,7 +814,10 @@
       $this->add_field($table, $field, $as);
     }
 
-    $this->orderby[] = "$as " . strtoupper($order);
+    $this->orderby[] = array(
+      'field' => $as,
+      'direction' => strtoupper($order)
+    );
 
     // If grouping, all items in the order by must also be in the
     // group by clause. Check $table to ensure that this is not a
@@ -865,26 +845,17 @@
    * @param $where
    *   'where' or 'having'.
    */
-  function condition_sql($where = 'where') {
-    $clauses = array();
+  function build_condition($where = 'where') {
+    $main_group = $this->group_operator == 'OR' ? db_or() : db_and();
     foreach ($this->$where as $group => $info) {
-      $clause = implode(") " . $info['type'] . " (", $info['clauses']);
-      if (count($info['clauses']) > 1) {
-        $clause = '(' . $clause . ')';
-      }
-      $clauses[] = $clause;
-    }
+      $sub_group = $info['type'] == 'OR' ? db_or() : db_and();
+      foreach ($info['conditions'] as $key => $clause) {
 
-    if ($clauses) {
-      $keyword = drupal_strtoupper($where);
-      if (count($clauses) > 1) {
-        return "$keyword (" . implode(")\n    " . $this->group_operator . ' (', $clauses) . ")\n";
-      }
-      else {
-        return "$keyword " . array_shift($clauses) . "\n";
-      }
+        $sub_group->condition($clause['field'], $clause['value'], $clause['operator']);
+      }
+      $main_group->condition($sub_group);
     }
-    return "";
+    return $main_group;
   }
 
   /**
@@ -923,11 +894,16 @@
       $get_count_optimized = TRUE;
     }
 
+    // Go ahead and build the query.
+    $query = db_select($this->base_table, $this->base_table);
+
     $joins = $fields = $where = $having = $orderby = $groupby = '';
+
     // Add all the tables to the query via joins. We assume all LEFT joins.
     foreach ($this->table_queue as $table) {
       if (is_object($table['join'])) {
-        $joins .= $table['join']->join($table, $this) . "\n";
+        $join_data = $table['join']->join_data($table, $this);
+        $query->leftJoin($join_data['table'], $join_data['alias'], $join_data['condition']);
       }
     }
 
@@ -935,34 +911,29 @@
     $non_aggregates = array();
 
     foreach ($fields_array as $field) {
-      if ($fields) {
-        $fields .= ",\n   ";
-      }
-      $string = '';
-      if (!empty($field['table'])) {
-        $string .= $field['table'] . '.';
-      }
-      $string .= $field['field'];
-      // store for use with non-aggregates below
       $fieldname = (!empty($field['alias']) ? $field['alias'] : $string);
 
       if (!empty($field['distinct'])) {
-        $string = "DISTINCT($string)";
+        throw new Exception("d7cx: Column-level distinct is not supported yet.");
       }
+
       if (!empty($field['count'])) {
-        $string = "COUNT($string)";
-        $has_aggregate = TRUE;
+        // It seems there's no way to abstract the table+column reference
+        // without adding a field, aliasing, and then using the alias.
+        $table = !empty($field['table']) ? $field['table'] : $this->base_table;
+        $alias = $table . '_' . $field . '_viewscount';
+        $query->addField($table, $field['field'], $alias);
+        $query->addExpression('COUNT(' . $alias . ')', $fieldname);
       }
       elseif ($this->distinct && !in_array($fieldname, $this->groupby)) {
-        $string = $GLOBALS['db_type'] == 'pgsql' ? "FIRST($string)" : $string;
+        // d7cx: This code was there, apparently needed for PostgreSQL
+        // $string = db_driver() == 'pgsql' ? "FIRST($string)" : $string;
+        $query->addField(!empty($field['table']) ? $field['table'] : $this->base_table, $field['field'], $fieldname);
       }
       else {
         $non_aggregates[] = $fieldname;
-      }
-      if ($field['alias']) {
-        $string .= " AS $field[alias]";
-      }
-      $fields .= $string;
+        $query->addField(!empty($field['table']) ? $field['table'] : $this->base_table, $field['field'], $fieldname);
+      }
 
       if ($get_count_optimized) {
         // We only want the first field in this case.
@@ -971,25 +942,27 @@
     }
 
     if ($has_aggregate || $this->groupby) {
-      $groupby = "GROUP BY " . implode(', ', array_unique(array_merge($this->groupby, $non_aggregates))) . "\n";
-      if ($this->having) {
-        $having = $this->condition_sql('having');
+      $groupby = array_unique(array_merge($this->groupby, $non_aggregates));
+      foreach ($groupby as $field) {
+        $query->groupBy($field);
+      }
+      if (!empty($this->having)) {
+        $query->having($this->build_condition('having'));
       }
     }
 
     if (!$get_count_optimized) {
       // we only add the groupby if we're not counting.
       if ($this->orderby) {
-        $orderby = "ORDER BY " . implode(', ', $this->orderby) . "\n";
+        foreach ($this->orderby as $order) {
+          $query->orderBy($order['field'], $order['direction']);
+        }
       }
     }
 
-    $where = $this->condition_sql();
-
-    $query = "SELECT $fields\n FROM {" . $this->base_table . "} $this->base_table \n$joins $where $groupby $having $orderby";
-
-    $replace = array('&gt;' => '>', '&lt;' => '<');
-    $query = strtr($query, $replace);
+    if (!empty($this->where)) {
+      $query->condition($this->build_condition('where'));
+    }
 
     return $query;
   }
@@ -1017,41 +990,38 @@
       $function($view, $this);
     }
   }
-  
+
   /**
    * Builds the necessary info to execute the query.
    */
   function build(&$view) {
     $view->build_info['query'] = $this->query();
     $view->build_info['count_query'] = $this->query(TRUE);
-    $view->build_info['query_args'] = $this->get_where_args();
   }
 
   /**
    * Executes the query and fills the associated view object with according
    * values.
-   * 
+   *
    * Values to set: $view->result, $view->total_rows, $view->execute_time,
    * $view->pager['current_page'].
    */
   function execute(&$view) {
     $external = FALSE; // Whether this query will run against an external database.
-    $query = db_rewrite_sql($view->build_info['query'], $view->base_table, $view->base_field, array('view' => &$view));
-    $count_query = db_rewrite_sql($view->build_info['count_query'], $view->base_table, $view->base_field, array('view' => &$view));
-    $args = $view->build_info['query_args'];
-
-    vpr($query);
+    $query = $view->build_info['query'];
+    $count_query = $view->build_info['count_query'];
 
     $items = array();
     if ($query) {
-      $replacements = module_invoke_all('views_query_substitutions', $view);
-      $query = str_replace(array_keys($replacements), $replacements, $query);
-      $count_query = 'SELECT COUNT(*) FROM (' . str_replace(array_keys($replacements), $replacements, $count_query) . ') count_alias';
+      $additional_arguments = module_invoke_all('views_query_substitutions', $view);
+      $count_query = $count_query->countQuery();
 
-      if (is_array($args)) {
-        foreach ($args as $id => $arg) {
-          $args[$id] = str_replace(array_keys($replacements), $replacements, $arg);
-        }
+      // Add additional arguments as a fake condition.
+      // XXX: this doesn't work... because PDO mandates that all bound arguments
+      // are used on the query. TODO: Find a better way to do this.
+      if (!empty($additional_arguments)) {
+        // $query->where('1 = 1', $additional_arguments);
+        // $count_query->where('1 = 1', $additional_arguments);
       }
 
       // Detect an external database.
@@ -1060,14 +1030,14 @@
         $external = TRUE;
       }
 
-      $start = views_microtime();
+      $start = microtime(TRUE);
       if (!empty($view->pager['items_per_page'])) {
         // We no longer use pager_query() here because pager_query() does not
         // support an offset. This is fine as we don't actually need pager
         // query; we've already been doing most of what it does, and we
         // just need to do a little more playing with globals.
         if (!empty($view->pager['use_pager']) || !empty($view->get_total_rows)) {
-          $view->total_rows = db_result(db_query($count_query, $args)) - $view->pager['offset'];
+          $view->total_rows = $count_query->execute()->fetchField() - $view->pager['offset'];
         }
 
         if (!empty($view->pager['use_pager'])) {
@@ -1093,22 +1063,29 @@
         }
 
         $offset = $view->pager['current_page'] * $view->pager['items_per_page'] + $view->pager['offset'];
-        $result = db_query_range($query, $args, $offset, $view->pager['items_per_page']);
-      }
-      else {
-        $result = db_query($query, $args);
-      }
-
-      $view->result = array();
-      while ($item = db_fetch_object($result)) {
-        $view->result[] = $item;
+        $query->range($offset, $view->pager['items_per_page']);
+      }
+
+      try {
+        $result = $query->execute();
+
+        $view->result = array();
+        foreach ($result as $item) {
+          $view->result[] = $item;
+        }
+      }
+      catch (Exception $e) {
+        $view->result = array();
+        debug('Exception: ' . $e->getMessage());
       }
 
       if ($external) {
         db_set_active();
       }
+
+      debug((string) $query);
     }
-    $view->execute_time = views_microtime() - $start;
+    $view->execute_time = microtime(TRUE) - $start;
   }
 
   function add_signature(&$view) {

=== modified file 'plugins/views_plugin_row.inc'
--- plugins/views_plugin_row.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_row.inc	2009-10-18 12:07:40 +0000
@@ -130,7 +130,13 @@
    * of some form, but not always.
    */
   function render($row) {
-    return theme($this->theme_functions(), $this->view, $this->options, $row, $this->field_alias);
+    return theme($this->theme_functions(),
+      array(
+        'view' => $this->view,
+        'options' => $this->options,
+        'row' => $row,
+        'field_alias' => $this->field_alias
+      ));
   }
 }
 

=== modified file 'plugins/views_plugin_style.inc'
--- plugins/views_plugin_style.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_style.inc	2009-10-18 12:09:56 +0000
@@ -142,7 +142,7 @@
    */
   function render() {
     if ($this->uses_row_plugin() && empty($this->row_plugin)) {
-      vpr('views_plugin_style_default: Missing row plugin');
+      debug('views_plugin_style_default: Missing row plugin');
       return;
     }
 
@@ -165,7 +165,13 @@
         $rows = $records;
       }
 
-      $output .= theme($this->theme_functions(), $this->view, $this->options, $rows, $title);
+      $output .= theme($this->theme_functions(),
+        array(
+          'view' => $this->view,
+          'options' => $this->options,
+          'rows' => $rows,
+          'title' => $title)
+        );
     }
     unset($this->view->row_index);
     return $output;

=== modified file 'plugins/views_plugin_style_rss.inc'
--- plugins/views_plugin_style_rss.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_style_rss.inc	2009-10-19 05:17:54 +0000
@@ -30,7 +30,7 @@
         $this->view->feed_icon = '';
       }
 
-      $this->view->feed_icon .= theme('feed_icon', $url, $title);
+      $this->view->feed_icon .= theme('feed_icon', array('url' => $url, 'title' => $title));
       drupal_add_link(array(
         'rel' => 'alternate',
         'type' => 'application/rss+xml',
@@ -77,7 +77,7 @@
 
   function render() {
     if (empty($this->row_plugin)) {
-      vpr('views_plugin_style_default: Missing row plugin');
+      debug('views_plugin_style_default: Missing row plugin');
       return;
     }
     $rows = '';
@@ -99,6 +99,11 @@
       $rows .= $this->row_plugin->render($row);
     }
 
-    return theme($this->theme_functions(), $this->view, $this->options, $rows);
+    return theme($this->theme_functions(),
+      array(
+        'view' => $this->view,
+        'options' => $this->options,
+        'rows' => $rows
+      ));
   }
 }

=== modified file 'plugins/views_plugin_style_summary.inc'
--- plugins/views_plugin_style_summary.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_style_summary.inc	2009-10-19 05:17:54 +0000
@@ -53,6 +53,10 @@
       // @todo: Include separator as an option.
       $rows[] = $row;
     }
+    
+    // TODO: Verify that this works. $this->theme_functions() seems
+    // like it should return an array!
+    // TODO: Convert to D7 theme signature.
     return theme($this->theme_functions(), $this->view, $this->options, $rows);
   }
 }

=== modified file 'plugins/views_plugin_style_table.inc'
--- plugins/views_plugin_style_table.inc	2009-10-17 18:33:18 +0000
+++ plugins/views_plugin_style_table.inc	2009-10-18 20:45:39 +0000
@@ -137,9 +137,7 @@
     $handlers = $this->display->handler->get_handlers('field');
     if (empty($handlers)) {
       $form['error_markup'] = array(
-        '#value' => t('You need at least one field before you can configure your table settings'),
-        '#prefix' => '<div class="error form-item description">',
-        '#suffix' => '</div>',
+        '#markup' => '<div class="error form-item description">' . t('You need at least one field before you can configure your table settings') . '</div>',
       );
       return;
     }
@@ -232,7 +230,7 @@
 
       // markup for the field name
       $form['info'][$field]['name'] = array(
-        '#value' => $field_names[$field],
+        '#markup' => $field_names[$field],
       );
     }
 
@@ -246,9 +244,7 @@
     );
 
     $form['description_markup'] = array(
-      '#prefix' => '<div class="description form-item">',
-      '#suffix' => '</div>',
-      '#value' => t('Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.'),
+      '#markup' => '<div class="description form-item">' . t('Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.') . '</div>',
     );
   }
 }

=== added directory 'tests'
=== added file 'tests/views_query.test'
--- tests/views_query.test	1970-01-01 00:00:00 +0000
+++ tests/views_query.test	2009-10-18 13:41:21 +0000
@@ -0,0 +1,604 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Tests for Views query features.
+ */
+
+/**
+ * Abstract class for views testing
+ */
+abstract class ViewsTestCase extends DrupalWebTestCase {
+  /**
+   * Helper function: verify a result set returned by view.
+   *
+   * The comparison is done on the string representation of the columns of the
+   * column map, taking the order of the rows into account, but not the order
+   * of the columns.
+   *
+   * @param $view
+   *  An executed View.
+   * @param $expected_result
+   *  An expected result set.
+   * @param $column_map
+   *  An associative array mapping the columns of the result set from the view
+   *  (as keys) and the expected result set (as values).
+   */
+  protected function assertIdenticalResultset($view, $expected_result, $column_map, $message = 'Identical result set') {
+    // Convert $view->result to an array of arrays.
+    $result = array();
+    foreach ($view->result as $key => $value) {
+      $row = array();
+      foreach ($column_map as $view_column => $expected_column) {
+        // The comparison will be done on the string representation of the value.
+        $row[$expected_column] = (string) $value->$view_column;
+      }
+      $result[$key] = $row;
+    }
+
+    // Remove the columns we don't need from the expected result.
+    foreach ($expected_result as $key => $value) {
+      $row = array();
+      foreach ($column_map as $expected_column) {
+        // The comparison will be done on the string representation of the value.
+        $row[$expected_column] = (string) $value[$expected_column];
+      }
+      $expected_result[$key] = $row;
+    }
+
+    // Reset the numbering of the arrays.
+    $result = array_values($result);
+    $expected_result = array_values($expected_result);
+
+    // Do the actual comparison.
+    return $this->assertIdentical($result, $expected_result, $message);
+  }
+
+  /**
+   * Helper function: order an array of array based on a column.
+   */
+  protected function orderResultSet($result_set, $column, $reverse = FALSE) {
+    $this->sort_column = $column;
+    $this->sort_order = $reverse ? -1 : 1;
+    usort($result_set, array($this, 'helperCompareFunction'));
+    return $result_set;
+  }
+
+  protected $sort_column = NULL;
+  protected $sort_order = 1;
+
+  /**
+   * Helper comparison function for orderResultSet().
+   */
+  protected function helperCompareFunction($a, $b) {
+    $value1 = $a[$this->sort_column];
+    $value2 = $b[$this->sort_column];
+    if ($value1 == $value2) {
+        return 0;
+    }
+    return $this->sort_order * (($value1 < $value2) ? -1 : 1);
+  }
+}
+
+
+/**
+ * Basic test class for Views query builder tests.
+ */
+class ViewsBasicTest extends ViewsTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => t('Basic query test'),
+      'description' => t('A basic query test for Views.'),
+      'group' => t('Views')
+    );
+  }
+
+  protected function setUp() {
+    parent::setUp('views', 'views_test');
+
+    // Load the test dataset.
+    $query = db_insert('views_test')
+      ->fields(array('name', 'age', 'job'));
+    foreach ($this->testDataSet() as $record) {
+      $query->values($record);
+    }
+    $query->execute();
+  }
+
+  /**
+   * A very simple test dataset.
+   */
+  protected function testDataSet() {
+    return array(
+      array(
+        'name' => 'John',
+        'age' => 25,
+        'job' => 'Singer',
+      ),
+      array(
+        'name' => 'George',
+        'age' => 27,
+        'job' => 'Singer',
+      ),
+      array(
+        'name' => 'Ringo',
+        'age' => 28,
+        'job' => 'Drummer',
+      ),
+      array(
+        'name' => 'Paul',
+        'age' => 26,
+        'job' => 'Songwriter',
+      ),
+      array(
+        'name' => 'Meredith',
+        'age' => 30,
+        'job' => 'Speaker',
+      ),
+    );
+  }
+
+  /**
+   * Build and return a basic view of the views_test table.
+   */
+  protected function getBasicView() {
+    views_include('view');
+
+    // Create the basic view.
+    $view = new view();
+    $view->vid = 'test_view';
+    $view->add_display('default');
+    $view->base_table = 'views_test';
+
+    // Set up the fields we need.
+    $display = $view->new_display('default', 'Defaults', 'default');
+    $display->override_option('fields', array(
+      'id' => array(
+        'id' => 'id',
+        'table' => 'views_test',
+        'field' => 'id',
+        'relationship' => 'none',
+      ),
+      'name' => array(
+        'id' => 'name',
+        'table' => 'views_test',
+        'field' => 'name',
+        'relationship' => 'none',
+      ),
+      'age' => array(
+        'id' => 'age',
+        'table' => 'views_test',
+        'field' => 'age',
+        'relationship' => 'none',
+      ),
+    ));
+
+    // Set up the sort order.
+    $display->override_option('sorts', array(
+      'id' => array(
+        'order' => 'ASC',
+        'id' => 'id',
+        'table' => 'views_test',
+        'field' => 'id',
+        'relationship' => 'none',
+      ),
+    ));
+
+    return $view;
+  }
+
+  /**
+   * Test a trivial result set.
+   */
+  protected function testSimpleResultSet() {
+    $view = $this->getBasicView();
+
+    // Execute the view.
+    $view->execute();
+
+    // Verify the result.
+    $this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
+    $this->assertIdenticalResultset($view, $this->testDataSet(), array(
+      'views_test_name' => 'name',
+      'views_test_age' => 'age',
+    ));
+  }
+
+  /**
+   * Test ordering of the result set.
+   */
+  protected function testSimpleOrdering() {
+    $view = $this->getBasicView();
+
+    // Change the ordering
+    $view->display['default']->handler->override_option('sorts', array(
+      'age' => array(
+        'order' => 'ASC',
+        'id' => 'age',
+        'table' => 'views_test',
+        'field' => 'age',
+        'relationship' => 'none',
+      ),
+    ));
+
+    // Execute the view.
+    $view->execute();
+
+    // Verify the result.
+    $this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
+    $this->assertIdenticalResultset($view, $this->orderResultSet($this->testDataSet(), 'age'), array(
+      'views_test_name' => 'name',
+      'views_test_age' => 'age',
+    ));
+  }
+
+  /**
+   * Test filtering of the result set.
+   */
+  protected function testSimpleFiltering() {
+    $view = $this->getBasicView();
+
+    // Add a filter.
+    $view->display['default']->handler->override_option('filters', array(
+      'age' => array(
+        'operator' => '<',
+        'value' => array(
+          'value' => '28',
+          'min' => '',
+          'max' => '',
+        ),
+        'group' => '0',
+        'exposed' => FALSE,
+        'expose' => array(
+          'operator' => FALSE,
+          'label' => '',
+        ),
+        'id' => 'age',
+        'table' => 'views_test',
+        'field' => 'age',
+        'relationship' => 'none',
+      ),
+    ));
+
+    // Execute the view.
+    $view->execute();
+
+    // Build the expected result.
+    $dataset = array(
+      array(
+        'id' => 1,
+        'name' => 'John',
+        'age' => 25,
+      ),
+      array(
+        'id' => 2,
+        'name' => 'George',
+        'age' => 27,
+      ),
+      array(
+        'id' => 4,
+        'name' => 'Paul',
+        'age' => 26,
+      ),
+    );
+
+    // Verify the result.
+    $this->assertEqual(3, count($view->result), t('The number of returned rows match.'));
+    $this->assertIdenticalResultSet($view, $dataset, array(
+      'views_test_name' => 'name',
+      'views_test_age' => 'age',
+    ));
+  }
+
+  /**
+   * Test simple argument.
+   */
+  protected function testSimpleArgument() {
+    $view = $this->getBasicView();
+
+    // Add a argument.
+    $view->display['default']->handler->override_option('arguments', array(
+      'age' => array(
+        'default_action' => 'ignore',
+        'style_plugin' => 'default_summary',
+        'style_options' => array(),
+        'wildcard' => 'all',
+        'wildcard_substitution' => 'All',
+        'title' => '',
+        'breadcrumb' => '',
+        'default_argument_type' => 'fixed',
+        'default_argument' => '',
+        'validate_type' => 'none',
+        'validate_fail' => 'not found',
+        'break_phrase' => 0,
+        'not' => 0,
+        'id' => 'age',
+        'table' => 'views_test',
+        'field' => 'age',
+        'validate_user_argument_type' => 'uid',
+        'validate_user_roles' => array(
+          '2' => 0,
+        ),
+        'relationship' => 'none',
+        'default_options_div_prefix' => '',
+        'default_argument_user' => 0,
+        'default_argument_fixed' => '',
+        'default_argument_php' => '',
+        'validate_argument_node_type' => array(
+          'page' => 0,
+          'story' => 0,
+        ),
+        'validate_argument_node_access' => 0,
+        'validate_argument_nid_type' => 'nid',
+        'validate_argument_vocabulary' => array(),
+        'validate_argument_type' => 'tid',
+        'validate_argument_transform' => 0,
+        'validate_user_restrict_roles' => 0,
+        'validate_argument_php' => '',
+      )
+    ));
+
+    $saved_view = clone $view;
+
+    // Execute with a view
+    $view->set_arguments(array(27));
+    $view->execute();
+
+    // Build the expected result.
+    $dataset = array(
+      array(
+        'id' => 2,
+        'name' => 'George',
+        'age' => 27,
+      ),
+    );
+
+    // Verify the result.
+    $this->assertEqual(1, count($view->result), t('The number of returned rows match.'));
+    $this->assertIdenticalResultSet($view, $dataset, array(
+      'views_test_name' => 'name',
+      'views_test_age' => 'age',
+    ));
+
+    // Test "show all" if no argument is present.
+    $view = $saved_view;
+    $view->execute();
+
+    // Build the expected result.
+    $dataset = $this->testDataSet();
+
+    $this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
+    $this->assertIdenticalResultSet($view, $dataset, array(
+      'views_test_name' => 'name',
+      'views_test_age' => 'age',
+    ));
+  }
+
+  /**
+   * Test some SetHelpers of class view.
+   *
+   * @TODO Test exposed_filters.
+   *       Test set_use_pager.
+   *       Find a better name for this function.
+   */
+  protected function testSetHelpers() {
+    $view = $this->getBasicView();
+    $saved_view = clone $view;
+
+    // Test Items per page.
+    $view->set_items_per_page(2);
+
+    // Execute the view.
+    $view->execute();
+
+    // Build the expected result.
+    $dataset = array(
+      array(
+        'name' => 'John',
+        'age' => 25,
+        'job' => 'Singer',
+      ),
+      array(
+        'name' => 'George',
+        'age' => 27,
+        'job' => 'Singer',
+      ),
+    );
+
+    $this->assertEqual(2, count($view->result), t('The number of returned rows match.'));
+    $this->assertIdenticalResultSet($view, $dataset, array(
+      'views_test_name' => 'name',
+      'views_test_age' => 'age',
+    ));
+
+    // Test Offset.
+    $view = $saved_view;
+
+    $view->set_offset(1);
+
+    // Execute the view.
+    $view->execute();
+
+    // Build the expected result.
+    $dataset = array(
+      array(
+        'name' => 'George',
+        'age' => 27,
+        'job' => 'Singer',
+      ),
+      array(
+        'name' => 'Ringo',
+        'age' => 28,
+        'job' => 'Drummer',
+      ),
+      array(
+        'name' => 'Paul',
+        'age' => 26,
+        'job' => 'Songwriter',
+      ),
+      array(
+        'name' => 'Meredith',
+        'age' => 30,
+        'job' => 'Speaker',
+      ),
+    );
+
+    $this->assertEqual(4, count($view->result), t('The number of returned rows match.'));
+    $this->assertIdenticalResultSet($view, $dataset, array(
+      'views_test_name' => 'name',
+      'views_test_age' => 'age',
+    ));
+  }
+}
+
+/**
+ * Basic test for pluggable caching.
+ */
+class ViewsCacheTest extends ViewsTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => t('Pluggable caching test'),
+      'description' => t('Tests pluggable caching for views.'),
+      'group' => t('Views')
+    );
+  }
+
+  protected function setUp() {
+    parent::setUp('views', 'views_test');
+
+    // Load the test dataset.
+    $query = db_insert('views_test')
+      ->fields(array('name', 'age', 'job'));
+    foreach ($this->testDataSet() as $record) {
+      $query->values($record);
+    }
+    $query->execute();
+  }
+
+  /**
+   * A very simple test dataset.
+   */
+  protected function testDataSet() {
+    return array(
+      array(
+        'name' => 'John',
+        'age' => 25,
+        'job' => 'Singer',
+      ),
+      array(
+        'name' => 'George',
+        'age' => 27,
+        'job' => 'Singer',
+      ),
+      array(
+        'name' => 'Ringo',
+        'age' => 28,
+        'job' => 'Drummer',
+      ),
+      array(
+        'name' => 'Paul',
+        'age' => 26,
+        'job' => 'Songwriter',
+      ),
+      array(
+        'name' => 'Meredith',
+        'age' => 30,
+        'job' => 'Speaker',
+      ),
+    );
+  }
+
+
+  /**
+   * Build and return a basic view of the views_test table.
+   */
+  protected function getBasicView() {
+    views_include('view');
+
+    // Create the basic view.
+    $view = new view();
+    $view->vid = 'test_view';
+    $view->add_display('default');
+    $view->base_table = 'views_test';
+
+    // Set up the fields we need.
+    $display = $view->new_display('default', 'Defaults', 'default');
+    $display->override_option('fields', array(
+      'id' => array(
+        'id' => 'id',
+        'table' => 'views_test',
+        'field' => 'id',
+        'relationship' => 'none',
+      ),
+      'name' => array(
+        'id' => 'name',
+        'table' => 'views_test',
+        'field' => 'name',
+        'relationship' => 'none',
+      ),
+      'age' => array(
+        'id' => 'age',
+        'table' => 'views_test',
+        'field' => 'age',
+        'relationship' => 'none',
+      ),
+    ));
+
+    // Set up the sort order.
+    $display->override_option('sorts', array(
+      'id' => array(
+        'order' => 'ASC',
+        'id' => 'id',
+        'table' => 'views_test',
+        'field' => 'id',
+        'relationship' => 'none',
+      ),
+    ));
+
+    return $view;
+  }
+
+  /**
+   * Tests time based caching.
+   */
+  function testTimeCaching() {
+    // Create a basic result which just 2 results.
+    $view = $this->getBasicView();
+    $view->set_display();
+    $view->display_handler->override_option('cache', array(
+      'type' => 'time',
+      'results_lifespan' => '3600',
+      'output_lifespan' => '3600',
+    ));
+
+    $view->execute();
+    // Verify the result.
+    $this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
+
+    // Add another man to the beatles.
+    $query = db_insert('views_test')
+      ->fields(array('name', 'age', 'job'));
+    $record = array(
+      'name' => 'Rod Davis',
+      'age' => 29,
+      'job' => 'Banjo',
+    );
+    $query->values($record);
+    $query->execute();
+
+    // The Result should be the same as before, because of the caching.
+    $view = $this->getBasicView();
+    $view->set_display();
+    $view->display_handler->override_option('cache', array(
+      'type' => 'time',
+      'results_lifespan' => '3600',
+      'output_lifespan' => '3600',
+    ));
+
+    $view->execute();
+    // Verify the result.
+    $this->assertEqual(5, count($view->result), t('The number of returned rows match.'));
+  }
+}
+

=== added file 'tests/views_test.info'
--- tests/views_test.info	1970-01-01 00:00:00 +0000
+++ tests/views_test.info	2009-10-17 23:59:13 +0000
@@ -0,0 +1,9 @@
+; $Id$
+name = Views Test
+description = Test module for Views.
+package = Views
+core = 7.x
+dependencies[] = views
+hidden = TRUE
+files[] = views_test.module
+files[] = views_test.install

=== added file 'tests/views_test.install'
--- tests/views_test.install	1970-01-01 00:00:00 +0000
+++ tests/views_test.install	2009-10-17 21:47:53 +0000
@@ -0,0 +1,52 @@
+<?php
+// $Id$
+
+function views_test_install() {
+  drupal_install_schema('views_test');
+}
+
+function views_test_uninstall() {
+  drupal_uninstall_schema('views_test');
+}
+
+function views_test_schema() {
+  $schema['views_test'] = array(
+    'description' => 'Basic test table for Views tests.',
+    'fields' => array(
+      'id' => array(
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+      ),
+      'name' => array(
+        'description' => "A person's name",
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => '',
+      ),
+      'age' => array(
+        'description' => "The person's age",
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'default' => 0),
+      'job' => array(
+        'description' => "The person's job",
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => 'Undefined',
+      ),
+    ),
+    'primary key' => array('id'),
+    'unique keys' => array(
+      'name' => array('name')
+    ),
+    'indexes' => array(
+      'ages' => array('age'),
+    ),
+  );
+
+  return $schema;
+}

=== added file 'tests/views_test.module'
--- tests/views_test.module	1970-01-01 00:00:00 +0000
+++ tests/views_test.module	2009-10-18 07:37:32 +0000
@@ -0,0 +1,88 @@
+<?php
+// $Id$
+
+/**
+ * Implements hook_views_data()
+ */
+function views_test_views_data() {
+  // Declaration of the base table.
+  $data['views_test']['table'] = array(
+    'group' => t('Views test'),
+    'base' => array(
+      'field' => 'id',
+      'title' => t('Views test'),
+      'help' => t('Users who have created accounts on your site.'),
+    ),
+  );
+
+  // Declaration of fields.
+  $data['views_test']['id'] = array(
+    'title' => t('ID'),
+    'help' => t('The test data ID'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_numeric',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+  $data['views_test']['name'] = array(
+    'title' => t('Name'),
+    'help' => t('The name of the person'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE,
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+  $data['views_test']['age'] = array(
+    'title' => t('Age'),
+    'help' => t('The age of the person'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_numeric',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+  $data['views_test']['job'] = array(
+    'title' => t('Job'),
+    'help' => t('The job of the person'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE,
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+  return $data;
+}

=== modified file 'theme/theme.inc'
--- theme/theme.inc	2009-10-17 18:33:18 +0000
+++ theme/theme.inc	2009-10-19 05:17:54 +0000
@@ -82,7 +82,12 @@
   if (!empty($view->pager['use_pager'])) {
     $pager_type = ($view->pager['use_pager'] === 'mini' ? 'views_mini_pager' : 'pager');
     $pager_theme = views_theme_functions($pager_type, $view, $view->display_handler->display);
-    $vars['pager']    = theme($pager_theme, $exposed_input, $view->pager['items_per_page'], $view->pager['element']);
+    $vars['pager']    = theme($pager_theme,
+      array(
+        'tags' => $exposed_input,
+        'element' => $view->pager['element'],
+      )
+    );
   }
 
   // if administrator, add some links. These used to be tabs, but this is better.
@@ -91,24 +96,28 @@
       array(
         'title' => t('Edit'),
         'alt' => t("Edit this view"),
-        'href' => "admin/build/views/edit/$view->name",
+        'href' => "admin/structure/views/edit/$view->name",
         'fragment' => 'views-tab-' . $view->current_display,
         'query' => drupal_get_destination(),
       ),
       array(
         'title' => t('Export'),
         'alt' => t("Export this view"),
-        'href' => "admin/build/views/export/$view->name",
+        'href' => "admin/structure/views/export/$view->name",
       ),
       array(
         'title' => t('Clone'),
         'alt' => t("Create a copy of this view"),
-        'href' => "admin/build/views/clone/$view->name",
+        'href' => "admin/structure/views/clone/$view->name",
       ),
     );
 
     drupal_alter('views_admin_links', $vars['admin_links_raw'], $view);
-    $vars['admin_links'] = theme('links', $vars['admin_links_raw']);
+    $vars['admin_links'] = theme('links',
+      array(
+        'links' => $vars['admin_links_raw'],
+      )
+    );
   }
   else {
     $vars['admin_links'] = '';
@@ -205,7 +214,10 @@
  * $field->field_alias says what the raw value in $row will be. Reach it like
  * this: @code { $row->{$field->field_alias} @endcode
  */
-function theme_views_view_field($view, $field, $row) {
+function theme_views_view_field($vars) {
+  $view = $vars['view'];
+  $field = $vars['field'];
+  $row = $vars['row'];
   return $field->advanced_render($row);
 }
 
@@ -329,10 +341,10 @@
 
         $title = t('sort by @s', array('@s' => $label));
         if ($active == $field) {
-          $label .= theme('tablesort_indicator', $initial);
+          $label .= theme('tablesort_indicator', array('style' => $initial));
         }
         $link_options = array(
-          'html' => true,
+          'html' => TRUE,
           'attributes' => array('title' => $title),
           'query' => 'order=' . urlencode($field) . '&sort=' . $initial . $query,
         );
@@ -379,10 +391,10 @@
   $vars['row_classes'][0][] = 'views-row-first';
   $vars['row_classes'][count($vars['row_classes']) - 1][] = 'views-row-last';
 
-  $vars['class'] = 'views-table';
+  $vars['class'] = array('views-table');
   if (!empty($options['sticky'])) {
     drupal_add_js('misc/tableheader.js');
-    $vars['class'] .= " sticky-enabled";
+    $vars['class'][] = "sticky-enabled";
   }
 }
 
@@ -433,7 +445,7 @@
         $row = 0;
         $col++;
       }
-      else if ($remainders && $row == $num_rows + 1) {
+      elseif ($remainders && $row == $num_rows + 1) {
         $row = 0;
         $col++;
         $remainders--;
@@ -453,8 +465,8 @@
  * Display the simple view of rows one after another
  */
 function template_preprocess_views_view_unformatted(&$vars) {
-  $view     = $vars['view'];
-  $rows     = $vars['rows'];
+  $view = $vars['view'];
+  $rows = $vars['rows'];
 
   $vars['classes'] = array();
   // Set up striping values.
@@ -538,7 +550,7 @@
   $vars['items'] = $items;
   $vars['channel_elements'] = format_xml_elements($style->channel_elements);
 
-  drupal_set_header('Content-Type: application/rss+xml; charset=utf-8');
+  drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8');
 }
 
 /**
@@ -621,32 +633,55 @@
   // End of marker calculations.
 
 
-  $li_previous = theme('pager_previous', (isset($tags[1]) ? $tags[1] : t('‹‹')), $limit, $element, 1, $parameters);
+  $li_previous = theme('pager_previous',
+    array(
+      'text' => (isset($tags[1]) ? $tags[1] : t('‹‹')),
+      'limit' => $limit,
+      'element' => $element,
+      'interval' => 1,
+      'parameters' => $parameters,
+    )
+  );
   if (empty($li_previous)) {
     $li_previous = "&nbsp;";
   }
 
-  $li_next = theme('pager_next', (isset($tags[3]) ? $tags[3] : t('››')), $limit, $element, 1, $parameters);
+  $li_next = theme('pager_next',
+    array(
+      'text' => (isset($tags[3]) ? $tags[3] : t('››')),
+      'limit' => $limit,
+      'element' => $element,
+      'interval' => 1,
+      'parameters' => $parameters,
+    )
+  );
   if (empty($li_next)) {
     $li_next = "&nbsp;";
   }
 
   if ($pager_total[$element] > 1) {
     $items[] = array(
-      'class' => 'pager-previous',
+      'class' => array('pager-previous'),
       'data' => $li_previous,
     );
 
     $items[] = array(
-      'class' => 'pager-current',
+      'class' => array('pager-current'),
       'data' => t('@current of @max', array('@current' => $pager_current, '@max' => $pager_max)),
     );
 
     $items[] = array(
-      'class' => 'pager-next',
+      'class' => array('pager-next'),
       'data' => $li_next,
     );
-    return theme('item_list', $items, NULL, 'ul', array('class' => 'pager'));
+    return theme('item_list',
+      array(
+        'items' => $items,
+        'title' => NULL,
+        'type' => 'ul',
+        'attributes' => array('class' => array('pager')),
+      )
+    );
   }
 }
 

=== modified file 'theme/views-exposed-form.tpl.php'
--- theme/views-exposed-form.tpl.php	2009-10-17 18:33:18 +0000
+++ theme/views-exposed-form.tpl.php	2009-10-18 19:13:47 +0000
@@ -23,7 +23,7 @@
   ?>
 <?php endif; ?>
 <div class="views-exposed-form">
-  <div class="views-exposed-widgets clear-block">
+  <div class="views-exposed-widgets clearfix">
     <?php foreach($widgets as $id => $widget): ?>
       <div class="views-exposed-widget">
         <?php if (!empty($widget->label)): ?>

=== modified file 'theme/views-ui-edit-tab.tpl.php'
--- theme/views-ui-edit-tab.tpl.php	2009-10-17 18:33:18 +0000
+++ theme/views-ui-edit-tab.tpl.php	2009-10-18 19:13:47 +0000
@@ -5,7 +5,7 @@
  * Template for the primary view editing window.
  */
 ?>
-<div class="clear-block views-display views-display-<?php print $display->id; if (!empty($display->deleted)) { print ' views-display-deleted'; }; ?>">
+<div class="clearfix views-display views-display-<?php print $display->id; if (!empty($display->deleted)) { print ' views-display-deleted'; }; ?>">
   <?php // top section ?>
   <?php if ($remove): ?>
     <div class="remove-display"><?php print $remove ?></div>

=== modified file 'theme/views-ui-edit-view.tpl.php'
--- theme/views-ui-edit-view.tpl.php	2009-10-17 18:33:18 +0000
+++ theme/views-ui-edit-view.tpl.php	2009-10-18 19:13:47 +0000
@@ -11,7 +11,7 @@
        <?php print t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to <a href="!break">break this lock</a>.', array('!user' => $locked, '!age' => $lock_age, '!break' => $break)); ?>
     </div>
   <?php endif; ?>
-  <div class="views-basic-info clear-block<?php if (!empty($view->changed)) { print " changed"; }?>">
+  <div class="views-basic-info clearfix<?php if (!empty($view->changed)) { print " changed"; }?>">
     <?php if (!is_numeric($view->vid)): ?>
       <div class="view-changed view-new"><?php print t('New view'); ?></div>
     <?php else: ?>

=== modified file 'translations/eo.po'
--- translations/eo.po	2009-10-17 18:33:18 +0000
+++ translations/eo.po	2009-10-18 07:37:32 +0000
@@ -1,5 +1,5 @@
 # $Id: views.pot,v 1.5 2008/07/06 11:14:01 hass Exp $
-# 
+#
 # Esperanto translation of Drupal (general)
 # Copyright 2008 Chuck Smith <chuck@chucksmith.de>
 # Generated from files:
@@ -44,7 +44,7 @@
 # views-ui-edit-tab.tpl.php,v 1.10 2008/05/14 00:30:25 merlinofchaos
 # views-ui-edit-view.tpl.php,v 1.8 2008/05/14 00:52:10 merlinofchaos
 # views-ui-list-views.tpl.php,v 1.5 2008/05/08 05:29:30 merlinofchaos
-# 
+#
 #, fuzzy
 msgid ""
 ""

=== modified file 'views.info'
--- views.info	2009-10-17 18:33:18 +0000
+++ views.info	2009-10-17 23:59:13 +0000
@@ -2,4 +2,227 @@
 name = Views
 description = Create customized lists and queries from your database.
 package = Views
-core = 6.x
+core = 7.x
+php = 5.2
+files[] = views.module
+; Handlers
+files[] = handlers/views_handler_argument.inc
+files[] = handlers/views_handler_argument_date.inc
+files[] = handlers/views_handler_argument_formula.inc
+files[] = handlers/views_handler_argument_many_to_one.inc
+files[] = handlers/views_handler_argument_null.inc
+files[] = handlers/views_handler_argument_numeric.inc
+files[] = handlers/views_handler_argument_string.inc
+files[] = handlers/views_handler_field.inc
+files[] = handlers/views_handler_field_boolean.inc
+files[] = handlers/views_handler_field_custom.inc
+files[] = handlers/views_handler_field_date.inc
+files[] = handlers/views_handler_field_markup.inc
+files[] = handlers/views_handler_field_numeric.inc
+files[] = handlers/views_handler_field_prerender_list.inc
+files[] = handlers/views_handler_field_url.inc
+files[] = handlers/views_handler_filter.inc
+files[] = handlers/views_handler_filter_boolean_operator.inc
+files[] = handlers/views_handler_filter_boolean_operator_string.inc
+files[] = handlers/views_handler_filter_date.inc
+files[] = handlers/views_handler_filter_equality.inc
+files[] = handlers/views_handler_filter_in_operator.inc
+files[] = handlers/views_handler_filter_many_to_one.inc
+files[] = handlers/views_handler_filter_numeric.inc
+files[] = handlers/views_handler_filter_string.inc
+files[] = handlers/views_handler_relationship.inc
+files[] = handlers/views_handler_sort.inc
+files[] = handlers/views_handler_sort_date.inc
+files[] = handlers/views_handler_sort_formula.inc
+files[] = handlers/views_handler_sort_menu_hierarchy.inc
+files[] = handlers/views_handler_sort_random.inc
+; Includes
+files[] = includes/admin.inc
+files[] = includes/ajax.inc
+files[] = includes/analyze.inc
+files[] = includes/base.inc
+files[] = includes/cache.inc
+files[] = includes/convert.inc
+files[] = includes/handlers.inc
+files[] = includes/plugins.inc
+files[] = includes/tabs.inc
+files[] = includes/view.inc
+; Modules
+files[] = modules/aggregator.views.inc
+files[] = modules/aggregator/views_handler_argument_aggregator_fid.inc
+files[] = modules/aggregator/views_handler_field_aggregator_title_link.inc
+files[] = modules/aggregator/views_plugin_row_aggregator_rss.inc
+files[] = modules/book.views.inc
+files[] = modules/comment.views.inc
+files[] = modules/comment.views_convert.inc
+files[] = modules/comment.views_default.inc
+files[] = modules/comment/views_handler_argument_comment_user_uid.inc
+files[] = modules/comment/views_handler_field_comment.inc
+files[] = modules/comment/views_handler_field_comment_depth.inc
+files[] = modules/comment/views_handler_field_comment_link.inc
+files[] = modules/comment/views_handler_field_comment_link_delete.inc
+files[] = modules/comment/views_handler_field_comment_link_edit.inc
+files[] = modules/comment/views_handler_field_comment_link_reply.inc
+files[] = modules/comment/views_handler_field_comment_username.inc
+files[] = modules/comment/views_handler_field_ncs_last_comment_name.inc
+files[] = modules/comment/views_handler_field_ncs_last_updated.inc
+files[] = modules/comment/views_handler_field_node_comment.inc
+files[] = modules/comment/views_handler_field_node_new_comments.inc
+files[] = modules/comment/views_handler_filter_comment_user_uid.inc
+files[] = modules/comment/views_handler_filter_ncs_last_updated.inc
+files[] = modules/comment/views_handler_filter_node_comment.inc
+files[] = modules/comment/views_handler_sort_comment_thread.inc
+files[] = modules/comment/views_handler_sort_ncs_last_comment_name.inc
+files[] = modules/comment/views_handler_sort_ncs_last_updated.inc
+files[] = modules/comment/views_plugin_row_comment_rss.inc
+files[] = modules/comment/views_plugin_row_comment_view.inc
+files[] = modules/locale.views.inc
+files[] = modules/locale/views_handler_argument_locale_group.inc
+files[] = modules/locale/views_handler_argument_locale_language.inc
+files[] = modules/locale/views_handler_field_locale_group.inc
+files[] = modules/locale/views_handler_field_locale_language.inc
+files[] = modules/locale/views_handler_field_locale_link_edit.inc
+files[] = modules/locale/views_handler_filter_locale_group.inc
+files[] = modules/locale/views_handler_filter_locale_language.inc
+files[] = modules/locale/views_handler_filter_locale_version.inc
+files[] = modules/node.views.inc
+files[] = modules/node.views_convert.inc
+files[] = modules/node.views_default.inc
+files[] = modules/node/views_handler_argument_dates_various.inc
+files[] = modules/node/views_handler_argument_node_language.inc
+files[] = modules/node/views_handler_argument_node_nid.inc
+files[] = modules/node/views_handler_argument_node_type.inc
+files[] = modules/node/views_handler_argument_node_vid.inc
+files[] = modules/node/views_handler_field_history_user_timestamp.inc
+files[] = modules/node/views_handler_field_node.inc
+files[] = modules/node/views_handler_field_node_link.inc
+files[] = modules/node/views_handler_field_node_link_delete.inc
+files[] = modules/node/views_handler_field_node_link_edit.inc
+files[] = modules/node/views_handler_field_node_revision_link_delete.inc
+files[] = modules/node/views_handler_field_node_revision_link_revert.inc
+files[] = modules/node/views_handler_field_node_type.inc
+files[] = modules/node/views_handler_filter_history_user_timestamp.inc
+files[] = modules/node/views_handler_filter_node_status.inc
+files[] = modules/node/views_handler_filter_node_type.inc
+files[] = modules/node/views_plugin_argument_default_node.inc
+files[] = modules/node/views_plugin_argument_validate_node.inc
+files[] = modules/node/views_plugin_row_node_rss.inc
+files[] = modules/node/views_plugin_row_node_view.inc
+files[] = modules/poll.views.inc
+files[] = modules/profile.views.inc
+files[] = modules/profile/views_handler_field_profile_date.inc
+files[] = modules/profile/views_handler_field_profile_list.inc
+files[] = modules/profile/views_handler_filter_profile_selection.inc
+files[] = modules/search.views.inc
+files[] = modules/search.views_default.inc
+files[] = modules/search/views_handler_field_search_score.inc
+files[] = modules/search/views_handler_filter_search.inc
+files[] = modules/search/views_handler_sort_search_score.inc
+files[] = modules/search/views_plugin_row_search_view.inc
+files[] = modules/statistics.views.inc
+files[] = modules/statistics.views_default.inc
+files[] = modules/statistics/views_handler_field_accesslog_path.inc
+files[] = modules/system.views.inc
+files[] = modules/system/views_handler_argument_file_fid.inc
+files[] = modules/system/views_handler_field_file.inc
+files[] = modules/system/views_handler_field_file_status.inc
+files[] = modules/system/views_handler_filter_file_status.inc
+files[] = modules/taxonomy.views.inc
+files[] = modules/taxonomy.views_convert.inc
+files[] = modules/taxonomy.views_default.inc
+files[] = modules/taxonomy/views_handler_argument_taxonomy.inc
+files[] = modules/taxonomy/views_handler_argument_term_node_tid.inc
+files[] = modules/taxonomy/views_handler_argument_term_node_tid_depth.inc
+files[] = modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc
+files[] = modules/taxonomy/views_handler_argument_vocabulary_vid.inc
+files[] = modules/taxonomy/views_handler_field_taxonomy.inc
+files[] = modules/taxonomy/views_handler_field_term_node_tid.inc
+files[] = modules/taxonomy/views_handler_filter_term_node_tid.inc
+files[] = modules/taxonomy/views_handler_filter_vocabulary_vid.inc
+files[] = modules/taxonomy/views_plugin_argument_validate_taxonomy_term.inc
+files[] = modules/translation.views.inc
+;files[] = modules/translation/views_handler_argument_node_language.inc
+files[] = modules/translation/views_handler_argument_node_tnid.inc
+files[] = modules/translation/views_handler_field_node_language.inc
+files[] = modules/translation/views_handler_field_node_translation_link.inc
+files[] = modules/translation/views_handler_filter_node_language.inc
+files[] = modules/translation/views_handler_filter_node_tnid.inc
+files[] = modules/translation/views_handler_filter_node_tnid_child.inc
+files[] = modules/translation/views_handler_relationship_translation.inc
+files[] = modules/upload.views.inc
+files[] = modules/upload.views_convert.inc
+files[] = modules/upload/views_handler_field_upload_description.inc
+files[] = modules/upload/views_handler_field_upload_fid.inc
+files[] = modules/upload/views_handler_filter_upload_fid.inc
+files[] = modules/user.views.inc
+files[] = modules/user/views_handler_argument_user_uid.inc
+files[] = modules/user/views_handler_argument_users_roles_rid.inc
+files[] = modules/user/views_handler_field_user.inc
+files[] = modules/user/views_handler_field_user_link.inc
+files[] = modules/user/views_handler_field_user_link_delete.inc
+files[] = modules/user/views_handler_field_user_link_edit.inc
+files[] = modules/user/views_handler_field_user_mail.inc
+files[] = modules/user/views_handler_field_user_name.inc
+files[] = modules/user/views_handler_field_user_picture.inc
+files[] = modules/user/views_handler_field_user_roles.inc
+files[] = modules/user/views_handler_filter_user_current.inc
+files[] = modules/user/views_handler_filter_user_name.inc
+files[] = modules/user/views_handler_filter_user_roles.inc
+files[] = modules/user/views_plugin_argument_default_current_user.inc
+files[] = modules/user/views_plugin_argument_default_user.inc
+files[] = modules/user/views_plugin_argument_validate_user.inc
+files[] = modules/views.views.inc
+; Plugins
+files[] = plugins/views_plugin_access.inc
+files[] = plugins/views_plugin_access_none.inc
+files[] = plugins/views_plugin_access_perm.inc
+files[] = plugins/views_plugin_access_role.inc
+files[] = plugins/views_plugin_argument_default.inc
+files[] = plugins/views_plugin_argument_default_php.inc
+files[] = plugins/views_plugin_argument_validate.inc
+files[] = plugins/views_plugin_argument_validate_numeric.inc
+files[] = plugins/views_plugin_argument_validate_php.inc
+files[] = plugins/views_plugin_cache.inc
+files[] = plugins/views_plugin_cache_none.inc
+files[] = plugins/views_plugin_cache_time.inc
+files[] = plugins/views_plugin_display.inc
+files[] = plugins/views_plugin_display_attachment.inc
+files[] = plugins/views_plugin_display_block.inc
+files[] = plugins/views_plugin_display_default.inc
+files[] = plugins/views_plugin_display_feed.inc
+files[] = plugins/views_plugin_display_page.inc
+files[] = plugins/views_plugin_query.inc
+files[] = plugins/views_plugin_query_default.inc
+files[] = plugins/views_plugin_row.inc
+files[] = plugins/views_plugin_row_fields.inc
+files[] = plugins/views_plugin_style.inc
+files[] = plugins/views_plugin_style_default.inc
+files[] = plugins/views_plugin_style_grid.inc
+files[] = plugins/views_plugin_style_list.inc
+files[] = plugins/views_plugin_style_rss.inc
+files[] = plugins/views_plugin_style_summary.inc
+files[] = plugins/views_plugin_style_summary_unformatted.inc
+files[] = plugins/views_plugin_style_table.inc
+; Theme
+files[] = theme/theme.inc
+files[] = theme/views-exposed-form.tpl.php
+files[] = theme/views-more.tpl.php
+files[] = theme/views-ui-edit-item.tpl.php
+files[] = theme/views-ui-edit-tab.tpl.php
+files[] = theme/views-ui-edit-view.tpl.php
+files[] = theme/views-ui-list-views.tpl.php
+files[] = theme/views-view-field.tpl.php
+files[] = theme/views-view-fields.tpl.php
+files[] = theme/views-view-grid.tpl.php
+files[] = theme/views-view-list.tpl.php
+files[] = theme/views-view-row-comment.tpl.php
+files[] = theme/views-view-row-node.tpl.php
+files[] = theme/views-view-row-rss.tpl.php
+files[] = theme/views-view-rss.tpl.php
+files[] = theme/views-view-summary-unformatted.tpl.php
+files[] = theme/views-view-summary.tpl.php
+files[] = theme/views-view-table.tpl.php
+files[] = theme/views-view-unformatted.tpl.php
+files[] = theme/views-view.tpl.php
+; Tests
+files[] = tests/views_query.test

=== modified file 'views.install'
--- views.install	2009-10-17 18:33:18 +0000
+++ views.install	2009-10-18 07:50:33 +0000
@@ -6,7 +6,7 @@
  */
 
 function views_install() {
-  if ($GLOBALS['db_type'] == 'pgsql') {
+  if (db_driver() == 'pgsql') {
     db_query('CREATE OR REPLACE FUNCTION first(anyelement, anyelement) RETURNS anyelement AS \'SELECT COALESCE($1, $2);\' LANGUAGE \'sql\';');
     db_query("DROP AGGREGATE IF EXISTS first(anyelement)");
     db_query("CREATE AGGREGATE first(sfunc = first, basetype = anyelement, stype = anyelement);");
@@ -20,7 +20,7 @@
 }
 
 /**
- * Implementation of hook_schemea
+ * Implements hook_schemea
  */
 function views_schema() {
   // Currently, schema 1 is the only schema we have. As we make updates,
@@ -131,7 +131,7 @@
   );
 
   $schema['cache_views'] = drupal_get_schema_unprocessed('system', 'cache');
-  
+
   $schema['cache_views_data'] = drupal_get_schema_unprocessed('system', 'cache');
   $schema['cache_views_data']['description'] = 'Cache table for views to store pre-rendered queries, results, and display output.';
   $schema['cache_views_data']['fields']['serialized']['default'] = 1;
@@ -208,7 +208,7 @@
 function views_update_6001() {
   $ret = array();
   $result = db_query("SELECT * FROM {blocks} WHERE module = 'views' AND delta LIKE '\$exp%'");
-  while ($block = db_fetch_object($result)) {
+  foreach ($result as $block) {
     $new = strtr($block->delta, '$', '-');
     $ret[] = update_sql("UPDATE {blocks} SET delta = '" . db_escape_string($new) . "' WHERE module = 'views' AND delta = '" . db_escape_string($block->delta) . "'");
   }
@@ -256,7 +256,7 @@
  */
 function views_update_6005() {
   $ret = array();
-  
+
   $new_field = array(
     'type' => 'varchar',
     'length' => '64',
@@ -273,7 +273,7 @@
  */
 function views_update_6006() {
   $ret = array();
-  
+
   $table = drupal_get_schema_unprocessed('system', 'cache');
   $table['description'] = 'Cache table for views to store pre-rendered queries, results, and display output.';
   $table['fields']['serialized']['default'] = 1;
@@ -289,7 +289,7 @@
  */
 function views_update_6007() {
   $ret = array();
-  if ($GLOBALS['db_type'] == 'pgsql') {
+  if (db_driver() == 'pgsql') {
     $ret[] = update_sql('CREATE OR REPLACE FUNCTION first(anyelement, anyelement) RETURNS anyelement AS \'SELECT COALESCE($1, $2);\' LANGUAGE \'sql\';');
     $ret[] = update_sql("DROP AGGREGATE IF EXISTS first(anyelement)");
     $ret[] = update_sql("CREATE AGGREGATE first(sfunc = first, basetype = anyelement, stype = anyelement);");

=== modified file 'views.module'
--- views.module	2009-10-17 18:33:18 +0000
+++ views.module	2009-10-19 05:17:54 +0000
@@ -17,16 +17,16 @@
 }
 
 /**
- * Implementation of hook_theme(). Register views theming functions.
+ * Implement hook_theme(). Register views theming functions.
  */
 function views_theme() {
   $path = drupal_get_path('module', 'views');
-  require_once "./$path/theme/theme.inc";
+  include_once $path . '/theme/theme.inc';
 
   // Some quasi clever array merging here.
   $base = array(
     'file' => 'theme.inc',
-    'path' => "$path/theme",
+    'path' => $path . '/theme',
   );
 
   // Our extra version of pager from pager.inc
@@ -60,7 +60,7 @@
           'arguments' => $arguments[$type],
         );
 
-        $include = './' . $def['theme path'] . '/' . $def['theme file'];
+        $include = DRUPAL_ROOT . '/' . $def['theme path'] . '/' . $def['theme file'];
         if (file_exists($include)) {
           require_once $include;
         }
@@ -118,7 +118,7 @@
   if (!empty($vars['node']->view) && !empty($vars['node']->view->name)) {
     $vars['view'] = &$vars['node']->view;
     $vars['template_files'][] = 'node-view-' . $vars['node']->view->name;
-    if(!empty($vars['node']->view->current_display)) {
+    if (!empty($vars['node']->view->current_display)) {
       $vars['template_files'][] = 'node-view-' . $vars['node']->view->name . '-' . $vars['node']->view->current_display;
     }
   }
@@ -133,21 +133,30 @@
   if (!empty($vars['node']->view) && !empty($vars['node']->view->name)) {
     $vars['view'] = &$vars['node']->view;
     $vars['template_files'][] = 'comment-view-' . $vars['node']->view->name;
-    if(!empty($vars['node']->view->current_display)) {
+    if (!empty($vars['node']->view->current_display)) {
       $vars['template_files'][] = 'comment-view-' . $vars['node']->view->name . '-' . $vars['node']->view->current_display;
     }
   }
 }
 
 /*
- * Implementation of hook_perm()
+ * Implement hook_permission().
  */
-function views_perm() {
-  return array('access all views', 'administer views');
+function views_permission() {
+  return array(
+    'administer views' => array(
+      'title' => t('Administer views'),
+      'description' => t('Access the views administration pages.'),
+    ),
+    'access all views' => array(
+      'title' => t('Access all views'),
+      'description' => t('Bypass access control when accessing views.'),
+    ),
+  );
 }
 
 /**
- * Implementation of hook_menu().
+ * Implement hook_menu().
  */
 function views_menu() {
   // Any event which causes a menu_rebuild could potentially mean that the
@@ -159,23 +168,22 @@
     'page callback' => 'views_ajax',
     'access callback' => TRUE,
     'description' => 'Ajax callback for view loading.',
-    'file' => 'includes/ajax.inc',
     'type' => MENU_CALLBACK,
   );
-  // Path is not admin/build/views due to menu complications with the wildcards from
+  // Path is not admin/structure/views due to menu complications with the wildcards from
   // the generic ajax callback.
   $items['admin/views/ajax/autocomplete/user'] = array(
     'page callback' => 'views_ajax_autocomplete_user',
     'access callback' => 'user_access',
     'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
     'file' => 'includes/ajax.inc',
-    'type' => MENU_CALLBACK,
   );
   return $items;
 }
 
 /**
- * Implementation of hook_menu_alter().
+ * Implement hook_menu_alter().
  */
 function views_menu_alter(&$callbacks) {
   $our_paths = array();
@@ -293,107 +301,108 @@
 }
 
 /**
- * Implementation of hook_block
- */
-function views_block($op = 'list', $delta = 0, $edit = array()) {
-  switch ($op) {
-    case 'list':
-      $items = array();
-      $views = views_get_all_views();
-      foreach ($views as $view) {
-        // disabled views get nothing.
-        if (!empty($view->disabled)) {
-          continue;
-        }
-
-        $view->init_display();
-        foreach ($view->display as $display_id => $display) {
-
-          if (isset($display->handler) && !empty($display->handler->definition['uses hook block'])) {
-            $result = $display->handler->execute_hook_block();
-            if (is_array($result)) {
-              $items = array_merge($items, $result);
-            }
-          }
-
-          if (isset($display->handler) && $display->handler->get_option('exposed_block')) {
-            $result = $display->handler->get_special_blocks();
-            if (is_array($result)) {
-              $items = array_merge($items, $result);
-            }
-          }
-        }
-      }
-
-      // block.module has a delta length limit of 32, but our deltas can
-      // unfortunately be longer because view names can be 32 and display IDs
-      // can also be 32. So for very long deltas, change to md5 hashes.
-      $hashes = array();
-
-      // get the keys because we're modifying the array and we don't want to
-      // confuse PHP too much.
-      $keys = array_keys($items);
-      foreach ($keys as $delta) {
-        if (strlen($delta) >= 32) {
-          $hash = md5($delta);
-          $hashes[$hash] = $delta;
-          $items[$hash] = $items[$delta];
-          unset($items[$delta]);
-        }
-      }
-
-      variable_set('views_block_hashes', $hashes);
-      // Save memory: Destroy those views.
-      foreach ($views as $view) {
-        $view->destroy();
-      }
-
-      return $items;
-    case 'view':
-      $start = views_microtime();
-      // if this is 32, this should be an md5 hash.
-      if (strlen($delta) == 32) {
-        $hashes = variable_get('views_block_hashes', array());
-        if (!empty($hashes[$delta])) {
-          $delta = $hashes[$delta];
-        }
-      }
-
-      // This indicates it's a special one.
-      if (substr($delta, 0, 1) == '-') {
-        list($nothing, $type, $name, $display_id) = explode('-', $delta);
-        // Put the - back on.
-        $type = '-' . $type;
-        if ($view = views_get_view($name)) {
-          if ($view->access($display_id)) {
-            $view->set_display($display_id);
-            if (isset($view->display_handler)) {
-              $output = $view->display_handler->view_special_blocks($type);
-              $view->destroy();
-              return $output;
-            }
-          }
-          $view->destroy();
-        }
-      }
-
-      list($name, $display_id) = explode('-', $delta);
-      // Load the view
-      if ($view = views_get_view($name)) {
-        if ($view->access($display_id)) {
-          $output = $view->execute_display($display_id);
-          vpr("Block $view->name execute time: " . (views_microtime() - $start) * 1000 . "ms");
+ * Implement hook_block_list().
+ */
+function views_block_list() {
+  $items = array();
+  $views = views_get_all_views();
+  foreach ($views as $view) {
+    // disabled views get nothing.
+    if (!empty($view->disabled)) {
+      continue;
+    }
+
+    $view->init_display();
+    foreach ($view->display as $display_id => $display) {
+
+      if (isset($display->handler) && !empty($display->handler->definition['uses hook block'])) {
+        $result = $display->handler->execute_hook_block_list();
+        if (is_array($result)) {
+          $items = array_merge($items, $result);
+        }
+      }
+
+      if (isset($display->handler) && $display->handler->get_option('exposed_block')) {
+        $result = $display->handler->get_special_blocks();
+        if (is_array($result)) {
+          $items = array_merge($items, $result);
+        }
+      }
+    }
+  }
+
+  // block.module has a delta length limit of 32, but our deltas can
+  // unfortunately be longer because view names can be 32 and display IDs
+  // can also be 32. So for very long deltas, change to md5 hashes.
+  $hashes = array();
+
+  // get the keys because we're modifying the array and we don't want to
+  // confuse PHP too much.
+  $keys = array_keys($items);
+  foreach ($keys as $delta) {
+    if (strlen($delta) >= 32) {
+      $hash = md5($delta);
+      $hashes[$hash] = $delta;
+      $items[$hash] = $items[$delta];
+      unset($items[$delta]);
+    }
+  }
+
+  variable_set('views_block_hashes', $hashes);
+  // Save memory: Destroy those views.
+  foreach ($views as $view) {
+    $view->destroy();
+  }
+
+  return $items;
+}
+
+/**
+ * Implement hook_block_view().
+ */
+function views_block_view($delta) {
+  $start = microtime(TRUE);
+  // if this is 32, this should be an md5 hash.
+  if (strlen($delta) == 32) {
+    $hashes = variable_get('views_block_hashes', array());
+    if (!empty($hashes[$delta])) {
+      $delta = $hashes[$delta];
+    }
+  }
+
+  // This indicates it's a special one.
+  if (substr($delta, 0, 1) == '-') {
+    list($nothing, $type, $name, $display_id) = explode('-', $delta);
+    // Put the - back on.
+    $type = '-' . $type;
+    if ($view = views_get_view($name)) {
+      if ($view->access($display_id)) {
+        $view->set_display($display_id);
+        if (isset($view->display_handler)) {
+          $output = $view->display_handler->view_special_blocks($type);
           $view->destroy();
           return $output;
         }
-        $view->destroy();
       }
-      break;
+      $view->destroy();
+    }
+  }
+
+  list($name, $display_id) = explode('-', $delta);
+  // Load the view
+  if ($view = views_get_view($name)) {
+    if ($view->access($display_id)) {
+      $output = $view->execute_display($display_id);
+      debug("Block $view->name execute time: " . (microtime(TRUE) - $start) * 1000 . "ms");
+      $view->destroy();
+      return $output;
+    }
+    $view->destroy();
   }
 }
 
 /**
- * Implementation of hook_flush_caches().
+ * Implement hook_flush_caches().
  */
 function views_flush_caches() {
   return array('cache_views', 'cache_views_data');
@@ -403,7 +412,7 @@
  * Invalidate the views cache, forcing a rebuild on the next grab of table data.
  */
 function views_invalidate_cache() {
-  cache_clear_all('*', 'cache_views', true);
+  cache_clear_all('*', 'cache_views', TRUE);
 }
 
 /**
@@ -506,12 +515,7 @@
  * Include views .inc files as necessary.
  */
 function views_include($file) {
-  static $used = array();
-  if (!isset($used[$file])) {
-    require_once './' . drupal_get_path('module', 'views') . "/includes/$file.inc";
-  }
-
-  $used[$file] = TRUE;
+  module_load_include('inc', 'views', "includes/$file");
 }
 
 /**
@@ -519,8 +523,8 @@
  */
 function views_module_include($file) {
   foreach (views_get_module_apis() as $module => $info) {
-    if (file_exists("./$info[path]/$module.$file")) {
-      require_once "./$info[path]/$module.$file";
+    if (file_exists(DRUPAL_ROOT . "/$info[path]/$module.$file")) {
+      require_once DRUPAL_ROOT . "/$info[path]/$module.$file";
     }
   }
 }
@@ -533,12 +537,8 @@
   if (!isset($cache)) {
     $cache = array();
     foreach (module_implements('views_api') as $module) {
-      $function = $module . '_views_api';
-      $info = $function();
+      $info = module_invoke($module, 'views_api');
       if (isset($info['api']) && $info['api'] == 2.000) {
-        if (!isset($info['path'])) {
-          $info['path'] = drupal_get_path('module', $module);
-        }
         $cache[$module] = $info;
       }
     }
@@ -555,7 +555,7 @@
   // and we don't want to generate duplicate cache files.
   // TODO: at some point investigate adding some files unconditionally and
   // allowing preprocess.
-  drupal_add_css(drupal_get_path('module', 'views') . "/css/$file.css", 'module', 'all', FALSE);
+  drupal_add_css(drupal_get_path('module', 'views') . "/css/$file.css", array('preprocess' => FALSE));
 }
 
 /**
@@ -567,11 +567,15 @@
     return;
   }
 
-  static $base = TRUE;
+  static $base = TRUE, $ajax = TRUE;
   if ($base) {
     drupal_add_js(drupal_get_path('module', 'views') . "/js/base.js");
     $base = FALSE;
   }
+  if ($ajax && $file == 'ajax') {
+    drupal_add_js('misc/ajax.js', array('weight' => -1));
+    $ajax = TRUE;
+  }
   drupal_add_js(drupal_get_path('module', 'views') . "/js/$file.js");
 }
 
@@ -638,7 +642,7 @@
     return _views_prepare_handler($data[$field][$key], $data, $field);
   }
   // DEBUG -- identify missing handlers
-  vpr("Missing handler: $table $field $key");
+  debug("Missing handler: $table $field $key");
   $broken = array(
     'title' => t('Broken handler @table.@field', array('@table' => $table, '@field' => $field)),
     'handler' => 'views_handler_' . $key . '_broken',
@@ -671,6 +675,7 @@
  * Get a handler for a plugin
  */
 function views_get_plugin($type, $plugin) {
+  views_include('handlers');
   $definition = views_fetch_plugin_data($type, $plugin);
   if (!empty($definition)) {
     return _views_create_handler($definition, $type);
@@ -861,33 +866,6 @@
 // Views debug helper functions
 
 /**
- * Provide debug output for Views. This relies on devel.module
- */
-function views_debug($message) {
-  if (module_exists('devel') && variable_get('views_devel_output', FALSE) && user_access('access devel information')) {
-    if (is_string($message)) {
-      $output = $message;
-    }
-    else {
-      $output = var_export($message, TRUE);
-    }
-    if (variable_get('views_devel_region', 'footer') != 'watchdog') {
-      drupal_set_content(variable_get('views_devel_region', 'footer'), '<pre>' . $output . '</pre>');
-    }
-    else {
-      watchdog('views_logging', '<pre>' . $output . '</pre>');
-    }
-  }
-}
-
-/**
- * Shortcut to views_debug()
- */
-function vpr($message) {
-  views_debug($message);
-}
-
-/**
  * Debug messages
  */
 function vsm($message) {
@@ -922,7 +900,7 @@
  *
  * Be sure that $view and $display are references.
  */
-function views_exposed_form(&$form_state) {
+function views_exposed_form($form, &$form_state) {
   // Don't show the form when batch operations are in progress.
   $batch =& batch_get();
   if (!empty($batch)) {
@@ -967,12 +945,12 @@
       }
     }
   }
-  
+
   $form['submit'] = array(
     '#name' => '', // prevent from showing up in $_GET.
     '#type' => 'submit',
     '#value' => t('Apply'),
-    '#id' => form_clean_id('edit-submit-' . $view->name),
+    '#id' => drupal_html_id('edit-submit-' . $view->name),
   );
 
   $form['#action'] = url($view->get_url());
@@ -1056,38 +1034,21 @@
  * Build a list of theme function names for use most everywhere.
  */
 function views_theme_functions($hook, $view, $display = NULL) {
-  require_once './' . drupal_get_path('module', 'views') . "/theme/theme.inc";
+  require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'views') . "/theme/theme.inc";
   return _views_theme_functions($hook, $view, $display);
 }
 
 /**
- * Views' replacement for drupal_get_form so that we can do more with
- * less.
- *
- * Items that can be set on the form_state include:
- * - input: The source of input. If unset this will be $_POST.
- * - no_redirect: Absolutely do not redirect the form even if instructed
- *   to do so.
- * - rerender: If no_redirect is set and the form was successfully submitted,
- *   rerender the form. Otherwise it will just return.
- *
- */
-function drupal_build_form($form_id, &$form_state) {
-  views_include('form');
-  return _drupal_build_form($form_id, $form_state);
-}
-
-/**
  * Substitute current time; this works with cached queries.
  */
 function views_views_query_substitutions($view) {
   global $language;
   return array(
-    '***CURRENT_VERSION***' => VERSION,
-    '***CURRENT_TIME***' => time(),
-    '***CURRENT_LANGUAGE***' => $language->language,
-    '***DEFAULT_LANGUAGE***' => language_default('language'),
-    '***NO_LANGUAGE***' => '',
+    ':views-current-version' => VERSION,
+    ':views-current-time' => REQUEST_TIME,
+    ':views-current-language' => $language->language,
+    ':views-default-language' => language_default('language'),
+    ':views-no-language' => '',
   );
 }
 
@@ -1142,10 +1103,10 @@
       $output .= ')';
     }
   }
-  else if (is_bool($var)) {
+  elseif (is_bool($var)) {
     $output = $var ? 'TRUE' : 'FALSE';
   }
-  else if (is_string($var) && strpos($var, "\n") !== FALSE) {
+  elseif (is_string($var) && strpos($var, "\n") !== FALSE) {
     // Replace line breaks in strings with a token for replacement
     // at the very end. This protects multi-line strings from
     // unintentional indentation.
@@ -1175,7 +1136,7 @@
 }
 
 /**
- * Implementation of hook_views_exportables().
+ * Implement hook_views_exportables().
  */
 function views_views_exportables($op = 'list', $views = NULL, $name = 'foo') {
   $all_views = views_get_all_views();
@@ -1196,12 +1157,12 @@
 
   if ($op == 'export') {
     $code = "/**\n";
-    $code .= " * Implementation of hook_views_default_views().\n";
+    $code .= " * Implement hook_views_default_views().\n";
     $code .= " */\n";
     $code .= "function " . $name . "_views_default_views() {\n";
     foreach ($views as $view => $truth) {
       $code .= "  /*\n";
-      $code .= "   * View ". var_export($all_views[$view]->name, TRUE) ."\n";
+      $code .= "   * View " . var_export($all_views[$view]->name, TRUE) . "\n";
       $code .= "   */\n";
       $code .= $all_views[$view]->export('  ');
       $code .= '  $views[$view->name] = $view;' . "\n\n";
@@ -1214,9 +1175,24 @@
 }
 
 /**
- * Microtime helper function to return a float time value (php4 & php5 safe).
+ * Process callback to add dependency to form items.
+ *
+ * Usage:
+ *
+ * On any form item, add
+ * - @code '#process' => 'views_process_dependency' @endcode
+ * - @code '#dependency' => array('id-of-form-without-the-#' => array(list, of, values, that, make, this, gadget, visible)); @endcode
  */
-function views_microtime() {
-  list($usec, $sec) = explode(' ', microtime());
-  return (float)$sec + (float)$usec;
+function views_process_dependency($element) {
+  if (isset($element['#dependency'])) {
+    if (!isset($element['#dependency_count'])) {
+      $element['#dependency_count'] = 1;
+    }
+    views_add_js('dependent');
+    $options['viewsAjax']['formRelationships'][$element['#id']] = array('num' => $element['#dependency_count'], 'values' => $element['#dependency']);
+    drupal_add_js($options, 'setting');
+  }
+
+  return $element;
 }
+

=== renamed file 'views2.doxy' => 'views3.doxy'
--- views2.doxy	2009-10-17 18:33:18 +0000
+++ views3.doxy	2009-10-18 07:37:31 +0000
@@ -14,207 +14,207 @@
 # Project related configuration options
 #---------------------------------------------------------------------------
 
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
 # by quotes) that should identify the project.
 
 PROJECT_NAME           =  Views
 
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
 PROJECT_NUMBER         = 2.0
 
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
 # where doxygen was started. If left blank the current directory will be used.
 
 OUTPUT_DIRECTORY       = doc
 
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
-# 4096 sub-directories (in 2 levels) under the output directory of each output 
-# format and will distribute the generated files over these directories. 
-# Enabling this option can be useful when feeding doxygen a huge amount of 
-# source files, where putting all generated files in the same directory would 
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
 # otherwise cause performance problems for the file system.
 
 CREATE_SUBDIRS         = NO
 
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
-# documentation generated by doxygen is written. Doxygen will use this 
-# information to generate all constant output in the proper language. 
-# The default language is English, other supported languages are: 
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
-# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
-# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
-# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
 # Swedish, and Ukrainian.
 
 OUTPUT_LANGUAGE        = English
 
-# This tag can be used to specify the encoding used in the generated output. 
-# The encoding is not always determined by the language that is chosen, 
-# but also whether or not the output is meant for Windows or non-Windows users. 
-# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
-# forces the Windows encoding (this is the default for the Windows binary), 
-# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
 # all platforms other than Windows).
 
 USE_WINDOWS_ENCODING   = NO
 
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
-# include brief member descriptions after the members that are listed in 
-# the file and class documentation (similar to JavaDoc). 
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
 # Set to NO to disable this.
 
 BRIEF_MEMBER_DESC      = YES
 
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
-# the brief description of a member or function before the detailed description. 
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
 # brief descriptions will be completely suppressed.
 
 REPEAT_BRIEF           = YES
 
-# This tag implements a quasi-intelligent brief description abbreviator 
-# that is used to form the text in various listings. Each string 
-# in this list, if found as the leading text of the brief description, will be 
-# stripped from the text and the result after processing the whole list, is 
-# used as the annotated text. Otherwise, the brief description is used as-is. 
-# If left blank, the following values are used ("$name" is automatically 
-# replaced with the name of the entity): "The $name class" "The $name widget" 
-# "The $name file" "is" "provides" "specifies" "contains" 
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
 # "represents" "a" "an" "the"
 
-ABBREVIATE_BRIEF       = 
+ABBREVIATE_BRIEF       =
 
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
-# Doxygen will generate a detailed section even if there is only a brief 
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
 # description.
 
 ALWAYS_DETAILED_SEC    = YES
 
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
-# inherited members of a class in the documentation of that class as if those 
-# members were ordinary class members. Constructors, destructors and assignment 
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
 # operators of the base classes will not be shown.
 
 INLINE_INHERITED_MEMB  = YES
 
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
-# path before files name in the file list and in the header files. If set 
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
 # to NO the shortest path that makes the file name unique will be used.
 
 FULL_PATH_NAMES        = YES
 
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
-# can be used to strip a user-defined part of the path. Stripping is 
-# only done if one of the specified strings matches the left-hand part of 
-# the path. The tag can be used to show relative paths in the file list. 
-# If left blank the directory from which doxygen is run is used as the 
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
 # path to strip.
 
-STRIP_FROM_PATH        = 
+STRIP_FROM_PATH        =
 
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
-# the path mentioned in the documentation of a class, which tells 
-# the reader which header file to include in order to use a class. 
-# If left blank only the name of the header file containing the class 
-# definition is used. Otherwise one should specify the include paths that 
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
 # are normally passed to the compiler using the -I flag.
 
-STRIP_FROM_INC_PATH    = 
+STRIP_FROM_INC_PATH    =
 
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
-# (but less readable) file names. This can be useful is your file systems 
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
 # doesn't support long names like on DOS, Mac, or CD-ROM.
 
 SHORT_NAMES            = NO
 
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
-# will interpret the first line (until the first dot) of a JavaDoc-style 
-# comment as the brief description. If set to NO, the JavaDoc 
-# comments will behave just like the Qt-style comments (thus requiring an 
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
 # explicit @brief command for a brief description.
 
 JAVADOC_AUTOBRIEF      = YES
 
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
-# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
-# comments) as a brief description. This used to be the default behaviour. 
-# The new default is to treat a multi-line C++ comment block as a detailed 
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
 # description. Set this tag to YES if you prefer the old behaviour instead.
 
 MULTILINE_CPP_IS_BRIEF = NO
 
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
 # will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member 
+# If set to NO, the detailed description appears after the member
 # documentation.
 
 DETAILS_AT_TOP         = YES
 
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
 # re-implements.
 
 INHERIT_DOCS           = YES
 
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
-# a new page for each member. If set to NO, the documentation of a member will 
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
 # be part of the file/class/namespace that contains it.
 
 SEPARATE_MEMBER_PAGES  = NO
 
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
 # Doxygen uses this value to replace tabs by spaces in code fragments.
 
 TAB_SIZE               = 2
 
-# This tag can be used to specify a number of aliases that acts 
-# as commands in the documentation. An alias has the form "name=value". 
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
-# put the command \sideeffect (or @sideeffect) in the documentation, which 
-# will result in a user-defined paragraph with heading "Side Effects:". 
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
 # You can put \n's in the value part of an alias to insert newlines.
 
-ALIASES                = 
+ALIASES                =
 
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
-# sources only. Doxygen will then generate output that is more tailored for C. 
-# For instance, some of the names that are used will be different. The list 
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
 # of all members will be omitted, etc.
 
 OPTIMIZE_OUTPUT_FOR_C  = NO
 
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
-# sources only. Doxygen will then generate output that is more tailored for Java. 
-# For instance, namespaces will be presented as packages, qualified scopes 
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
 # will look different, etc.
 
 OPTIMIZE_OUTPUT_JAVA   = NO
 
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
-# include (a tag file for) the STL sources as input, then you should 
-# set this tag to YES in order to let doxygen match functions declarations and 
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
-# func(std::string) {}). This also make the inheritance and collaboration 
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
+# include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
 # diagrams that involve STL classes more complete and accurate.
 
 BUILTIN_STL_SUPPORT    = NO
 
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
-# tag is set to YES, then doxygen will reuse the documentation of the first 
-# member in the group (if any) for the other members of the group. By default 
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
 # all members of a group must be documented explicitly.
 
 DISTRIBUTE_GROUP_DOC   = NO
 
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
-# the same type (for instance a group of public functions) to be put as a 
-# subgroup of that type (e.g. under the Public Functions section). Set it to 
-# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
 # the \nosubgrouping command.
 
 SUBGROUPING            = YES
@@ -223,326 +223,326 @@
 # Build related configuration options
 #---------------------------------------------------------------------------
 
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
-# documentation are documented, even if no documentation was available. 
-# Private class members and static file members will be hidden unless 
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
 
 EXTRACT_ALL            = NO
 
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
 # will be included in the documentation.
 
 EXTRACT_PRIVATE        = NO
 
-# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
 # will be included in the documentation.
 
 EXTRACT_STATIC         = NO
 
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
-# defined locally in source files will be included in the documentation. 
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
 # If set to NO only classes defined in header files are included.
 
 EXTRACT_LOCAL_CLASSES  = YES
 
-# This flag is only useful for Objective-C code. When set to YES local 
-# methods, which are defined in the implementation section but not in 
-# the interface are included in the documentation. 
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
 # If set to NO (the default) only methods in the interface are included.
 
 EXTRACT_LOCAL_METHODS  = NO
 
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
-# undocumented members of documented classes, files or namespaces. 
-# If set to NO (the default) these members will be included in the 
-# various overviews, but no documentation section is generated. 
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
 # This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_MEMBERS     = NO
 
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
-# undocumented classes that are normally visible in the class hierarchy. 
-# If set to NO (the default) these classes will be included in the various 
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
 # overviews. This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_CLASSES     = NO
 
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
-# friend (class|struct|union) declarations. 
-# If set to NO (the default) these declarations will be included in the 
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
 # documentation.
 
 HIDE_FRIEND_COMPOUNDS  = NO
 
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
-# documentation blocks found inside the body of a function. 
-# If set to NO (the default) these blocks will be appended to the 
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
 # function's detailed documentation block.
 
 HIDE_IN_BODY_DOCS      = NO
 
-# The INTERNAL_DOCS tag determines if documentation 
-# that is typed after a \internal command is included. If the tag is set 
-# to NO (the default) then the documentation will be excluded. 
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
 # Set it to YES to include the internal documentation.
 
 INTERNAL_DOCS          = NO
 
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
-# file names in lower-case letters. If set to YES upper-case letters are also 
-# allowed. This is useful if you have classes or files whose names only differ 
-# in case and if your file system supports case sensitive file names. Windows 
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
 # and Mac users are advised to set this option to NO.
 
 CASE_SENSE_NAMES       = YES
 
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
-# will show members with their full class and namespace scopes in the 
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
 # documentation. If set to YES the scope will be hidden.
 
 HIDE_SCOPE_NAMES       = NO
 
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put a list of the files that are included by a file in the documentation 
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
 # of that file.
 
 SHOW_INCLUDE_FILES     = YES
 
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
 # is inserted in the documentation for inline members.
 
 INLINE_INFO            = YES
 
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
-# will sort the (detailed) documentation of file and class members 
-# alphabetically by member name. If set to NO the members will appear in 
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
 # declaration order.
 
 SORT_MEMBER_DOCS       = YES
 
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
-# brief documentation of file, namespace and class members alphabetically 
-# by member name. If set to NO (the default) the members will appear in 
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
 # declaration order.
 
 SORT_BRIEF_DOCS        = NO
 
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
-# sorted by fully-qualified names, including namespaces. If set to 
-# NO (the default), the class list will be sorted only by class name, 
-# not including the namespace part. 
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
 # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the 
+# Note: This option applies only to the class list, not to the
 # alphabetical list.
 
 SORT_BY_SCOPE_NAME     = NO
 
-# The GENERATE_TODOLIST tag can be used to enable (YES) or 
-# disable (NO) the todo list. This list is created by putting \todo 
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
 # commands in the documentation.
 
 GENERATE_TODOLIST      = YES
 
-# The GENERATE_TESTLIST tag can be used to enable (YES) or 
-# disable (NO) the test list. This list is created by putting \test 
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
 # commands in the documentation.
 
 GENERATE_TESTLIST      = YES
 
-# The GENERATE_BUGLIST tag can be used to enable (YES) or 
-# disable (NO) the bug list. This list is created by putting \bug 
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
 # commands in the documentation.
 
 GENERATE_BUGLIST       = YES
 
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
-# disable (NO) the deprecated list. This list is created by putting 
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
 # \deprecated commands in the documentation.
 
 GENERATE_DEPRECATEDLIST= YES
 
-# The ENABLED_SECTIONS tag can be used to enable conditional 
+# The ENABLED_SECTIONS tag can be used to enable conditional
 # documentation sections, marked by \if sectionname ... \endif.
 
-ENABLED_SECTIONS       = 
+ENABLED_SECTIONS       =
 
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
-# the initial value of a variable or define consists of for it to appear in 
-# the documentation. If the initializer consists of more lines than specified 
-# here it will be hidden. Use a value of 0 to hide initializers completely. 
-# The appearance of the initializer of individual variables and defines in the 
-# documentation can be controlled using \showinitializer or \hideinitializer 
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
 # command in the documentation regardless of this setting.
 
 MAX_INITIALIZER_LINES  = 30
 
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
-# at the bottom of the documentation of classes and structs. If set to YES the 
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
 # list will mention the files that were used to generate the documentation.
 
 SHOW_USED_FILES        = YES
 
-# If the sources in your project are distributed over multiple directories 
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
 # in the documentation. The default is NO.
 
 SHOW_DIRECTORIES       = NO
 
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
-# doxygen should invoke to get the current version for each file (typically from the 
-# version control system). Doxygen will invoke the program by executing (via 
-# popen()) the command <command> <input-file>, where <command> is the value of 
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
-# provided by doxygen. Whatever the program writes to standard output 
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
 # is used as the file version. See the manual for examples.
 
-FILE_VERSION_FILTER    = 
+FILE_VERSION_FILTER    =
 
 #---------------------------------------------------------------------------
 # configuration options related to warning and progress messages
 #---------------------------------------------------------------------------
 
-# The QUIET tag can be used to turn on/off the messages that are generated 
+# The QUIET tag can be used to turn on/off the messages that are generated
 # by doxygen. Possible values are YES and NO. If left blank NO is used.
 
 QUIET                  = YES
 
-# The WARNINGS tag can be used to turn on/off the warning messages that are 
-# generated by doxygen. Possible values are YES and NO. If left blank 
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
 # NO is used.
 
 WARNINGS               = YES
 
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
 # automatically be disabled.
 
 WARN_IF_UNDOCUMENTED   = NO
 
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
-# potential errors in the documentation, such as not documenting some 
-# parameters in a documented function, or documenting parameters that 
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
 # don't exist or using markup commands wrongly.
 
 WARN_IF_DOC_ERROR      = YES
 
-# This WARN_NO_PARAMDOC option can be abled to get warnings for 
-# functions that are documented, but have no documentation for their parameters 
-# or return value. If set to NO (the default) doxygen will only warn about 
-# wrong or incomplete parameter documentation, but not about the absence of 
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
 # documentation.
 
 WARN_NO_PARAMDOC       = NO
 
-# The WARN_FORMAT tag determines the format of the warning messages that 
-# doxygen can produce. The string should contain the $file, $line, and $text 
-# tags, which will be replaced by the file and line number from which the 
-# warning originated and the warning text. Optionally the format may contain 
-# $version, which will be replaced by the version of the file (if it could 
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
 # be obtained via FILE_VERSION_FILTER)
 
 WARN_FORMAT            = "$file:$line: $text"
 
-# The WARN_LOGFILE tag can be used to specify a file to which warning 
-# and error messages should be written. If left blank the output is written 
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
 # to stderr.
 
-WARN_LOGFILE           = 
+WARN_LOGFILE           =
 
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
 
-# The INPUT tag can be used to specify the files and/or directories that contain 
-# documented source files. You may enter file names like "myfile.cpp" or 
-# directories like "/usr/src/myproject". Separate the files or directories 
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
-INPUT                  = 
+INPUT                  =
 
-# If the value of the INPUT tag contains directories, you can use the 
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank the following patterns are tested: 
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
 # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
 
 FILE_PATTERNS          = *.module *.inc *.php
 
 # The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO. 
+# should be searched for input files as well. Possible values are YES and NO.
 # If left blank NO is used.
 
 RECURSIVE              = YES
 
-# The EXCLUDE tag can be used to specify files and/or directories that should 
-# excluded from the INPUT source files. This way you can easily exclude a 
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
 # subdirectory from a directory tree whose root is specified with the INPUT tag.
 
-EXCLUDE                = 
+EXCLUDE                =
 
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
-# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
 # from the input.
 
 EXCLUDE_SYMLINKS       = NO
 
-# If the value of the INPUT tag contains directories, you can use the 
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
-# certain files from those directories. Note that the wildcards are matched 
-# against the file with absolute path, so to exclude all test directories 
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
 # for example use the pattern */test/*
 
-EXCLUDE_PATTERNS       = 
+EXCLUDE_PATTERNS       =
 
-# The EXAMPLE_PATH tag can be used to specify one or more files or 
-# directories that contain example code fragments that are included (see 
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
 # the \include command).
 
-EXAMPLE_PATH           = 
+EXAMPLE_PATH           =
 
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
 # blank all files are included.
 
-EXAMPLE_PATTERNS       = 
+EXAMPLE_PATTERNS       =
 
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
-# searched for input files to be used with the \include or \dontinclude 
-# commands irrespective of the value of the RECURSIVE tag. 
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
 # Possible values are YES and NO. If left blank NO is used.
 
 EXAMPLE_RECURSIVE      = NO
 
-# The IMAGE_PATH tag can be used to specify one or more files or 
-# directories that contain image that are included in the documentation (see 
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
 # the \image command).
 
-IMAGE_PATH             = 
+IMAGE_PATH             =
 
-# The INPUT_FILTER tag can be used to specify a program that doxygen should 
-# invoke to filter for each input file. Doxygen will invoke the filter program 
-# by executing (via popen()) the command <filter> <input-file>, where <filter> 
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
-# input file. Doxygen will then use the output that the filter program writes 
-# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be
 # ignored.
 
-INPUT_FILTER           = 
+INPUT_FILTER           =
 
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
-# basis.  Doxygen will compare the file name with each pattern and apply the 
-# filter if there is a match.  The filters are a list of the form: 
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.  Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.  The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
 # is applied to all files.
 
-FILTER_PATTERNS        = 
+FILTER_PATTERNS        =
 
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
-# INPUT_FILTER) will be used to filter the input files when producing source 
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
 # files to browse (i.e. when SOURCE_BROWSER is set to YES).
 
 FILTER_SOURCE_FILES    = NO
@@ -551,32 +551,32 @@
 # configuration options related to source browsing
 #---------------------------------------------------------------------------
 
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
-# be generated. Documented entities will be cross-referenced with these sources. 
-# Note: To get rid of all source code in the generated output, make sure also 
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
 # VERBATIM_HEADERS is set to NO.
 
 SOURCE_BROWSER         = YES
 
-# Setting the INLINE_SOURCES tag to YES will include the body 
+# Setting the INLINE_SOURCES tag to YES will include the body
 # of functions and classes directly in the documentation.
 
 INLINE_SOURCES         = YES
 
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
-# doxygen to hide any special comment blocks from generated source code 
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
 # fragments. Normal C and C++ comments will always remain visible.
 
 STRIP_CODE_COMMENTS    = YES
 
-# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
-# then for each documented function all documented 
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
 # functions referencing it will be listed.
 
 REFERENCED_BY_RELATION = YES
 
-# If the REFERENCES_RELATION tag is set to YES (the default) 
-# then for each documented function all documented entities 
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
 # called/used by that function will be listed.
 
 REFERENCES_RELATION    = YES
@@ -588,16 +588,16 @@
 
 REFERENCES_LINK_SOURCE = YES
 
-# If the USE_HTAGS tag is set to YES then the references to source code 
-# will point to the HTML generated by the htags(1) tool instead of doxygen 
-# built-in source browser. The htags tool is part of GNU's global source 
-# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
 # will need version 4.8.6 or higher.
 
 USE_HTAGS              = NO
 
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
-# will generate a verbatim copy of the header file for each class for 
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
 # which an include is specified. Set to NO to disable this.
 
 VERBATIM_HEADERS       = YES
@@ -606,133 +606,133 @@
 # configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
 
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
-# of all compounds will be generated. Enable this if the project 
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
 # contains a lot of classes, structs, unions or interfaces.
 
 ALPHABETICAL_INDEX     = NO
 
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
 # in which this list will be split (can be a number in the range [1..20])
 
 COLS_IN_ALPHA_INDEX    = 5
 
-# In case all classes in a project start with a common prefix, all 
-# classes will be put under the same header in the alphabetical index. 
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
 # should be ignored while generating the index headers.
 
-IGNORE_PREFIX          = 
+IGNORE_PREFIX          =
 
 #---------------------------------------------------------------------------
 # configuration options related to the HTML output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
 # generate HTML output.
 
 GENERATE_HTML          = YES
 
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `html' will be used as the default path.
 
 HTML_OUTPUT            = html
 
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
 # doxygen will generate files with .html extension.
 
 HTML_FILE_EXTENSION    = .html
 
-# The HTML_HEADER tag can be used to specify a personal HTML header for 
-# each generated HTML page. If it is left blank doxygen will generate a 
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
 # standard header.
 
-HTML_HEADER            = 
+HTML_HEADER            =
 
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
-# each generated HTML page. If it is left blank doxygen will generate a 
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
 # standard footer.
 
-HTML_FOOTER            = 
+HTML_FOOTER            =
 
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
-# style sheet that is used by each HTML page. It can be used to 
-# fine-tune the look of the HTML output. If the tag is left blank doxygen 
-# will generate a default style sheet. Note that doxygen will try to copy 
-# the style sheet file to the HTML output directory, so don't put your own 
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
 # stylesheet in the HTML output directory as well, or it will be erased!
 
-HTML_STYLESHEET        = 
+HTML_STYLESHEET        =
 
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
-# files or namespaces will be aligned in HTML using tables. If set to 
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
 # NO a bullet list will be used.
 
 HTML_ALIGN_MEMBERS     = YES
 
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
-# will be generated that can be used as input for tools like the 
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
 # of the generated HTML documentation.
 
 GENERATE_HTMLHELP      = NO
 
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
-# be used to specify the file name of the resulting .chm file. You 
-# can add a path in front of the file if the result should not be 
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
 # written to the html output directory.
 
-CHM_FILE               = 
+CHM_FILE               =
 
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
-# be used to specify the location (absolute path including file name) of 
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
 # the HTML help compiler on the generated index.hhp.
 
-HHC_LOCATION           = 
+HHC_LOCATION           =
 
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
-# controls if a separate .chi index file is generated (YES) or that 
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
 # it should be included in the master .chm file (NO).
 
 GENERATE_CHI           = NO
 
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
-# controls whether a binary table of contents is generated (YES) or a 
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
 # normal table of contents (NO) in the .chm file.
 
 BINARY_TOC             = NO
 
-# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
 # to the contents of the HTML help documentation and to the tree view.
 
 TOC_EXPAND             = NO
 
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
-# top of each HTML page. The value NO (the default) enables the index and 
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
 # the value YES disables it.
 
 DISABLE_INDEX          = NO
 
-# This tag can be used to set the number of enum values (range [1..20]) 
+# This tag can be used to set the number of enum values (range [1..20])
 # that doxygen will group on one line in the generated HTML documentation.
 
 ENUM_VALUES_PER_LINE   = 4
 
 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that 
-# is generated for HTML Help). For this to work a browser that supports 
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
 # probably better off using the HTML help feature.
 
 GENERATE_TREEVIEW      = YES
 
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
-# used to set the initial width (in pixels) of the frame in which the tree 
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
 # is shown.
 
 TREEVIEW_WIDTH         = 250
@@ -741,74 +741,74 @@
 # configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
 # generate Latex output.
 
 GENERATE_LATEX         = NO
 
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `latex' will be used as the default path.
 
 LATEX_OUTPUT           = latex
 
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
 # invoked. If left blank `latex' will be used as the default command name.
 
 LATEX_CMD_NAME         = latex
 
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
-# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
 # default command name.
 
 MAKEINDEX_CMD_NAME     = makeindex
 
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
-# LaTeX documents. This may be useful for small projects and may help to 
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
 # save some trees in general.
 
 COMPACT_LATEX          = NO
 
-# The PAPER_TYPE tag can be used to set the paper type that is used 
-# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
 # executive. If left blank a4wide will be used.
 
 PAPER_TYPE             = a4wide
 
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
 # packages that should be included in the LaTeX output.
 
-EXTRA_PACKAGES         = 
+EXTRA_PACKAGES         =
 
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
-# the generated latex document. The header should contain everything until 
-# the first chapter. If it is left blank doxygen will generate a 
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
 # standard header. Notice: only use this tag if you know what you are doing!
 
-LATEX_HEADER           = 
+LATEX_HEADER           =
 
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
-# contain links (just like the HTML output) instead of page references 
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
 # This makes the output suitable for online browsing using a pdf viewer.
 
 PDF_HYPERLINKS         = NO
 
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
-# plain latex in the generated Makefile. Set this option to YES to get a 
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
 # higher quality PDF documentation.
 
 USE_PDFLATEX           = NO
 
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
-# command to the generated LaTeX files. This will instruct LaTeX to keep 
-# running if errors occur, instead of asking the user for help. 
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
 # This option is also used when generating formulas in HTML.
 
 LATEX_BATCHMODE        = NO
 
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
-# include the index chapters (such as File Index, Compound Index, etc.) 
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
 # in the output.
 
 LATEX_HIDE_INDICES     = NO
@@ -817,68 +817,68 @@
 # configuration options related to the RTF output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
-# The RTF output is optimized for Word 97 and may not look very pretty with 
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
 # other RTF readers or editors.
 
 GENERATE_RTF           = NO
 
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `rtf' will be used as the default path.
 
 RTF_OUTPUT             = rtf
 
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
-# RTF documents. This may be useful for small projects and may help to 
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
 # save some trees in general.
 
 COMPACT_RTF            = NO
 
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
-# will contain hyperlink fields. The RTF file will 
-# contain links (just like the HTML output) instead of page references. 
-# This makes the output suitable for online browsing using WORD or other 
-# programs which support those fields. 
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
 # Note: wordpad (write) and others do not support links.
 
 RTF_HYPERLINKS         = NO
 
-# Load stylesheet definitions from file. Syntax is similar to doxygen's 
-# config file, i.e. a series of assignments. You only have to provide 
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
 # replacements, missing definitions are set to their default value.
 
-RTF_STYLESHEET_FILE    = 
+RTF_STYLESHEET_FILE    =
 
-# Set optional variables used in the generation of an rtf document. 
+# Set optional variables used in the generation of an rtf document.
 # Syntax is similar to doxygen's config file.
 
-RTF_EXTENSIONS_FILE    = 
+RTF_EXTENSIONS_FILE    =
 
 #---------------------------------------------------------------------------
 # configuration options related to the man page output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
 # generate man pages
 
 GENERATE_MAN           = NO
 
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `man' will be used as the default path.
 
 MAN_OUTPUT             = man
 
-# The MAN_EXTENSION tag determines the extension that is added to 
+# The MAN_EXTENSION tag determines the extension that is added to
 # the generated man pages (default is the subroutine's section .3)
 
 MAN_EXTENSION          = .3
 
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
-# then it will generate one additional man file for each entity 
-# documented in the real man page(s). These additional files 
-# only source the real man page, but without them the man command 
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
 # would be unable to find the correct page. The default is NO.
 
 MAN_LINKS              = NO
@@ -887,33 +887,33 @@
 # configuration options related to the XML output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_XML tag is set to YES Doxygen will 
-# generate an XML file that captures the structure of 
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
 # the code including all documentation.
 
 GENERATE_XML           = NO
 
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `xml' will be used as the default path.
 
 XML_OUTPUT             = xml
 
-# The XML_SCHEMA tag can be used to specify an XML schema, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_SCHEMA             = 
-
-# The XML_DTD tag can be used to specify an XML DTD, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_DTD                = 
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
-# dump the program listings (including syntax highlighting 
-# and cross-referencing information) to the XML output. Note that 
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
 # enabling this will significantly increase the size of the XML output.
 
 XML_PROGRAMLISTING     = YES
@@ -922,10 +922,10 @@
 # configuration options for the AutoGen Definitions output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
-# generate an AutoGen Definitions (see autogen.sf.net) file 
-# that captures the structure of the code including all 
-# documentation. Note that this feature is still experimental 
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
 # and incomplete at the moment.
 
 GENERATE_AUTOGEN_DEF   = NO
@@ -934,319 +934,319 @@
 # configuration options related to the Perl module output
 #---------------------------------------------------------------------------
 
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
-# generate a Perl module file that captures the structure of 
-# the code including all documentation. Note that this 
-# feature is still experimental and incomplete at the 
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
 # moment.
 
 GENERATE_PERLMOD       = NO
 
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
 # to generate PDF and DVI output from the Perl module output.
 
 PERLMOD_LATEX          = NO
 
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
-# nicely formatted so it can be parsed by a human reader.  This is useful 
-# if you want to understand what is going on.  On the other hand, if this 
-# tag is set to NO the size of the Perl module output will be much smaller 
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.  This is useful
+# if you want to understand what is going on.  On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
 # and Perl will parse it just the same.
 
 PERLMOD_PRETTY         = YES
 
-# The names of the make variables in the generated doxyrules.make file 
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
-# This is useful so different doxyrules.make files included by the same 
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
 # Makefile don't overwrite each other's variables.
 
-PERLMOD_MAKEVAR_PREFIX = 
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
-# evaluate all C-preprocessor directives found in the sources and include 
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
 # files.
 
 ENABLE_PREPROCESSING   = NO
 
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
-# names in the source code. If set to NO (the default) only conditional 
-# compilation will be performed. Macro expansion can be done in a controlled 
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
 # way by setting EXPAND_ONLY_PREDEF to YES.
 
 MACRO_EXPANSION        = NO
 
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
-# then the macro expansion is limited to the macros specified with the 
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
 # PREDEFINED and EXPAND_AS_DEFINED tags.
 
 EXPAND_ONLY_PREDEF     = NO
 
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
 # in the INCLUDE_PATH (see below) will be search if a #include is found.
 
 SEARCH_INCLUDES        = YES
 
-# The INCLUDE_PATH tag can be used to specify one or more directories that 
-# contain include files that are not input files but should be processed by 
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
 # the preprocessor.
 
-INCLUDE_PATH           = 
+INCLUDE_PATH           =
 
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
-# patterns (like *.h and *.hpp) to filter out the header-files in the 
-# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
 # be used.
 
-INCLUDE_FILE_PATTERNS  = 
+INCLUDE_FILE_PATTERNS  =
 
-# The PREDEFINED tag can be used to specify one or more macro names that 
-# are defined before the preprocessor is started (similar to the -D option of 
-# gcc). The argument of the tag is a list of macros of the form: name 
-# or name=definition (no spaces). If the definition and the = are 
-# omitted =1 is assumed. To prevent a macro definition from being 
-# undefined via #undef or recursively expanded use the := operator 
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
 # instead of the = operator.
 
-PREDEFINED             = 
+PREDEFINED             =
 
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
-# this tag can be used to specify a list of macro names that should be expanded. 
-# The macro definition that is found in the sources will be used. 
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
 # Use the PREDEFINED tag if you want to use a different macro definition.
 
-EXPAND_AS_DEFINED      = 
+EXPAND_AS_DEFINED      =
 
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
-# doxygen's preprocessor will remove all function-like macros that are alone 
-# on a line, have an all uppercase name, and do not end with a semicolon. Such 
-# function macros are typically used for boiler-plate code, and will confuse 
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
 # the parser if not removed.
 
 SKIP_FUNCTION_MACROS   = YES
 
 #---------------------------------------------------------------------------
-# Configuration::additions related to external references   
+# Configuration::additions related to external references
 #---------------------------------------------------------------------------
 
-# The TAGFILES option can be used to specify one or more tagfiles. 
-# Optionally an initial location of the external documentation 
-# can be added for each tagfile. The format of a tag file without 
-# this location is as follows: 
-#   TAGFILES = file1 file2 ... 
-# Adding location for the tag files is done as follows: 
-#   TAGFILES = file1=loc1 "file2 = loc2" ... 
-# where "loc1" and "loc2" can be relative or absolute paths or 
-# URLs. If a location is present for each tag, the installdox tool 
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#   TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#   TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
 # does not have to be run to correct the links.
 # Note that each tag file must have a unique name
 # (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen 
+# If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
-TAGFILES               = 
+TAGFILES               =
 
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
 
-GENERATE_TAGFILE       = 
+GENERATE_TAGFILE       =
 
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
-# in the class index. If set to NO only the inherited external classes 
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
 # will be listed.
 
 ALLEXTERNALS           = NO
 
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
-# in the modules index. If set to NO, only the current project's groups will 
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
 # be listed.
 
 EXTERNAL_GROUPS        = YES
 
-# The PERL_PATH should be the absolute path and name of the perl script 
+# The PERL_PATH should be the absolute path and name of the perl script
 # interpreter (i.e. the result of `which perl').
 
 PERL_PATH              = /usr/bin/perl
 
 #---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
+# Configuration options related to the dot tool
 #---------------------------------------------------------------------------
 
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
-# or super classes. Setting the tag to NO turns the diagrams off. Note that 
-# this option is superseded by the HAVE_DOT option below. This is only a 
-# fallback. It is recommended to install and use dot, since it yields more 
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
 # powerful graphs.
 
 CLASS_DIAGRAMS         = YES
 
-# If set to YES, the inheritance and collaboration graphs will hide 
-# inheritance and usage relations if the target is undocumented 
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
 # or is not a class.
 
 HIDE_UNDOC_RELATIONS   = YES
 
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
-# available from the path. This tool is part of Graphviz, a graph visualization 
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
 # have no effect if this option is set to NO (the default)
 
 HAVE_DOT               = NO
 
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect inheritance relations. Setting this tag to YES will force the 
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
 # the CLASS_DIAGRAMS tag to NO.
 
 CLASS_GRAPH            = YES
 
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect implementation dependencies (inheritance, containment, and 
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
 # class references variables) of the class with other documented classes.
 
 COLLABORATION_GRAPH    = YES
 
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
 # will generate a graph for groups, showing the direct groups dependencies
 
 GROUP_GRAPHS           = YES
 
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
-# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
 # Language.
 
 UML_LOOK               = NO
 
-# If set to YES, the inheritance and collaboration graphs will show the 
+# If set to YES, the inheritance and collaboration graphs will show the
 # relations between templates and their instances.
 
 TEMPLATE_RELATIONS     = NO
 
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
-# tags are set to YES then doxygen will generate a graph for each documented 
-# file showing the direct and indirect include dependencies of the file with 
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
 # other documented files.
 
 INCLUDE_GRAPH          = YES
 
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
-# documented header file showing the documented files that directly or 
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
 # indirectly include this file.
 
 INCLUDED_BY_GRAPH      = YES
 
-# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
-# generate a call dependency graph for every global function or class method. 
-# Note that enabling this option will significantly increase the time of a run. 
-# So in most cases it will be better to enable call graphs for selected 
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
 # functions only using the \callgraph command.
 
 CALL_GRAPH             = NO
 
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
-# generate a caller dependency graph for every global function or class method. 
-# Note that enabling this option will significantly increase the time of a run. 
-# So in most cases it will be better to enable caller graphs for selected 
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a caller dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
 # functions only using the \callergraph command.
 
 CALLER_GRAPH           = NO
 
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
 # will graphical hierarchy of all classes instead of a textual one.
 
 GRAPHICAL_HIERARCHY    = YES
 
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
-# then doxygen will show the dependencies a directory has on other directories 
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
 # in a graphical way. The dependency relations are determined by the #include
 # relations between the files in the directories.
 
 DIRECTORY_GRAPH        = YES
 
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
 # generated by dot. Possible values are png, jpg, or gif
 # If left blank png will be used.
 
 DOT_IMAGE_FORMAT       = png
 
-# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
 # found. If left blank, it is assumed the dot tool can be found in the path.
 
-DOT_PATH               = 
+DOT_PATH               =
 
-# The DOTFILE_DIRS tag can be used to specify one or more directories that 
-# contain dot files that are included in the documentation (see the 
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
 # \dotfile command).
 
-DOTFILE_DIRS           = 
+DOTFILE_DIRS           =
 
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
-# this value, doxygen will try to truncate the graph, so that it fits within 
-# the specified constraint. Beware that most browsers cannot cope with very 
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
 # large images.
 
 MAX_DOT_GRAPH_WIDTH    = 1024
 
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
-# this value, doxygen will try to truncate the graph, so that it fits within 
-# the specified constraint. Beware that most browsers cannot cope with very 
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
 # large images.
 
 MAX_DOT_GRAPH_HEIGHT   = 1024
 
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
-# graphs generated by dot. A depth value of 3 means that only nodes reachable 
-# from the root by following a path via at most 3 edges will be shown. Nodes 
-# that lay further from the root node will be omitted. Note that setting this 
-# option to 1 or 2 may greatly reduce the computation time needed for large 
-# code bases. Also note that a graph may be further truncated if the graph's 
-# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH 
-# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), 
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
 # the graph is not depth-constrained.
 
 MAX_DOT_GRAPH_DEPTH    = 0
 
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
-# background. This is disabled by default, which results in a white background. 
-# Warning: Depending on the platform used, enabling this option may lead to 
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
 # read).
 
 DOT_TRANSPARENT        = NO
 
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
-# files in one run (i.e. multiple -o and -T options on the command line). This 
-# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
 # support this, this feature is disabled by default.
 
 DOT_MULTI_TARGETS      = NO
 
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
-# generate a legend page explaining the meaning of the various boxes and 
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
 # arrows in the dot generated graphs.
 
 GENERATE_LEGEND        = YES
 
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
-# remove the intermediate dot files that are used to generate 
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
 # the various graphs.
 
 DOT_CLEANUP            = YES
 
 #---------------------------------------------------------------------------
-# Configuration::additions related to the search engine   
+# Configuration::additions related to the search engine
 #---------------------------------------------------------------------------
 
-# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# The SEARCHENGINE tag specifies whether or not a search engine should be
 # used. If set to NO the values of all tags below this one will be ignored.
 
 SEARCHENGINE           = NO

=== modified file 'views_export/views_export.info'
--- views_export/views_export.info	2009-10-17 18:33:18 +0000
+++ views_export/views_export.info	2009-10-17 19:26:01 +0000
@@ -4,4 +4,5 @@
 description = Allows exporting multiple views at once.
 package = "Views"
 dependencies[] = views
-core = 6.x
+core = 7.x
+files[] = views_export.module

=== modified file 'views_export/views_export.module'
--- views_export/views_export.module	2009-10-17 18:33:18 +0000
+++ views_export/views_export.module	2009-10-18 20:51:34 +0000
@@ -9,18 +9,18 @@
  */
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function views_export_menu() {
   $items = array();
-  $items['admin/build/views/tools/export'] = array(
+  $items['admin/structure/views/tools/export'] = array(
     'title' => 'Bulk export',
     'access arguments' => array('use views exporter'),
     'page callback' => 'views_export_export',
     'type' => MENU_LOCAL_TASK,
   );
 
-  $items['admin/build/views/tools/export/results'] = array(
+  $items['admin/structure/views/tools/export/results'] = array(
     'access arguments' => array('use views exporter'),
     'page callback' => 'views_export_export',
     'type' => MENU_CALLBACK,
@@ -28,20 +28,27 @@
 
   return $items;
 }
-
+/**
+ * Implements hook_theme().
+ */
 function views_export_theme() {
   return array(
     'views_export_export_form' => array(
-      'args' => array('form' => NULL),
+      'arguments' => array('form' => NULL),
     ),
   );
 }
 
 /**
- * Implementation of hook_perm().
+ * Implements hook_perm().
  */
-function views_export_perm() {
-  return array('use views exporter');
+function views_export_permission() {
+  return array(
+    'use views exporter' => array(
+      'title' => t('Use Views exporter'),
+      'description' => t('Use the Views exporter.'),
+    ),
+  );
 }
 
 /**
@@ -67,7 +74,7 @@
       'tags' => $tags,
     );
 
-    $output = drupal_build_form('views_export_export_form', $form_state);
+    $output = drupal_render(drupal_build_form('views_export_export_form', $form_state));
     if (!$output) {
       $output = $form_state['output'];
     }
@@ -81,7 +88,7 @@
 /**
  * Form to choose a group of views to export.
  */
-function views_export_export_form(&$form_state) {
+function views_export_export_form($form, &$form_state) {
   foreach ($form_state['exportables'] as $module => $views) {
     foreach ($views as $name => $data) {
       $options[$name] = $data['name'];
@@ -129,19 +136,24 @@
     '#value' => t('Export'),
   );
 
-  $form['#action'] = url('admin/build/views/tools/export/results');
+  $form['#action'] = url('admin/structure/views/tools/export/results');
   $form['#redirect'] = FALSE;
-  $form['#exportables'] = $form_state['exportables'];
+  if (isset($form_state['exportables'])) {
+    $form['#exportables'] = $form_state['exportables'];
+  }
   return $form;
 }
 
-function theme_views_export_export_form($form) {
+function theme_views_export_export_form(&$vars) {
+  $form = $vars['form'];
   $output = '';
-  $files = module_rebuild_cache();
+    // Get current list of modules.
+  $files = system_rebuild_module_data();
+
   $exportables = $form['#exportables'];
   $output .= drupal_render($form['tags']);
   $output .= drupal_render($form['apply']);
-  $output .= '<div class="clear-block">';
+  $output .= '<div class="clearfix">';
 
   foreach ($exportables as $module => $views) {
     $header = array(theme('table_select_header_cell'), $files[$module]->info['name'], t('Tag'), t('Description'));
@@ -152,11 +164,16 @@
       $rows[] = array(drupal_render($form['modules'][$module][$name]), $title, $view['tag'], '<div class="description">' . $view['desc'] . '</div>');
     }
     $output .= '<div class="export-container">';
-    $output .= theme('table', $header, $rows);
+    $output .= theme('table', array(
+      'header' => $header,
+      'rows' => $rows
+    ));
     $output .= "</div>\n";
   }
   $output .= '</div>';
-  drupal_add_css(drupal_get_path('module', 'views_export') . '/views_export.css');
+  $form['#attached']['css'] = array(drupal_add_css(drupal_get_path('module', 'views_export') . '/views_export.css'));
+
+  // FIXME: This call leads to a endless recursion
   $output .= drupal_render($form);
   return $output;
 }
@@ -164,10 +181,10 @@
 function views_export_export_form_apply(&$form, &$form_state) {
   $tags = $form_state['values']['tags'];
   if ($tags) {
-    drupal_goto('admin/build/views/tools/export', array('tags' => implode(',', $tags)));
+    drupal_goto('admin/structure/views/tools/export', array('tags' => implode(',', $tags)));
   }
   else {
-    drupal_goto('admin/build/views/tools/export');
+    drupal_goto('admin/structure/views/tools/export');
   }
 }
 
@@ -211,7 +228,7 @@
   ) + $types['textarea'];
 
   $api  = "/**\n";
-  $api .= " * Implementation of hook_views_api().\n";
+  $api .= " * Implements hook_views_api().\n";
   $api .= " */\n";
   $api .= "function @module_views_api() {\n";
   $api .= "  return array(\n";
@@ -249,8 +266,11 @@
   ) + $types['textarea'];
 
 
-  $form_state['output'] = theme('textarea', $element_info);
-  $form_state['output'] .= theme('textarea', $element_api);
-  $form_state['output'] .= theme('textarea', $element_hook);
+  $form_state['output'] = theme('textarea', array(
+    'element' => $element_info));
+  $form_state['output'] .= theme('textarea', array(
+    'element' => $element_api));
+  $form_state['output'] .= theme('textarea', array(
+    'element' => $element_hook));
 }
 

=== modified file 'views_ui.info'
--- views_ui.info	2009-10-17 18:33:18 +0000
+++ views_ui.info	2009-10-17 19:26:01 +0000
@@ -2,5 +2,6 @@
 name = Views UI
 description = Administrative interface to views. Without this module, you cannot create or edit your views.
 package = Views
-core = 6.x
+core = 7.x
 dependencies[] = views
+files[] = views_ui.module
\ No newline at end of file

=== modified file 'views_ui.module'
--- views_ui.module	2009-10-17 18:33:18 +0000
+++ views_ui.module	2009-10-19 05:17:54 +0000
@@ -6,7 +6,7 @@
  */
 
 /*
- * Implementation of hook_menu()
+ * Implements hook_menu().
  */
 function views_ui_menu() {
   $items = array();
@@ -22,36 +22,36 @@
 
   $convert = array('file' => 'includes/convert.inc') + $base;
 
-  $items['admin/build/views'] = $base + array(
+  $items['admin/structure/views'] = $base + array(
     'title' => 'Views',
     'page callback' => 'views_ui_list_views',
     'description' => 'Views are customized lists of content on your system; they are highly configurable and give you control over how lists of content are presented.',
     'type' => MENU_NORMAL_ITEM
   );
-  $items['admin/build/views/list'] = $base + array(
+  $items['admin/structure/views/list'] = $base + array(
     'title' => 'List',
     'page callback' => 'views_ui_list_views',
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'weight' => '-1'
   );
-  $items['admin/build/views/add'] = $base + array(
+  $items['admin/structure/views/add'] = $base + array(
     'title' => 'Add',
     'page callback' => 'views_ui_add_page',
     'type' => MENU_LOCAL_TASK
   );
-  $items['admin/build/views/import'] = $base + array(
+  $items['admin/structure/views/import'] = $base + array(
     'title' => 'Import',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('views_ui_import_page'),
     'type' => MENU_LOCAL_TASK
   );
-  $items['admin/build/views/tools'] = $base + array(
+  $items['admin/structure/views/tools'] = $base + array(
     'title' => 'Tools',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('views_ui_admin_tools'),
     'type' => MENU_LOCAL_TASK
   );
-  $items['admin/build/views/tools/basic'] = $base + array(
+  $items['admin/structure/views/tools/basic'] = $base + array(
     'title' => 'Basic',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('views_ui_admin_tools'),
@@ -59,113 +59,104 @@
     'weight' => -10,
   );
 
-  $items['admin/build/views/tools/convert'] = $convert + array(
+  $items['admin/structure/views/tools/convert'] = $convert + array(
     'title' => 'Convert',
     'description' => 'Convert stored Views 1 views.',
     'page callback' => 'views_ui_admin_convert',
     'type' => MENU_LOCAL_TASK,
     'weight' => 1,
   );
-  $items['admin/build/views1/delete'] = $convert + array(
+  $items['admin/structure/views1/delete'] = $convert + array(
     'title' => 'Delete view',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('views_ui_delete1_confirm', 4),
     'type' => MENU_CALLBACK,
   );
-  $items['admin/build/views1/convert'] = $convert + array(
+  $items['admin/structure/views1/convert'] = $convert + array(
     'title' => 'Convert view',
     'page callback' => 'views_ui_convert1',
     'page arguments' => array(4),
     'type' => MENU_CALLBACK,
   );
 
-  $items['admin/build/views/delete/%views_ui_cache'] = $callback + array(
+  $items['admin/structure/views/delete/%views_ui_cache'] = $callback + array(
     'title' => 'Delete view',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('views_ui_delete_confirm', 4),
   );
-  $items['admin/build/views/break-lock/%views_ui_cache'] = $callback + array(
+  $items['admin/structure/views/break-lock/%views_ui_cache'] = $callback + array(
     'title' => 'Delete view',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('views_ui_break_lock_confirm', 4),
   );
-  $items['admin/build/views/export/%views_ui_cache'] = $callback + array(
+  $items['admin/structure/views/export/%views_ui_cache'] = $callback + array(
     'page callback' => 'drupal_get_form',
     'page arguments' => array('views_ui_export_page', 4),
     'type' => MENU_LOCAL_TASK
   );
-  $items['admin/build/views/clone/%views_ui_cache'] = $callback + array(
+  $items['admin/structure/views/clone/%views_ui_cache'] = $callback + array(
     'page callback' => 'views_ui_clone_page',
     'page arguments' => array(4),
     'type' => MENU_LOCAL_TASK
   );
-  $items['admin/build/views/enable/%views_ui_default'] = $callback + array(
+  $items['admin/structure/views/enable/%views_ui_default'] = $callback + array(
     'page callback' => 'views_ui_enable_page',
     'page arguments' => array(4),
   );
-  $items['admin/build/views/disable/%views_ui_default'] = $callback + array(
+  $items['admin/structure/views/disable/%views_ui_default'] = $callback + array(
     'page callback' => 'views_ui_disable_page',
     'page arguments' => array(4),
   );
 
   // Many line items for editing a view.
-  $items['admin/build/views/edit/%views_ui_cache'] = $base + array(
+  $items['admin/structure/views/edit/%views_ui_cache'] = $base + array(
     'title' => 'Edit',
     'page callback' => 'views_ui_edit_page',
     'page arguments' => array(4),
     'type' => MENU_LOCAL_TASK
   );
-  // lots of little edit form pieces.
-  $items['admin/build/views/%views_ui_js/analyze/%views_ui_cache'] = $callback + array(
-    'page callback' => 'views_ui_analyze_view',
-    'page arguments' => array(3, 5),
-  );
-  $items['admin/build/views/%views_ui_js/details/%views_ui_cache'] = $callback + array(
-    'page callback' => 'views_ui_edit_details',
-    'page arguments' => array(3, 5),
-  );
-  $items['admin/build/views/%views_ui_js/add-display/%views_ui_cache'] = $callback + array(
-    'page callback' => 'views_ui_add_display',
-    'page arguments' => array(3, 5),
-  );
-  // Live preview
-  $items['admin/build/views/%views_ui_js/preview/%views_ui_cache'] = $callback + array(
-    'page callback' => 'views_ui_preview',
-    'page arguments' => array(3, 5),
-  );
+  foreach (array('analyze' => 'views_ui_analyze_view', 'details' => 'views_ui_edit_details', 'add-display' => 'views_ui_add_display', 'preview' => 'views_ui_preview', '%' => 'views_ui_ajax_form') as $menu => $menu_callback) {
+    $items['admin/structure/views/nojs/' . $menu . '/%views_ui_cache'] = $callback + array(
+      'page callback' => $menu_callback,
+      'page arguments' => array('nojs', 5),
+    );
+    $items['admin/structure/views/ajax/' . $menu . '/%views_ui_cache'] = $callback + array(
+      'page callback' => $menu_callback,
+      'page arguments' => array('ajax', 5),
+      'delivery callback' => 'views_ui_ajax_deliver',
+    );
+  }
 
   // autocompletes for handlers and such
   $items['admin/views/ajax/autocomplete/tag'] = $callback + array(
     'page callback' => 'views_ui_autocomplete_tag',
-  );
-
-
-  // Generic ajax callback
-  // display specific parameters
-  $items['admin/build/views/%views_ui_js/%/%views_ui_cache'] = $callback + array(
-    'page callback' => 'views_ui_ajax_form',
-    'page arguments' => array(3, 4, 5),
-  );
+    'access arguments' => array('administer views'),
+    'type' => MENU_CALLBACK,
+    'file' => 'includes/admin.inc',
+  );
+
+  $items['admin/structure/views/ajax/%/%views_ui_cache']['page arguments'] =
+  $items['admin/structure/views/nojs/%/%views_ui_cache']['page arguments'] = array(3, 4, 5);
 
   return $items;
 }
 
 /*
- * Implementation of hook_help()
+ * Implements hook_help().
  */
 function views_ui_help($path, $arg = '') {
   switch ($path) {
-    case 'admin/build/views/tools/convert':
+    case 'admin/structure/views/tools/convert':
       return '<p>' . t('The converter will make a best-effort attempt to convert a Views 1 view to Views 2. This conversion is not reliable; you will very likely have to make adjustments to your view to get it to match. You can import Views 1 views through the normal Import tab.') . '</p>';
   }
 }
 
 /*
- * Implementation of hook_theme()
+ * Implements hook_theme().
  */
 function views_ui_theme() {
   $path = drupal_get_path('module', 'views');
-  require_once "./$path/includes/admin.inc";
+  require_once DRUPAL_ROOT . "/$path/includes/admin.inc";
 
   return array(
     // edit a view
@@ -186,33 +177,31 @@
     ),
     'views_ui_rearrange_form' => array(
       'arguments' => array('form' => NULL),
-      'file' => 'includes/admin.inc',
     ),
 
     // list views
     'views_ui_list_views' => array(
+      'arguments' => array(
+        'views' => array(),
+        'help' => '',
+        'widgets' => '',
+        'help_type_icon' => '',
+      ),
       'template' => 'views-ui-list-views',
       'path' => "$path/theme",
     ),
-    'views_ui_list_views_form' => array(
-      'file' => 'includes/admin.inc',
-      'arguments' => array('form' => NULL),
-    ),
 
     // tab themes
     'views_tabset' => array(
       'arguments' => array('tabs' => NULL),
-      'file' => 'includes/tabs.inc',
     ),
     'views_tab' => array(
       'arguments' => array('body' => NULL),
-      'file' => 'includes/tabs.inc',
     ),
 
     // On behalf of a plugin
     'views_ui_style_plugin_table' => array(
       'arguments' => array('form' => NULL),
-      'file' => 'includes/admin.inc',
     ),
   );
 }
@@ -232,7 +221,14 @@
     if (!empty($view)) {
       // Check to see if someone else is already editing this view.
       global $user;
-      $view->locked = db_fetch_object(db_query("SELECT s.uid, v.updated FROM {views_object_cache} v INNER JOIN {sessions}  s ON v.sid = s.sid WHERE s.sid != '%s' and v.name = '%s' and v.obj = 'view' ORDER BY v.updated ASC", session_id(), $view->name));
+      $result = db_query("SELECT s.uid, v.updated FROM {views_object_cache} v INNER JOIN {sessions}  s ON v.sid = s.sid WHERE s.sid <> :sid and v.name = :name and v.obj = 'view' ORDER BY v.updated ASC",
+        array(
+          ':sid' => session_id(),
+          ':name' => $view->name,
+        ));
+      foreach ($result as $item) {
+        $view->locked = $item;
+      }
     }
   }
 
@@ -287,11 +283,56 @@
 }
 
 /**
- * Check to see if the incoming menu item is js capable or not.
+ * Package and send the result of a page callback to the browser as an AJAX
+ * response, and add the HTML.
+ *
+ * @param $page_callback_result
+ *   The result of a page callback. Can be one of:
+ *   - NULL: to indicate no content.
+ *   - An integer menu status constant: to indicate an error condition.
+ *   - A string of HTML content.
+ *   - A renderable array of content.
  */
-function views_ui_js_load($js) {
-  if ($js == 'ajax') {
-    return TRUE;
-  }
-  return 0;
+function views_ui_ajax_deliver($page_callback_result) {
+  $commands = array();
+  if (!isset($page_callback_result)) {
+    // Simply delivering an empty commands array is sufficient. This results
+    // in the AJAX request being completed, but nothing being done to the page.
+  }
+  elseif (is_int($page_callback_result)) {
+    switch ($page_callback_result) {
+      case MENU_NOT_FOUND:
+        $commands[] = ajax_command_alert(t('The requested page could not be found.'));
+        break;
+
+      case MENU_ACCESS_DENIED:
+        $commands[] = ajax_command_alert(t('You are not authorized to access this page.'));
+        break;
+
+      case MENU_SITE_OFFLINE:
+        $commands[] = ajax_command_alert(filter_xss_admin(variable_get('maintenance_mode_message',
+          t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal'))))));
+        break;
+    }
+  }
+  elseif (is_array($page_callback_result) && isset($page_callback_result['#type']) && ($page_callback_result['#type'] == 'ajax_commands')) {
+    // Complex AJAX callbacks can return a result that contains a specific
+    // set of commands to send to the browser. 
+    if (isset($page_callback_result['#ajax_commands'])) {
+      $commands = $page_callback_result['#ajax_commands'];
+    }
+  }
+  else {
+    // Like normal page callbacks, simple AJAX callbacks can return html
+    // content, as a string or renderable array, to replace what was previously
+    // there in the wrapper. In this case, in addition to the content, we want
+    // to add the status messages, but inside the new wrapper, so that they get
+    // replaced on subsequent AJAX calls for the same wrapper.
+    $html = is_string($page_callback_result) ? $page_callback_result : drupal_render($page_callback_result);
+    $commands[] = ajax_command_replace(NULL, $html);
+    $commands[] = ajax_command_prepend(NULL, theme('status_messages'));
+  }
+  $js = drupal_add_js();
+  $commands[] = ajax_command_settings($js['settings']['data']);
+  ajax_render($commands);
 }

