? .DS_Store
? ctools_d7.patch
Index: ctools.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/ctools.module,v
retrieving revision 1.31
diff -u -p -r1.31 ctools.module
--- ctools.module	17 Oct 2009 22:58:24 -0000	1.31
+++ ctools.module	18 Oct 2009 23:18:39 -0000
@@ -302,7 +302,7 @@ function ctools_break_phrase($str) {
     $object->operator = 'or';
     $object->value = preg_split('/[+ ]/', $str);
   }
-  else if (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) {
+  elseif (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) {
     $object->operator = 'and';
     $object->value = explode(',', $str);
   }
Index: includes/content.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/includes/content.inc,v
retrieving revision 1.15
diff -u -p -r1.15 content.inc
--- includes/content.inc	17 Oct 2009 22:58:25 -0000	1.15
+++ includes/content.inc	18 Oct 2009 23:18:40 -0000
@@ -81,7 +81,7 @@ function ctools_content_defaults($info, 
       $plugin['content types'] = array($plugin['name'] => $type);
     }
     // Otherwise, auto discover the function based upon pattern naming.
-    else if (function_exists($function_base . 'content_types')) {
+    elseif (function_exists($function_base . 'content_types')) {
       $plugin['content types'] = $function_base . 'content_types';
     }
   }
@@ -141,7 +141,7 @@ function ctools_content_get_subtypes($ty
     if (is_array($function)) {
       $subtypes = $function;
     }
-    else if (function_exists($function)) {
+    elseif (function_exists($function)) {
       // Cast to array to prevent errors from non-array returns.
       $subtypes = (array) $function($plugin);
     }
@@ -324,7 +324,7 @@ function ctools_content_admin_title($typ
   if (is_array($type)) {
     $plugin = $type;
   }
-  else if (is_string($type)) {
+  elseif (is_string($type)) {
     $plugin = ctools_get_content_type($type);
   }
   else {
@@ -339,10 +339,10 @@ function ctools_content_admin_title($typ
 
     return $function($subtype, $conf, $pane_context);
   }
-  else if (isset($plugin['admin title'])) {
+  elseif (isset($plugin['admin title'])) {
     return $plugin['admin title'];
   }
-  else if (isset($plugin['title'])) {
+  elseif (isset($plugin['title'])) {
     return $plugin['title'];
   }
 }
@@ -377,7 +377,7 @@ function ctools_content_get_defaults($pl
   if (isset($plugin['defaults'])) {
     $defaults = $plugin['defaults'];
   }
-  else if (isset($subtype['defaults'])) {
+  elseif (isset($subtype['defaults'])) {
     $defaults = $subtype['defaults'];
   }
   if (isset($defaults)) {
@@ -386,7 +386,7 @@ function ctools_content_get_defaults($pl
         return $return;
       }
     }
-    else if (is_array($defaults)) {
+    elseif (is_array($defaults)) {
       return $defaults;
     }
   }
@@ -525,7 +525,7 @@ function ctools_content_form($op, $form_
     _ctools_content_create_form_info($form_info, $plugin['add form'], $plugin, $subtype, $op);
   }
   // Use the edit form for the add form if add form was completely left off.
-  else if (isset($plugin['edit form'])) {
+  elseif (isset($plugin['edit form'])) {
     _ctools_content_create_form_info($form_info, $plugin['edit form'], $plugin, $subtype, $op);
   }
 
@@ -543,7 +543,7 @@ function _ctools_content_create_form_inf
     if (empty($subtype['title'])) {
       $title = t('Configure');
     }
-    else if ($op == 'add') {
+    elseif ($op == 'add') {
       $title = t('Configure new !subtype_title', array('!subtype_title' => $subtype['title']));
     }
     else {
@@ -558,7 +558,7 @@ function _ctools_content_create_form_inf
       ),
     );
   }
-  else if (is_array($info)) {
+  elseif (is_array($info)) {
     $form_info['order'] = array();
     $form_info['forms'] = array();
     $count = 0;
Index: includes/context-task-handler.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/includes/context-task-handler.inc,v
retrieving revision 1.26
diff -u -p -r1.26 context-task-handler.inc
--- includes/context-task-handler.inc	17 Oct 2009 22:58:25 -0000	1.26
+++ includes/context-task-handler.inc	18 Oct 2009 23:18:40 -0000
@@ -91,13 +91,15 @@ function ctools_context_handler_render($
         }
 
         // Only directly output if $page was set to true.
+        /*
         if (!empty($info['no_blocks'])) {
           print theme('page', $info['content'], FALSE);
           return;
         }
         else {
+        */
           return $info['content'];
-        }
+        /*}*/
       }
     }
   }
Index: includes/context.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/includes/context.inc,v
retrieving revision 1.36
diff -u -p -r1.36 context.inc
--- includes/context.inc	12 Oct 2009 12:42:53 -0000	1.36
+++ includes/context.inc	18 Oct 2009 23:18:40 -0000
@@ -452,7 +452,7 @@ function _ctools_context_get_converters(
   if (is_array($plugin['convert list'])) {
     $converters = $plugin['convert list'];
   }
-  else if ($function = ctools_plugin_get_function($plugin, 'convert list')) {
+  elseif ($function = ctools_plugin_get_function($plugin, 'convert list')) {
     $converters = (array) $function();
   }
 
@@ -1222,7 +1222,7 @@ function ctools_context_replace_form(&$f
       if (is_array($plugin['placeholder form'])) {
         $form[$cid] = $plugin['placeholder form'];
       }
-      else if (function_exists($plugin['placeholder form'])) {
+      elseif (function_exists($plugin['placeholder form'])) {
         $widget = $plugin['placeholder form']($info['settings']);
         if ($widget) {
           $form[$cid] = $widget;
@@ -1337,7 +1337,7 @@ function ctools_access_group_summary($ac
 }
 
 /**
- * Determine if the current user has access via  plugin.
+ * Determine if the current user has access via a plugin.
  *
  * @param $settings
  *   An array of settings theoretically set by the user.
@@ -1382,7 +1382,7 @@ function ctools_access($settings, $conte
       // Pass if 'or' and this rule passed.
       return TRUE;
     }
-    else if (!$pass && $settings['logic'] == 'and') {
+    elseif (!$pass && $settings['logic'] == 'and') {
       // Fail if 'and' and htis rule failed.
       return FALSE;
     }
@@ -1435,7 +1435,7 @@ function ctools_access_new_test($plugin)
     if (is_array($default)) {
       $test['settings'] = $default;
     }
-    else if (function_exists($default)) {
+    elseif (function_exists($default)) {
       $test['settings'] = $default();
     }
     else {
Index: includes/export.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/includes/export.inc,v
retrieving revision 1.22
diff -u -p -r1.22 export.inc
--- includes/export.inc	17 Oct 2009 22:58:25 -0000	1.22
+++ includes/export.inc	18 Oct 2009 23:18:41 -0000
@@ -121,7 +121,7 @@ function ctools_export_load_object($tabl
   if ($type == 'names') {
     $query->condition($export['key'], $args, 'IN');
   }
-  else if ($type == 'conditions') {
+  elseif ($type == 'conditions') {
     foreach ($args as $key => $value) {
       if (isset($schema['fields'][$key])) {
         $query->condition($key, $value);
@@ -162,7 +162,7 @@ function ctools_export_load_object($tabl
           }
         }
       }
-      else if ($type == 'names') {
+      elseif ($type == 'names') {
         if (!in_array($object->{$export['key']}, $args)) {
           continue;
         }
@@ -383,7 +383,7 @@ function ctools_var_export($var, $prefix
       $output .= ')';
     }
   }
-  else if (is_bool($var)) {
+  elseif (is_bool($var)) {
     $output = $var ? 'TRUE' : 'FALSE';
   }
   else {
@@ -587,7 +587,7 @@ function ctools_export_new_object($table
     if (isset($info['object default'])) {
       $object->$field = $info['object default'];
     }
-    else if (isset($info['default'])) {
+    elseif (isset($info['default'])) {
       $object->$field = $info['default'];
     }
     else {
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/includes/menu.inc,v
retrieving revision 1.5
diff -u -p -r1.5 menu.inc
--- includes/menu.inc	17 Oct 2009 22:58:25 -0000	1.5
+++ includes/menu.inc	18 Oct 2009 23:18:41 -0000
@@ -449,17 +449,15 @@ function ctools_menu_get_active_help() {
   $arg = drupal_help_arg(arg(NULL));
   $empty_arg = drupal_help_arg();
 
-  foreach (module_list() as $name) {
-    if (module_hook($name, 'help')) {
-      // Lookup help for this path.
-      if ($help = module_invoke($name, 'help', $router_path, $arg)) {
-        $output .= $help ."\n";
-      }
-      // Add "more help" link on admin pages if the module provides a
-      // standalone help page.
-      if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#'. $arg[2], $empty_arg) && $help) {
-        $output .= theme("more_help_link", url('admin/help/'. $arg[2]));
-      }
+  foreach (module_implements('help') as $name) {
+    // Lookup help for this path.
+    if ($help = module_invoke($name, 'help', $router_path, $arg)) {
+      $output .= $help ."\n";
+    }
+    // Add "more help" link on admin pages if the module provides a
+    // standalone help page.
+    if ($arg[0] == "admin" && module_exists('help') && module_invoke($name, 'help', 'admin/help#'. $arg[2], $empty_arg) && $help) {
+      $output .= theme("more_help_link", url('admin/help/'. $arg[2]));
     }
   }
   return $output;
Index: includes/modal.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/includes/modal.inc,v
retrieving revision 1.9
diff -u -p -r1.9 modal.inc
--- includes/modal.inc	13 Oct 2009 20:06:56 -0000	1.9
+++ includes/modal.inc	18 Oct 2009 23:18:41 -0000
@@ -74,7 +74,7 @@ function ctools_modal_add_plugin_js($plu
         if (file_exists($file)) {
           $js[$file] = TRUE;
         }
-        else if (file(exists($subtype['path'] . '/' . $file))) {
+        elseif (file(exists($subtype['path'] . '/' . $file))) {
           $js[$subtype['path'] . '/' . $file] = TRUE;
         }
       }
@@ -84,7 +84,7 @@ function ctools_modal_add_plugin_js($plu
         if (file_exists($file)) {
           $css[$file] = TRUE;
         }
-        else if (file(exists($subtype['path'] . '/' . $file))) {
+        elseif (file(exists($subtype['path'] . '/' . $file))) {
           $css[$subtype['path'] . '/' . $file] = TRUE;
         }
       }
Index: includes/plugins.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/includes/plugins.inc,v
retrieving revision 1.22
diff -u -p -r1.22 plugins.inc
--- includes/plugins.inc	17 Oct 2009 22:58:25 -0000	1.22
+++ includes/plugins.inc	18 Oct 2009 23:18:41 -0000
@@ -112,9 +112,9 @@ function ctools_plugin_api_include($owne
       if (!isset($plugin_info['file'])) {
         $plugin_info['file'] = "$module.$api.inc";
       }
-      if (file_exists("./$plugin_info[path]/$plugin_info[file]")) {
+      if (file_exists(DRUPAL_ROOT . "/$plugin_info[path]/$plugin_info[file]")) {
         $plugin_info[$module]['included'] = TRUE;
-        require_once "./$plugin_info[path]/$plugin_info[file]";
+        require_once DRUPAL_ROOT . "/$plugin_info[path]/$plugin_info[file]";
       }
       $info[$module] = $plugin_info;
     }
@@ -225,7 +225,7 @@ function ctools_plugin_load_includes($in
   if (isset($info['extension'])) {
     $extension = $info['extension'];
   }
-  else if (isset($info['info file'])) {
+  elseif (isset($info['info file'])) {
     $extension = 'info';
   }
   else {
@@ -378,7 +378,7 @@ function _ctools_process_data($result, $
       if (is_array($info['defaults'])) {
         $result[$name] += $info['defaults'];
       }
-      else if (function_exists($info['defaults'])) {
+      elseif (function_exists($info['defaults'])) {
         $info['defaults']($info, $result[$name]);
       }
     }
Index: includes/wizard.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/includes/wizard.inc,v
retrieving revision 1.14
diff -u -p -r1.14 wizard.inc
--- includes/wizard.inc	8 Oct 2009 11:09:56 -0000	1.14
+++ includes/wizard.inc	18 Oct 2009 23:18:41 -0000
@@ -49,7 +49,7 @@
 function ctools_wizard_multistep_form($form_info, $step, &$form_state) {
   // allow order array to be optional
   if (empty($form_info['order'])) {
-    foreach($form_info['forms'] as $step_id => $params) {
+    foreach ($form_info['forms'] as $step_id => $params) {
       $form_info['order'][$step_id] = $params['title'];
     }
   }
@@ -139,7 +139,7 @@ function ctools_wizard_multistep_form($f
         return drupal_redirect_form(array(), $form_state['redirect']);
       }
     }
-    else if (isset($form_state['ajax next'])) {
+    elseif (isset($form_state['ajax next'])) {
       // Clear a few items off the form state so we don't double post:
       $next = $form_state['ajax next'];
       unset($form_state['ajax next']);
@@ -266,7 +266,7 @@ function ctools_wizard_wrapper(&$form, &
         '#attributes' => $button_attributes,
       );
     }
-    else if (empty($form_state['next'])) {
+    elseif (empty($form_state['next'])) {
       $form['buttons']['return'] = array(
         '#type' => 'submit',
         '#value' => $form_info['finish text'],
@@ -337,13 +337,13 @@ function ctools_wizard_submit(&$form, &$
       if ($type == 'cancel' && isset($form_state['form_info']['cancel path'])) {
         $form_state['redirect'] = $form_state['form_info']['cancel path'];
       }
-      else if ($type == 'next') {
+      elseif ($type == 'next') {
         $form_state['redirect'] = ctools_wizard_get_path($form_state['form_info'], $form_state['clicked_button']['#next']);
       }
-      else if (isset($form_state['form_info']['return path'])) {
+      elseif (isset($form_state['form_info']['return path'])) {
         $form_state['redirect'] = $form_state['form_info']['return path'];
       }
-      else if ($type == 'finish' && isset($form_state['form_info']['cancel path'])) {
+      elseif ($type == 'finish' && isset($form_state['form_info']['cancel path'])) {
         $form_state['redirect'] = $form_state['form_info']['cancel path'];
       }
     }
@@ -378,7 +378,7 @@ function ctools_wizard_defaults(&$form_i
   );
   $form_info =  $form_info + $defaults;
   // set form callbacks if they aren't defined
-  foreach($form_info['forms'] as $step => $params) {
+  foreach ($form_info['forms'] as $step => $params) {
     if (!$params['form id']) {
        $form_callback = $hook . '_' . $step . '_form';
        $form_info['forms'][$step]['form id'] = $form_callback;
@@ -394,7 +394,7 @@ function ctools_wizard_defaults(&$form_i
     'finish callback' => '_finish',
   );
 
-  foreach($callbacks as $key => $callback) {
+  foreach ($callbacks as $key => $callback) {
     // never overwrite if explicity defined
     if (empty($form_info[$key])) {
       $wizard_callback = $hook . $callback;
Index: js/collapsible-div.js
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/js/collapsible-div.js,v
retrieving revision 1.9
diff -u -p -r1.9 collapsible-div.js
--- js/collapsible-div.js	12 Oct 2009 12:42:53 -0000	1.9
+++ js/collapsible-div.js	18 Oct 2009 23:18:42 -0000
@@ -230,9 +230,11 @@
   /**
    * Support Drupal's 'behaviors' system for binding.
    */
-  Drupal.behaviors.CToolsCollapsible = function(context) {
-    $('.ctools-collapsible-container:not(.ctools-collapsible-processed)', context)
-      .each(Drupal.CTools.bindCollapsible)
-      .addClass('ctools-collapsible-processed');
-  }
+  Drupal.behaviors.CToolsCollapsible = {
+    attach: function(context) {
+      $('.ctools-collapsible-container:not(.ctools-collapsible-processed)', context)
+        .each(Drupal.CTools.bindCollapsible)
+        .addClass('ctools-collapsible-processed');
+    }
+  };
 })(jQuery);
Index: js/dependent.js
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/js/dependent.js,v
retrieving revision 1.6
diff -u -p -r1.6 dependent.js
--- js/dependent.js	12 Oct 2009 12:42:53 -0000	1.6
+++ js/dependent.js	18 Oct 2009 23:18:42 -0000
@@ -180,23 +180,25 @@
     }
   }
 
-  Drupal.behaviors.CToolsDependent = function (context) {
-    Drupal.CTools.dependent.autoAttach();
+  Drupal.behaviors.CToolsDependent = {
+    attach: function (context) {
+      Drupal.CTools.dependent.autoAttach();
 
-    // 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.ctools-master-dependent:not(.ctools-processed)")
-      .addClass('ctools-processed')
-      .change(function() {
-        var val = $(this).val();
-        if (val == 'all') {
-          $('.ctools-dependent-all').show(0);
-        }
-        else {
-          $('.ctools-dependent-all').hide(0);
-          $('.ctools-dependent-' + val).show(0);
-        }
-      })
-      .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.ctools-master-dependent:not(.ctools-processed)")
+        .addClass('ctools-processed')
+        .change(function() {
+          var val = $(this).val();
+          if (val == 'all') {
+            $('.ctools-dependent-all').show(0);
+          }
+          else {
+            $('.ctools-dependent-all').hide(0);
+            $('.ctools-dependent-' + val).show(0);
+          }
+        })
+        .trigger('change');
+    }
+  };
 })(jQuery);
Index: js/dropdown.js
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/js/dropdown.js,v
retrieving revision 1.5
diff -u -p -r1.5 dropdown.js
--- js/dropdown.js	12 Oct 2009 12:42:53 -0000	1.5
+++ js/dropdown.js	18 Oct 2009 23:18:42 -0000
@@ -23,64 +23,66 @@
  */
 
 (function ($) {
-  Drupal.behaviors.CToolsDropdown = function() {
-    $('div.ctools-dropdown:not(.ctools-dropdown-processed)')
-      .removeClass('ctools-dropdown-no-js')
-      .addClass('ctools-dropdown-processed')
-      .each(function() {
-        var $dropdown = $(this);
-        var open = false;
-        var hovering = false;
-        var timerID = 0;
-
-        var toggle = function(close) {
-          // if it's open or we're told to close it, close it.
-          if (open || close) {
-            // If we're just toggling it, close it immediately.
-            if (!close) {
-              open = false;
-              $("div.ctools-dropdown-container", $dropdown).slideUp(100);
+  Drupal.behaviors.CToolsDropdown = {
+    attach: function() {
+      $('div.ctools-dropdown:not(.ctools-dropdown-processed)')
+        .removeClass('ctools-dropdown-no-js')
+        .addClass('ctools-dropdown-processed')
+        .each(function() {
+          var $dropdown = $(this);
+          var open = false;
+          var hovering = false;
+          var timerID = 0;
+      
+          var toggle = function(close) {
+            // if it's open or we're told to close it, close it.
+            if (open || close) {
+              // If we're just toggling it, close it immediately.
+              if (!close) {
+                open = false;
+                $("div.ctools-dropdown-container", $dropdown).slideUp(100);
+              }
+              else {
+                // If we were told to close it, wait half a second to make
+                // sure that's what the user wanted.
+                // Clear any previous timer we were using.
+                if (timerID) {
+                  clearTimeout(timerID);
+                }
+                timerID = setTimeout(function() {
+                  if (!hovering) {
+                    open = false;
+                    $("div.ctools-dropdown-container", $dropdown).slideUp(100);
+                  }}, 500);
+              }
             }
             else {
-              // If we were told to close it, wait half a second to make
-              // sure that's what the user wanted.
-              // Clear any previous timer we were using.
-              if (timerID) {
-                clearTimeout(timerID);
-              }
-              timerID = setTimeout(function() {
-                if (!hovering) {
-                  open = false;
-                  $("div.ctools-dropdown-container", $dropdown).slideUp(100);
-                }}, 500);
+              // open it.
+              open = true;
+              $("div.ctools-dropdown-container", $dropdown)
+                .animate({height: "show", opacity: "show"}, 100);
             }
           }
-          else {
-            // open it.
-            open = true;
-            $("div.ctools-dropdown-container", $dropdown)
-              .animate({height: "show", opacity: "show"}, 100);
-          }
-        }
-        $("a.ctools-dropdown-link", $dropdown).click(function() {
-            toggle();
-            return false;
-          });
-
-        $dropdown.hover(
-          function() {
-            hovering = true;
-          }, // hover in
-          function() { // hover out
-            hovering = false;
-            toggle(true);
-            return false;
-          });
-          // @todo -- just use CSS for this noise.
-        $("div.ctools-dropdown-container a").hover(
-          function() { $(this).addClass('ctools-dropdown-hover'); },
-          function() { $(this).removeClass('ctools-dropdown-hover'); }
-          );
-      });
+          $("a.ctools-dropdown-link", $dropdown).click(function() {
+              toggle();
+              return false;
+            });
+      
+          $dropdown.hover(
+            function() {
+              hovering = true;
+            }, // hover in
+            function() { // hover out
+              hovering = false;
+              toggle(true);
+              return false;
+            });
+            // @todo -- just use CSS for this noise.
+          $("div.ctools-dropdown-container a").hover(
+            function() { $(this).addClass('ctools-dropdown-hover'); },
+            function() { $(this).removeClass('ctools-dropdown-hover'); }
+            );
+        });
+    }
   };
 })(jQuery);
Index: js/modal.js
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/js/modal.js,v
retrieving revision 1.20
diff -u -p -r1.20 modal.js
--- js/modal.js	13 Oct 2009 20:06:56 -0000	1.20
+++ js/modal.js	18 Oct 2009 23:18:42 -0000
@@ -189,39 +189,41 @@
   /**
    * Bind links that will open modals to the appropriate function.
    */
-  Drupal.behaviors.CToolsModal = function(context) {
-    // Bind links
-    $('a.ctools-use-modal:not(.ctools-use-modal-processed)', context)
-      .addClass('ctools-use-modal-processed')
-      .click(Drupal.CTools.Modal.clickAjaxLink);
-
-    // Bind buttons
-    $('input.ctools-use-modal:not(.ctools-use-modal-processed), button.ctools-use-modal:not(.ctools-use-modal-processed)', context)
-      .addClass('ctools-use-modal-processed')
-      .click(Drupal.CTools.Modal.clickAjaxButton);
-
-    if ($(context).attr('id') == 'modal-content') {
-      // Bind submit links in the modal form.
-      $('form:not(.ctools-use-modal-processed)', context)
+  Drupal.behaviors.CToolsModal = {
+    attach: function(context) {
+      // Bind links
+      $('a.ctools-use-modal:not(.ctools-use-modal-processed)', context)
         .addClass('ctools-use-modal-processed')
-        .submit(Drupal.CTools.Modal.submitAjaxForm);
-      // add click handlers so that we can tell which button was clicked,
-      // because the AJAX submit does not set the values properly.
-
-      $('input[type="submit"]:not(.ctools-use-modal-processed), button:not(.ctools-use-modal-processed)', context)
+        .click(Drupal.CTools.Modal.clickAjaxLink);
+      
+      // Bind buttons
+      $('input.ctools-use-modal:not(.ctools-use-modal-processed), button.ctools-use-modal:not(.ctools-use-modal-processed)', context)
         .addClass('ctools-use-modal-processed')
-        .click(function() {
-          if (Drupal.autocompleteSubmit && !Drupal.autocompleteSubmit()) {
-            return false;
-          }
-
-          // Make sure it knows our button.
-          if (!$(this.form).hasClass('ctools-ajaxing')) {
-            this.form.clk = this;
-            $(this).after('<div class="ctools-ajaxing"> &nbsp; </div>');
-          }
-        });
-
+        .click(Drupal.CTools.Modal.clickAjaxButton);
+      
+      if ($(context).attr('id') == 'modal-content') {
+        // Bind submit links in the modal form.
+        $('form:not(.ctools-use-modal-processed)', context)
+          .addClass('ctools-use-modal-processed')
+          .submit(Drupal.CTools.Modal.submitAjaxForm);
+        // add click handlers so that we can tell which button was clicked,
+        // because the AJAX submit does not set the values properly.
+      
+        $('input[type="submit"]:not(.ctools-use-modal-processed), button:not(.ctools-use-modal-processed)', context)
+          .addClass('ctools-use-modal-processed')
+          .click(function() {
+            if (Drupal.autocompleteSubmit && !Drupal.autocompleteSubmit()) {
+              return false;
+            }
+      
+            // Make sure it knows our button.
+            if (!$(this.form).hasClass('ctools-ajaxing')) {
+              this.form.clk = this;
+              $(this).after('<div class="ctools-ajaxing"> &nbsp; </div>');
+            }
+          });
+      
+      }
     }
   };
 
Index: page_manager/page_manager.admin.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/page_manager/page_manager.admin.inc,v
retrieving revision 1.34
diff -u -p -r1.34 page_manager.admin.inc
--- page_manager/page_manager.admin.inc	15 Oct 2009 18:38:14 -0000	1.34
+++ page_manager/page_manager.admin.inc	18 Oct 2009 23:18:43 -0000
@@ -595,7 +595,7 @@ function page_manager_get_operations($pa
       if (isset($plugin['add features'][$id])) {
         $result['actions']['children']['configure']['form']['order'][$id] = $plugin['add features'][$id];
       }
-      else if (isset($plugin['required forms'][$id])) {
+      elseif (isset($plugin['required forms'][$id])) {
         $result['actions']['children']['configure']['form']['order'][$id] = $plugin['required forms'][$id];
       }
     }
@@ -693,7 +693,7 @@ function page_manager_get_handler_operat
         ),
       );
     }
-    else if ($handler->export_type != EXPORT_IN_CODE) {
+    elseif ($handler->export_type != EXPORT_IN_CODE) {
       $actions['delete'] = array(
         'title' => t('Delete'),
         'description' => t('Remove this variant from the page completely.'),
@@ -1061,7 +1061,7 @@ function page_manager_render_operations(
       if ($id == $first) {
         $class[] = 'operation-first';
       }
-      else if ($id == $last) {
+      elseif ($id == $last) {
         $class[] = 'operation-last';
       }
 
Index: page_manager/page_manager.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/page_manager/page_manager.module,v
retrieving revision 1.23
diff -u -p -r1.23 page_manager.module
--- page_manager/page_manager.module	18 Oct 2009 01:22:28 -0000	1.23
+++ page_manager/page_manager.module	18 Oct 2009 23:18:43 -0000
@@ -468,7 +468,7 @@ function page_manager_get_default_task_h
       $handlers = $subtask['default handlers'];
     }
   }
-  else if (isset($task['default handlers'])) {
+  elseif (isset($task['default handlers'])) {
     $handlers = $task['default handlers'];
   }
 
@@ -501,10 +501,10 @@ function page_manager_compare_task_handl
     $handlers[$name]->export_type = EXPORT_IN_CODE;
     return $handlers[$name];
   }
-  else if (isset($result[$name]) && !isset($handlers[$name])) {
+  elseif (isset($result[$name]) && !isset($handlers[$name])) {
     return $result[$name];
   }
-  else if (isset($result[$name]) && isset($handlers[$name])) {
+  elseif (isset($result[$name]) && isset($handlers[$name])) {
     if ($result[$name]->export_type & EXPORT_IN_DATABASE) {
       $result[$name]->type = t('Overridden');
       $result[$name]->export_type = $result[$name]->export_type | EXPORT_IN_CODE;
@@ -645,7 +645,7 @@ function page_manager_new_task_handler($
     if (is_array($plugin['default conf'])) {
       $handler->conf = $plugin['default conf'];
     }
-    else if (function_exists($plugin['default conf'])) {
+    elseif (function_exists($plugin['default conf'])) {
       $handler->conf = $plugin['default conf']($handler);
     }
   }
Index: page_manager/plugins/tasks/page.admin.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/page_manager/plugins/tasks/page.admin.inc,v
retrieving revision 1.23
diff -u -p -r1.23 page.admin.inc
--- page_manager/plugins/tasks/page.admin.inc	17 Oct 2009 22:58:24 -0000	1.23
+++ page_manager/plugins/tasks/page.admin.inc	18 Oct 2009 23:18:44 -0000
@@ -97,7 +97,7 @@ function page_manager_page_menu(&$items,
         $page_arguments[]   = $position;
         $access_arguments[] = $position;
       }
-      else if ($bit[0] != '!') {
+      elseif ($bit[0] != '!') {
         $path[] = $bit;
       }
 
@@ -236,10 +236,10 @@ function page_manager_page_add_subtask($
         if (isset($form_info['add order'][$id])) {
           $form_info['order'][$id] = $form_info['add order'][$id];
         }
-        else if (isset($handler_plugin['add features'][$id])) {
+        elseif (isset($handler_plugin['add features'][$id])) {
           $form_info['order'][$id] = $handler_plugin['add features'][$id];
         }
-        else if (isset($handler_plugin['required forms'][$id])) {
+        elseif (isset($handler_plugin['required forms'][$id])) {
           $form_info['order'][$id] = $handler_plugin['required forms'][$id];
         }
       }
@@ -423,7 +423,7 @@ function page_manager_page_form_basic(&$
       '#description' => t('To set this panel as your home page you must create a unique path name with no % placeholders in the path. The current site home page is set to %homepage.', array('%homepage' => '/' . $frontpage)),
     );
   }
-  else if ($path == $frontpage) {
+  elseif ($path == $frontpage) {
     $form['frontpage_markup'] = array(
       '#value' => '<b>' . t('This page is currently set to be your site home page.') . '</b>',
     );
@@ -507,7 +507,7 @@ function page_manager_page_form_basic_va
       }
       $path[] = '%';
     }
-    else if ($bit[0] == '!') {
+    elseif ($bit[0] == '!') {
       $found = TRUE;
     }
     else {
@@ -845,7 +845,7 @@ function page_manager_page_form_argument
     if (isset($page->temporary_arguments[$keyword]) && !empty($form_state['allow temp'])) {
       $conf = $page->temporary_arguments[$keyword];
     }
-    else if (isset($page->arguments[$keyword])) {
+    elseif (isset($page->arguments[$keyword])) {
       $conf = $page->arguments[$keyword];
     }
 
@@ -1131,7 +1131,7 @@ function page_manager_page_argument_form
     if (is_array($plugin['default'])) {
       $settings = $plugin['default'];
     }
-    else if (function_exists($plugin['default'])) {
+    elseif (function_exists($plugin['default'])) {
       $settings = $plugin['default']();
     }
   }
@@ -1158,7 +1158,7 @@ function page_manager_page_argument_form
   if (isset($page->temporary_arguments[$keyword])) {
     $conf = $page->temporary_arguments[$keyword];
   }
-  else if (isset($page->arguments[$keyword])) {
+  elseif (isset($page->arguments[$keyword])) {
     $conf = $page->temporary_arguments[$keyword] = $page->arguments[$keyword];
   }
 
Index: page_manager/plugins/tasks/page.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/page_manager/plugins/tasks/page.inc,v
retrieving revision 1.20
diff -u -p -r1.20 page.inc
--- page_manager/plugins/tasks/page.inc	17 Oct 2009 22:58:24 -0000	1.20
+++ page_manager/plugins/tasks/page.inc	18 Oct 2009 23:18:45 -0000
@@ -191,7 +191,7 @@ function page_manager_page_build_subtask
       'form' => 'page_manager_page_form_delete',
     );
   }
-  else if ($page->export_type != EXPORT_IN_CODE) {
+  elseif ($page->export_type != EXPORT_IN_CODE) {
     $operations['actions']['children']['delete'] = array(
       'title' => t('Delete'),
       'description' => t('Remove this page from your system completely.'),
@@ -274,7 +274,7 @@ function page_manager_page_execute($subt
       $contexts[$arg->id] = $arg;
       $args[] = $arg->original_argument;
     }
-    else if ($count) {
+    elseif ($count) {
       $args[] = $arg;
     }
   }
@@ -627,7 +627,7 @@ function page_manager_page_admin_summary
   if ($path == $front) {
     $message = t('This is your site home page.');
   }
-  else if (!empty($page->make_frontpage)) {
+  elseif (!empty($page->make_frontpage)) {
     $message = t('This page is set to become your site home page.');
   }
 
Index: page_manager/theme/page_manager.theme.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/page_manager/theme/page_manager.theme.inc,v
retrieving revision 1.7
diff -u -p -r1.7 page_manager.theme.inc
--- page_manager/theme/page_manager.theme.inc	18 Oct 2009 01:22:28 -0000	1.7
+++ page_manager/theme/page_manager.theme.inc	18 Oct 2009 23:18:45 -0000
@@ -41,10 +41,10 @@ function template_preprocess_page_manage
     $vars['locked'] = theme('page_manager_lock', $page);
     $vars['changed'] = theme('page_manager_changed', t('Locked'), t('This page is being edited by another user and you cannot make changes to it.'));
   }
-  else if (!empty($page->new)) {
+  elseif (!empty($page->new)) {
     $vars['changed'] = theme('page_manager_changed', t('New'), t('This page is newly created and has not yet been saved to the database. It will not be available until you save it.'));
   }
-  else if (!empty($page->changed)) {
+  elseif (!empty($page->changed)) {
     $vars['changed'] = theme('page_manager_changed', t('Changed'), t('This page has been modified, but these modifications are not yet live. While modifying this page, it is locked from modification by other users.'));
   }
 
Index: plugins/access/perm.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/plugins/access/perm.inc,v
retrieving revision 1.7
diff -u -p -r1.7 perm.inc
--- plugins/access/perm.inc	12 Oct 2009 12:42:53 -0000	1.7
+++ plugins/access/perm.inc	18 Oct 2009 23:18:45 -0000
@@ -27,12 +27,10 @@ function ctools_perm_ctools_access() {
 function ctools_perm_ctools_access_settings(&$form, &$form_state, $conf) {
   $perms = array();
   // Get list of permissions
-  foreach (module_list(FALSE, FALSE, TRUE) as $module) {
+  foreach (module_implements('permission') as $module) {
     // By keeping them keyed by module we can use optgroups with the
     // 'select' type.
-    if ($permissions = module_invoke($module, 'perm')) {
-      $perms[$module] = drupal_map_assoc($permissions);
-    }
+    $perms[$module] = drupal_map_assoc(module_invoke($module, 'permission'));
   }
 
   $form['settings']['perm'] = array(
Index: plugins/arguments/uid.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/plugins/arguments/uid.inc,v
retrieving revision 1.11
diff -u -p -r1.11 uid.inc
--- plugins/arguments/uid.inc	12 Oct 2009 12:42:53 -0000	1.11
+++ plugins/arguments/uid.inc	18 Oct 2009 23:18:45 -0000
@@ -45,7 +45,7 @@ function ctools_argument_uid_context($ar
     return NULL;
   }
 
-  $account = user_load(array('uid' => $arg));
+  $account = user_load('uid' => $arg);
   if (!$account) {
     return NULL;
   }
Index: plugins/content_types/block/block.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/plugins/content_types/block/block.inc,v
retrieving revision 1.11
diff -u -p -r1.11 block.inc
--- plugins/content_types/block/block.inc	18 Oct 2009 01:22:28 -0000	1.11
+++ plugins/content_types/block/block.inc	18 Oct 2009 23:18:45 -0000
@@ -31,9 +31,8 @@ function ctools_block_ctools_content_typ
  */
 function ctools_block_content_type_content_types() {
   $types = array();
-  foreach (module_list() as $module) {
-    $module_blocks = module_invoke($module, 'block', 'list');
-    if ($module_blocks) {
+  foreach (module_implements('block') as $module) {
+    if ($module_blocks = module_invoke($module, 'block', 'list')) {
       foreach ($module_blocks as $delta => $block) {
         // strip_tags used because it goes through check_plain and that
         // just looks bad.
@@ -122,7 +121,7 @@ function ctools_block_content_type_rende
       $regexp     = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($block_visibility->pages, '/')) .')$/';
       $page_match = !($block_visibility->visibility xor preg_match($regexp, $path));
     }
-    else if (module_exists('php')) {
+    elseif (module_exists('php')) {
       $page_match = php_eval($block_visibility->pages);
     }
   }
@@ -203,7 +202,7 @@ function ctools_block_content_type_edit_
 //    if (!empty($form['#parents'])) {
 //      $form['#parents'] = array_merge(array('configuration', 'block_settings'), $form['#parents']);
 //    }
-//    else if (empty($form['#tree'])) {
+//    elseif (empty($form['#tree'])) {
 //      $form['#parents'] = array('configuration', 'block_settings', $key);
 //    }
 //  }
Index: plugins/content_types/node_context/node_comments.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/plugins/content_types/node_context/node_comments.inc,v
retrieving revision 1.4
diff -u -p -r1.4 node_comments.inc
--- plugins/content_types/node_context/node_comments.inc	17 Oct 2009 22:58:26 -0000	1.4
+++ plugins/content_types/node_context/node_comments.inc	18 Oct 2009 23:18:45 -0000
@@ -154,13 +154,13 @@ function ctools_comment_render($node, $c
     if ($mode == COMMENT_MODE_FLAT_COLLAPSED) {
       $output .= theme('comment_flat_collapsed', $comment, $node);
     }
-    else if ($mode == COMMENT_MODE_FLAT_EXPANDED) {
+    elseif ($mode == COMMENT_MODE_FLAT_EXPANDED) {
       $output .= theme('comment_flat_expanded', $comment, $node);
     }
-    else if ($mode == COMMENT_MODE_THREADED_COLLAPSED) {
+    elseif ($mode == COMMENT_MODE_THREADED_COLLAPSED) {
       $output .= theme('comment_thread_collapsed', $comment, $node);
     }
-    else if ($mode == COMMENT_MODE_THREADED_EXPANDED) {
+    elseif ($mode == COMMENT_MODE_THREADED_EXPANDED) {
       $output .= theme('comment_thread_expanded', $comment, $node);
     }
   }
Index: plugins/contexts/node_add_form.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/plugins/contexts/node_add_form.inc,v
retrieving revision 1.11
diff -u -p -r1.11 node_add_form.inc
--- plugins/contexts/node_add_form.inc	12 Oct 2009 12:42:54 -0000	1.11
+++ plugins/contexts/node_add_form.inc	18 Oct 2009 23:18:45 -0000
@@ -45,7 +45,7 @@ function ctools_context_create_node_add_
   }
 
   if (!empty($data)) {
-    $types = node_get_types();
+    $types = node_type_get_types();
     $type = str_replace('-', '_', $data);
 
     // Validate the node type exists.
@@ -60,7 +60,7 @@ function ctools_context_create_node_add_
       $form_state = array('want form' => TRUE, 'args' => array($node));
 
       $file = drupal_get_path('module', 'node') . '/node.pages.inc';
-      include_once './' . $file;
+      include_once DRUPAL_ROOT . '/' . $file;
       // This piece of information can let other modules know that more files
       // need to be included if this form is loaded from cache:
       $form_state['form_load_files'] = array($file);
@@ -84,7 +84,7 @@ function ctools_context_create_node_add_
 }
 
 function ctools_context_node_add_form_settings_form($conf) {
-  foreach (node_get_types() as $type => $info) {
+  foreach (node_type_get_types() as $type => $info) {
     $options[$type] = $info->name;
   }
   asort($options);
Index: views_content/plugins/content_types/views.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/views_content/plugins/content_types/views.inc,v
retrieving revision 1.13
diff -u -p -r1.13 views.inc
--- views_content/plugins/content_types/views.inc	17 Oct 2009 22:58:26 -0000	1.13
+++ views_content/plugins/content_types/views.inc	18 Oct 2009 23:18:46 -0000
@@ -164,7 +164,7 @@ function views_content_views_content_typ
 
   $block = new stdClass();
   $block->module = 'views';
-  $block->delta  = $view->name .'-'.  $view->current_display;
+  $block->delta  = $view->name . '-' .  $view->current_display;
 
   if (!empty($conf['link_to_view'])) {
     $block->title_link = $view->get_url();
Index: views_content/plugins/content_types/views_panes.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/ctools/views_content/plugins/content_types/views_panes.inc,v
retrieving revision 1.16
diff -u -p -r1.16 views_panes.inc
--- views_content/plugins/content_types/views_panes.inc	17 Oct 2009 22:58:26 -0000	1.16
+++ views_content/plugins/content_types/views_panes.inc	18 Oct 2009 23:18:46 -0000
@@ -202,7 +202,7 @@ function views_content_views_panes_conte
   if ($allow['path_override'] && !empty($conf['path'])) {
     $view->override_path = $conf['path'];
   }
-  else if ($path = $view->display_handler->get_option('inherit_panels_path')) {
+  elseif ($path = $view->display_handler->get_option('inherit_panels_path')) {
     $view->override_path = $_GET['q'];
   }
 
