Index: panels/panels_page/panels_page.info
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/panels_page/Attic/panels_page.info,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 panels_page.info
--- panels/panels_page/panels_page.info	29 Aug 2007 22:02:04 -0000	1.1.2.1
+++ panels/panels_page/panels_page.info	17 Apr 2008 17:05:30 -0000
@@ -1,6 +1,6 @@
 ; $Id: panels_page.info,v 1.1.2.1 2007/08/29 22:02:04 merlinofchaos Exp $
 name = Panel pages
 description = Create pages that are divided into areas of the page.
-package = "Panels"
-dependencies = panels
+package = Panels
+core = 6.x
 
Index: panels/panels_page/panels_page.admin.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/panels_page/Attic/panels_page.admin.inc,v
retrieving revision 1.1.2.37
diff -u -r1.1.2.37 panels_page.admin.inc
--- panels/panels_page/panels_page.admin.inc	24 Jan 2008 17:51:13 -0000	1.1.2.37
+++ panels/panels_page/panels_page.admin.inc	17 Apr 2008 17:05:30 -0000
@@ -32,10 +32,10 @@
     }
     else {
       if (empty($panel_page->disabled)) {
-        $ops[] = l(t('Disable'), "admin/panels/panel-page/disable/$panel_page->name", NULL, drupal_get_destination());
+        $ops[] = l(t('Disable'), "admin/panels/panel-page/disable/$panel_page->name", array('query' => drupal_get_destination()));
       }
       else {
-        $ops[] = l(t('Enable'), "admin/panels/panel-page/enable/$panel_page->name", NULL, drupal_get_destination());
+        $ops[] = l(t('Enable'), "admin/panels/panel-page/enable/$panel_page->name", array('query' => drupal_get_destination()));
       }
     }
 
@@ -200,7 +200,7 @@
 /**
  * The form to edit the page portion of a panel.
  */
-function panels_page_edit_form($panel_page, $next = NULL) {
+function panels_page_edit_form($form_state, $panel_page, $next = NULL) {
   panels_load_include('common');
   drupal_add_css(panels_get_path('css/panels_admin.css'));
   $layout = panels_get_layout($panel_page->display->layout);
@@ -244,7 +244,6 @@
   );
 
   $panel_page->context = $panel_page->display->context = panels_context_load_contexts($panel_page);
-
   $form['right']['layout']['layout-content'] = array(
     '#value' => theme('panels_common_content_list', $panel_page->display), //$content,
   );
@@ -307,7 +306,8 @@
 /**
  * Validate a panel page edit form
  */
-function panels_page_edit_form_validate($form_id, $form_values, $form) {
+function panels_page_edit_form_validate($form, &$form_state) {
+  $form_values = $form_state['values'];
   // Test uniqueness of name:
   if (!$form_values['name']) {
     form_error($form['left']['info']['name'], t('Panel name is required.'));
@@ -345,7 +345,8 @@
 /**
  * Process submission of the panel page edit form
  */
-function panels_page_edit_form_submit($form_id, $form_values) {
+function panels_page_edit_form_submit($form, &$form_state) {
+  $form_values = $form_state['values'];
   $panel_page = $form_values['panel_page'];
 
   $panel_page->title  = $form_values['title'];
Index: panels/panels_page/panels_page.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/panels_page/Attic/panels_page.module,v
retrieving revision 1.1.2.41
diff -u -r1.1.2.41 panels_page.module
--- panels/panels_page/panels_page.module	21 Feb 2008 01:24:30 -0000	1.1.2.41
+++ panels/panels_page/panels_page.module	17 Apr 2008 17:05:31 -0000
@@ -4,8 +4,8 @@
 /**
  * Implementation of hook_help()
  */
-function panels_page_help($section = '') {
-  switch ($section) {
+function panels_page_help($path, $arg) {
+  switch ($path) {
     case 'admin/panels/panel-page':
     case 'admin/panels/panel-page/list':
       return t('<p>You may peruse a list of your current panels layouts and edit them, or click add to create a new page.</p>');
@@ -24,179 +24,156 @@
 /**
  * Implementation of hook_menu()
  */
-function panels_page_menu($may_cache) {
+function panels_page_menu() {
   $items = array();
+
+  $items['admin/panels/panel-page'] = array(
+    'title' => 'Panel pages',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_list_page'),
+    'description' => t('Create and administer panel-pages (complex layout pages with URLs).'),
+  );
+  $items['admin/panels/panel-page/list'] = array(
+    'title' => 'List',
+    'weight' => -10,
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+  );
+  $items['admin/panels/panel-page/add'] = array(
+    'title' => 'Add',
+    'access arguments' => array('create panel-pages'),
+    'page arguments' => array('panels_page_add_page'),
+    'type' => MENU_LOCAL_TASK,
+  );
+  $items['admin/panels/panel-page/import'] = array(
+    'title' => 'Import',
+    'access arguments' => array('create panel-pages'),
+    'page arguments' => array('panels_page_import_page'),
+    'type' => MENU_LOCAL_TASK,
+  );
+  $items['admin/panels/panel-page/settings'] = array(
+    'title' => 'Settings',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_settings',
+    'weight' => 5,
+    'type' => MENU_LOCAL_TASK,
+  );
+  $items['admin/panels/panel-page/disable'] = array(
+    'access arguments' => array('create panel-pages'),
+    'page arguments' => array('panels_page_disable_page'),
+    'weight' => -1,
+    'type' => MENU_CALLBACK,
+  );
+  $items['admin/panels/panel-page/enable'] = array(
+    'access arguments' => array('create panel-pages'),
+    'page arguments' => array('panels_page_enable_page'),
+    'weight' => -1,
+    'type' => MENU_CALLBACK,
+  );
+
+  // Ajax responder
+  $items['panels/argument/ajax/add'] = array(
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_ajax_argument_add'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['panels/argument/ajax/edit'] = array(
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_ajax_argument_edit'),
+    'type' => MENU_CALLBACK,
+  );
+
+  // Ajax responder
+  $items['panels/relationship/ajax/add'] = array(
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_ajax_relationship_add'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['panels/relationship/ajax/edit'] = array(
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_ajax_relationship_edit'),
+    'type' => MENU_CALLBACK,
+  );
+
+  // Ajax responder
+  $items['panels/context/ajax/add'] = array(
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_ajax_context_add'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['panels/context/ajax/edit'] = array(
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_ajax_context_edit'),
+    'type' => MENU_CALLBACK,
+  );
+
   $panels = panels_page_load_all();
-  if ($may_cache) {
-    $access = user_access('create panel-pages');
-    $items[] = array(
-      'path' => 'admin/panels/panel-page',
-      'title' => t('Panel pages'),
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_list_page'),
-      'description' => t('Create and administer panel-pages (complex layout pages with URLs).'),
-    );
-    $items[] = array(
-      'path' => 'admin/panels/panel-page/list',
-      'title' => t('List'),
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_list_page'),
-      'weight' => -10,
-      'type' => MENU_DEFAULT_LOCAL_TASK,
-    );
-    $items[] = array(
-      'path' => 'admin/panels/panel-page/add',
-      'title' => t('Add'),
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_add_page'),
-      'type' => MENU_LOCAL_TASK,
-    );
-    $items[] = array(
-      'path' => 'admin/panels/panel-page/import',
-      'title' => t('Import'),
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_import_page'),
-      'type' => MENU_LOCAL_TASK,
-    );
-    $items[] = array(
-      'path' => 'admin/panels/panel-page/settings',
-      'title' => t('Settings'),
-      'access' => $access,
-      'callback' => 'panels_page_settings',
-      'weight' => 5,
-      'type' => MENU_LOCAL_TASK,
-    );
-    $items[] = array(
-      'path' => 'admin/panels/panel-page/disable',
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_disable_page'),
-      'weight' => -1,
-      'type' => MENU_CALLBACK,
-    );
-    $items[] = array(
-      'path' => 'admin/panels/panel-page/enable',
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_enable_page'),
-      'weight' => -1,
-      'type' => MENU_CALLBACK,
-    );
-
-    // Ajax responder
-    $items[] = array(
-      'path' => 'panels/argument/ajax/add',
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_ajax_argument_add'),
-      'type' => MENU_CALLBACK,
-    );
-    $items[] = array(
-      'path' => 'panels/argument/ajax/edit',
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_ajax_argument_edit'),
-      'type' => MENU_CALLBACK,
-    );
-
-    // Ajax responder
-    $items[] = array(
-      'path' => 'panels/relationship/ajax/add',
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_ajax_relationship_add'),
-      'type' => MENU_CALLBACK,
-    );
-    $items[] = array(
-      'path' => 'panels/relationship/ajax/edit',
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_ajax_relationship_edit'),
-      'type' => MENU_CALLBACK,
-    );
-
-    // Ajax responder
-    $items[] = array(
-      'path' => 'panels/context/ajax/add',
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_ajax_context_add'),
-      'type' => MENU_CALLBACK,
-    );
-    $items[] = array(
-      'path' => 'panels/context/ajax/edit',
-      'access' => $access,
-      'callback' => 'panels_page_passthru',
-      'callback arguments' => array('panels_page_ajax_context_edit'),
-      'type' => MENU_CALLBACK,
-    );
-
-    // Get all panels and, if enabled, create menu items.
-    foreach ($panels as $panel_page) {
-      if (empty($panel_page->disabled)) {
-        // Only create menu items based on the path if it's not a variable path.
-        if (strpos($panel_page->path, '%') === FALSE) {
-          _panels_page_create_menu_item($items, $panel_page, $panel_page->path, array($panel_page->name, FALSE));
-          // DEBUG: Above is now creating only the basic menu item, not the admin items.
-        }
-        panels_page_admin_menu_items($items, 'admin/panels/panel-page/' . $panel_page->name, $panel_page);
+
+  // Get all panels and, if enabled, create menu items.
+  foreach ($panels as $panel_page) {
+    if (empty($panel_page->disabled)) {
+      // Only create menu items based on the path if it's not a variable path.
+      if (strpos($panel_page->path, '%') === FALSE) {
+        _panels_page_create_menu_item($items, $panel_page, $panel_page->path, array($panel_page->name, FALSE));
+        // DEBUG: Above is now creating only the basic menu item, not the admin items.
       }
+      panels_page_admin_menu_items($items, $panel_page);
     }
   }
-  else {
-    // Look for panels with variable arguments.
-    // Build an array of $urls because 'real' URLs will take precedence over
-    // argument filled URLs
-    $urls = array();
-    foreach ($panels as $panel_page) {
-      $url[$panel_page->path] = TRUE;
-    }
-
-    $plugins_loaded = FALSE;
-    foreach ($panels as $panel_page) {
-      if (strpos($panel_page->path, '%') !== FALSE) {
-        $path = explode('/', $panel_page->path);
-        $match = TRUE;
+  // Look for panels with variable arguments.
+  // Build an array of $urls because 'real' URLs will take precedence over
+  // argument filled URLs
+  $urls = array();
+  foreach ($panels as $panel_page) {
+    $url[$panel_page->path] = TRUE;
+  }
+
+  $plugins_loaded = FALSE;
+  foreach ($panels as $panel_page) {
+    if (strpos($panel_page->path, '%') !== FALSE) {
+      $path = explode('/', $panel_page->path);
+      $match = TRUE;
+      foreach ($path as $id => $chunk) {
+        if ($chunk != '%' && $chunk != arg($id)) {
+          $match = FALSE;
+          break;
+        }
+      }
+      // It's a MATCH! Construct the URL
+      if ($match) {
+        $args = array($panel_page, FALSE);
+        reset($panel_page->arguments);
         foreach ($path as $id => $chunk) {
-          if ($chunk != '%' && $chunk != arg($id)) {
-            $match = FALSE;
-            break;
+          if ($chunk != '%') {
+            continue;
           }
-        }
-        // It's a MATCH! Construct the URL
-        if ($match) {
-          $args = array($panel_page, FALSE);
-          reset($panel_page->arguments);
-          foreach ($path as $id => $chunk) {
-            if ($chunk != '%') {
-              continue;
+          // For arguments that are embedded in the URL, we require the
+          // argument handler to return a context, if there is an argument handler.
+          $argument = current($panel_page->arguments);
+          if ($argument) {
+            // Try to avoid loading the plugins code unless necessary.
+            if (!$plugins_loaded) {
+              panels_load_include('plugins');
+              $plugins_loaded = TRUE;
             }
-            // For arguments that are embedded in the URL, we require the
-            // argument handler to return a context, if there is an argument handler.
-            $argument = current($panel_page->arguments);
-            if ($argument) {
-              // Try to avoid loading the plugins code unless necessary.
-              if (!$plugins_loaded) {
-                panels_load_include('plugins');
-                $plugins_loaded = TRUE;
-              }
-              $context = panels_argument_get_context($argument, arg($id));
-              if (!$context) {
-                break;
-              }
-              $panel_page->context[panels_argument_context_id($argument)] = $context;
+            $context = panels_argument_get_context($argument, arg($id));
+            if (!$context) {
+              break;
             }
-            $path[$id] = arg($id);
-            $args[] = arg($id);
-            next($panel_page->arguments);
+            $panel_page->context[panels_argument_context_id($argument)] = $context;
           }
-          _panels_page_create_menu_item($items, $panel_page, implode('/', $path), $args);
-          // DEBUG: Above is now creating only the basic menu item, not the admin items.
+          $path[$id] = arg($id);
+          $args[] = arg($id);
+          next($panel_page->arguments);
         }
+        _panels_page_create_menu_item($items, $panel_page, implode('/', $path), $args);
+        // DEBUG: Above is now creating only the basic menu item, not the admin items.
       }
     }
   }
@@ -206,171 +183,143 @@
 /**
  * Helper function to add a menu item for a panel.
  */
-function panels_page_admin_menu_items(&$items, $base, $page) {
+function panels_page_admin_menu_items(&$items, $page) {
   $access = user_access('create panel-pages');
+  $base = 'admin/panels/panel-page/' . $page->name;
 
-  $items[] = array(
-    'path' => $base,
-    'title' => t('Preview'),
-    'access' => $access,
-    'callback' => 'panels_page_view_page',
-    'callback arguments' => array($page->name, TRUE),
+  // Tasks for all displays
+  $items[$base] = array(
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_view_page',
+    'page arguments' => array($page->name, TRUE),
     'weight' => -10,
     'type' => MENU_CALLBACK,
   );
 
-  $items[] = array(
-    'path' => $base . '/preview',
-    'title' => t('Preview'),
-    'access' => $access,
-    'callback' => 'panels_page_view_page',
-    'callback arguments' => array($page->name, TRUE),
+  $items[$base . '/preview'] = array(
+    'title' => 'Preview',
+    'access arguments' => array('create panel-pages'),
     'weight' => -10,
     'type' => MENU_DEFAULT_LOCAL_TASK,
   );
 
-  // Set up for the 'default' display.
-  $items[] = array(
-    'path' => $base . '/edit/layout',
-    'title' => t('Layout'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit_layout', $page->name),
+  $items[$base . '/export'] = array(
+    'title' => 'Export',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('drupal_get_form', 'panels_page_edit_export', $page->name),
+    'weight' => 0,
+    'type' => MENU_LOCAL_TASK,
+  );
+  $items[$base . '/delete'] = array(
+    'title' => 'Delete panel page',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('drupal_get_form', 'panels_page_delete_confirm', $page->name),
+    'type' => MENU_CALLBACK,
+  );
+
+  $items[$base . '/edit/layout'] = array(
+    'title' => 'Layout',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_edit_layout', $page->name),
     'weight' => -9,
     'type' => MENU_LOCAL_TASK,
   );
 
-  $items[] = array(
-    'path' => $base . '/edit/general',
-    'title' => t('Settings'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit', $page->name),
+  $items[$base . '/edit/general'] = array(
+    'title' => 'Settings',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_edit', $page->name),
     'weight' => -7,
     'type' => MENU_LOCAL_TASK,
   );
 
-  $items[] = array(
-    'path' => $base . '/edit/settings',
-    'title' => t('Layout settings'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit_layout_settings', $page->name, NULL),
+  $items[$base . '/edit/settings'] = array(
+    'title' => 'Layout settings',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_edit_layout_settings', $page->name, NULL),
     'weight' => -5,
     'type' => MENU_LOCAL_TASK,
   );
 
-  $items[] = array(
-    'path' => $base . '/edit/advanced',
-    'title' => t('Advanced'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit_advanced', $page->name),
+  $items[$base . '/edit/advanced'] = array(
+    'title' => 'Advanced',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_edit_advanced', $page->name),
     'weight' => -3,
     'type' => MENU_LOCAL_TASK,
   );
 
-  $items[] = array(
-    'path' => $base . '/edit/context',
-    'title' => t('Context'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit_context', $page->name),
+  $items[$base . '/edit/context'] = array(
+    'title' => 'Context',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_edit_context', $page->name),
     'weight' => -2,
     'type' => MENU_LOCAL_TASK,
   );
 
-  $items[] = array(
-    'path' => $base . '/edit/content',
-    'title' => t('Content'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit_content', $page->name),
+  $items[$base . '/edit/content'] = array(
+    'title' => 'Content',
+    'access arguments' => array('create panel-pages'),
+    'page callback' => 'panels_page_passthru',
+    'page arguments' => array('panels_page_edit_content', $page->name),
     'weight' => -1,
     'type' => MENU_LOCAL_TASK,
   );
 
-  $items[] = array(
-    'path' => $base . '/edit/layout/default',
-    'title' => t('Default'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit_layout', $page->name),
+  // Subtasks for the 'Default' display
+  $items[$base . '/edit/layout/default'] = array(
+    'title' => 'Default',
+    'access arguments' => array('create panel-pages'),
     'weight' => -3,
     'type' => MENU_DEFAULT_LOCAL_TASK,
   );
 
-  $items[] = array(
-    'path' => $base . '/edit/settings/default',
-    'title' => t('Default'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit_layout_settings', $page->name, NULL),
+  $items[$base . '/edit/settings/default'] = array(
+    'title' => 'Default',
+    'access arguments' => array('create panel-pages'),
     'weight' => -3,
     'type' => MENU_DEFAULT_LOCAL_TASK,
   );
 
-  $items[] = array(
-    'path' => $base . '/edit/content/default',
-    'title' => t('Default'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('panels_page_edit_content', $page->name),
+  $items[$base . '/edit/content/default'] = array(
+    'title' => 'Default',
+    'access arguments' => array('create panel-pages'),
     'weight' => -1,
     'type' => MENU_DEFAULT_LOCAL_TASK,
   );
 
+  // Subtasks for custom displays
   if (!empty($page->displays)) {
     foreach ($page->displays as $display_id => $info) {
-      $items[] = array(
-        'path' => $base . '/edit/layout/' . $display_id,
+      $items[$base . '/edit/layout/' . $display_id] = array(
         'title' => $info['title'],
-        'access' => $access,
-        'callback' => 'panels_page_passthru',
-        'callback arguments' => array('panels_page_edit_layout', $page->name, $display_id),
+        'access arguments' => array('create panel-pages'),
         'weight' => -3,
         'type' => MENU_LOCAL_TASK,
       );
 
-      $items[] = array(
-        'path' => $base . '/edit/settings/' . $display_id,
+      $items[$base . '/edit/settings/' . $display_id] = array(
         'title' => $info['title'],
-        'access' => $access,
-        'callback' => 'panels_page_passthru',
-        'callback arguments' => array('panels_page_edit_layout_settings', $page->name, $display_id),
+        'access arguments' => array('create panel-pages'),
         'weight' => -3,
         'type' => MENU_LOCAL_TASK,
       );
 
-      $items[] = array(
-        'path' => $base . '/edit/content/' . $display_id,
+      $items[$base . '/edit/content/' . $display_id] = array(
         'title' => $info['title'],
-        'access' => $access,
-        'callback' => 'panels_page_passthru',
-        'callback arguments' => array('panels_page_edit_content', $page->name, $display_id),
+        'access arguments' => array('create panel-pages'),
         'weight' => -1,
         'type' => MENU_LOCAL_TASK,
       );
     }
   }
-
-  $items[] = array(
-    'path' => $base . '/export',
-    'title' => t('Export'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('drupal_get_form', 'panels_page_edit_export', $page->name),
-    'weight' => 0,
-    'type' => MENU_LOCAL_TASK,
-  );
-  $items[] = array(
-    'path' => $base . '/delete',
-    'title' => t('Delete panel page'),
-    'access' => $access,
-    'callback' => 'panels_page_passthru',
-    'callback arguments' => array('drupal_get_form', 'panels_page_delete_confirm', $page->name),
-    'type' => MENU_CALLBACK,
-  );
 }
 
 /**
@@ -414,7 +363,7 @@
   $retval = array('path' => $path,
     'title' => $title,
     'callback' => 'panels_page_view_page',
-    'callback arguments' => $args,
+    'page arguments' => $args,
     'access' => user_access('access content') && $access,
     'type' => $type,
   );
@@ -1018,7 +967,7 @@
     db_query("UPDATE {panels_page} SET $query WHERE pid = %d", $v);
   }
   else {
-    $page->pid = db_next_id("{panels_page}_pid");
+    $page->pid = db_last_insert_id('panels_page', 'pid');
     // Tack our pid and did onto the query. These aren't listed as 'fields' because
     // they can't be updated; once set they are permanent.
     $v[] = $page->pid;
Index: panels/panels.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/panels.install,v
retrieving revision 1.1.6.36
diff -u -r1.1.6.36 panels.install
--- panels/panels.install	31 Mar 2008 06:17:42 -0000	1.1.6.36
+++ panels/panels.install	17 Apr 2008 17:05:28 -0000
@@ -4,6 +4,89 @@
 /**
  * Install the panels tables
  */
+function panels_schema() {
+  $schema = array();
+  $schema['panels_page'] = array(
+    'fields' => array(
+      'pid' => array('type' => 'serial', 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
+      'name' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
+      'did' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '10'),
+      'title' => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),
+      'access' => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),
+      'path' => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),
+      'css_id' => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),
+      'css' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'arguments' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'displays' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'contexts' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'relationships' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'no_blocks' => array('type' => 'int', 'not null' => FALSE, 'default' => 0, 'disp-width' => '1'),
+      'menu' => array('type' => 'int', 'not null' => FALSE, 'default' => 0, 'disp-width' => '1'),
+      'menu_tab' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '1'),
+      'menu_tab_weight' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '4'),
+      'menu_title' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
+      'menu_tab_default' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '1'),
+      'menu_tab_default_parent_type' => array('type' => 'varchar', 'length' => '10', 'not null' => FALSE),
+      'menu_parent_title' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
+      'menu_parent_tab_weight' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '4')
+    ),
+    'primary key' => array('pid'),
+    'unique keys' => array(
+      'name' => array('name')
+    ),
+    'indexes' => array(
+      'name_2' => array('name'),
+      'path' => array('path')
+    ),
+  );
+  $schema['panels_display'] = array(
+    'fields' => array(
+      'did' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
+      'name' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
+      'layout' => array('type' => 'varchar', 'length' => '32', 'not null' => FALSE),
+      'layout_settings' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'panel_settings' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'cache' => array('type' => 'text', 'not null' => FALSE)
+    ),
+    'primary key' => array('did'),
+    'unique keys' => array(
+      'name' => array('name')
+    ),
+  );  
+  $schema['panels_pane'] = array(
+    'fields' => array(
+      'pid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
+      'did' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
+      'panel' => array('type' => 'varchar', 'length' => '32', 'not null' => FALSE),
+      'type' => array('type' => 'varchar', 'length' => '32', 'not null' => FALSE),
+      'subtype' => array('type' => 'varchar', 'length' => '64', 'not null' => FALSE),
+      'access' => array('type' => 'varchar', 'length' => '128', 'not null' => FALSE),
+      'configuration' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'cache' => array('type' => 'text', 'size' => 'big', 'not null' => FALSE),
+      'position' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '5')
+    ),
+    'indexes' => array(
+      'did' => array('did')
+    ),
+  );
+  $schema['panels_object_cache'] = array(
+    'fields' => array(
+      'sid' => array('type' => 'varchar', 'length' => '64', 'not null' => FALSE),
+      'did' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '11'),
+      'obj' => array('type' => 'varchar', 'length' => '255', 'not null' => FALSE),
+      'data' => array('type' => 'text', 'not null' => FALSE),
+      'timestamp' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '11')
+    ),
+    'indexes' => array(
+      'panels_object_cache_idx' => array('sid', 'obj', 'did'),
+      'sid' => array('sid', 'obj', 'did'),
+      'timestamp' => array('timestamp')
+    ),
+  );
+  return $schema;
+}
+
+
 function panels_install() {
   switch ($GLOBALS['db_type']) {
     case 'pgsql':
Index: panels/panels.info
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/panels.info,v
retrieving revision 1.2.4.3
diff -u -r1.2.4.3 panels.info
--- panels/panels.info	18 Jun 2007 23:17:13 -0000	1.2.4.3
+++ panels/panels.info	17 Apr 2008 17:05:26 -0000
@@ -1,5 +1,6 @@
 ; $Id: panels.info,v 1.2.4.3 2007/06/18 23:17:13 dww Exp $
 name = Panels
 description = Core Panels display functions; provides no external UI, at least one other module (such as Panel pages) should be enabled.
-package = "Panels"
+package = Panels
+core = 6.x
 
Index: panels/panels.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/panels.module,v
retrieving revision 1.10.4.83
diff -u -r1.10.4.83 panels.module
--- panels/panels.module	18 Mar 2008 01:30:25 -0000	1.10.4.83
+++ panels/panels.module	17 Apr 2008 17:05:29 -0000
@@ -29,97 +29,126 @@
 }
 
 /**
- * Implementation of hook_menu
+ * Implementation of hook_theme
  */
-function panels_menu($may_cache) {
-  if ($may_cache) {
-    $items[] = array(
-      'path' => 'admin/panels',
-      'title' => t('Panels'),
-      'access' => user_access('access administration pages'),
-      'callback' => 'system_admin_menu_block_page',
-      'description' => t('Administer items related to the Panels module.'),
-    );
-    $items[] = array(
-      'path' => 'panels/node/autocomplete',
-      'title' => t('Autocomplete node'),
-      'callback' => 'panels_node_autocomplete',
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-    $items[] = array(
-      'path' => 'panels/ajax',
-      'title' => t('ajax'),
-      'callback' => 'panels_ajax_passthru',
-      'callback arguments' => array('panels_ajax'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-    $items[] = array(
-      'path' => 'panels/common/ajax',
-      'title' => t('ajax'),
-      'callback' => 'panels_ajax_passthru',
-      'callback arguments' => array('panels_common_ajax'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-    $items[] = array(
-      'path' => 'panels/ajax/add-content',
-      'title' => t('ajax'),
-      'callback' => 'panels_ajax_passthru',
-      'callback arguments' => array('panels_ajax_add_content'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-    $items[] = array(
-      'path' => 'panels/ajax/add-config',
-      'title' => t('ajax'),
-      'callback' => 'panels_ajax_passthru',
-      'callback arguments' => array('panels_ajax_add_config'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-    $items[] = array(
-      'path' => 'panels/ajax/configure',
-      'title' => t('ajax'),
-      'callback' => 'panels_ajax_passthru',
-      'callback arguments' => array('panels_ajax_configure'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-    $items[] = array(
-      'path' => 'panels/ajax/cache',
-      'title' => t('ajax'),
-      'callback' => 'panels_ajax_passthru',
-      'callback arguments' => array('panels_ajax_cache'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-    $items[] = array(
-      'path' => 'panels/ajax/cache-settings',
-      'title' => t('ajax'),
-      'callback' => 'panels_ajax_passthru',
-      'callback arguments' => array('panels_ajax_cache_settings'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-    $items[] = array(
-      'path' => 'panels/ajax/panel_settings',
-      'title' => t('ajax'),
-      'callback' => 'panels_ajax_passthru',
-      'callback arguments' => array('panels_panel_settings_ajax'),
-      'access' => user_access('access content'),
-      'type' => MENU_CALLBACK
-    );
-  }
-  else {
-    drupal_add_css(panels_get_path('css/panels.css'));
-    drupal_add_js(panels_get_path('js/panels.js'));
-  }
+function panels_theme() {
+  $theme = array();
+  $theme['panels_image_button'] = array(
+    'arguments' => array('elements'),
+    'file' => 'panels.theme.inc',
+  );
+  $theme['panels_pane'] = array(
+    'arguments' => array('content', 'pane', 'display'),
+    'file' => 'panels.theme.inc',
+  );
+  $theme['panels_layout_link'] = array(
+    'arguments' => array('title', 'id', 'image', 'link'),
+    'file' => 'panels.theme.inc',
+  );
+  $theme['panels_layout_inco'] = array(
+    'arguments' => array('id', 'image', 'title' => null),
+    'file' => 'panels.theme.inc',
+  );
+  return $theme; 
+}
 
+/**
+ * Implementation of hook_menu
+ */
+function panels_menu() {
+  $items = array();
+  $items['admin/panels'] = array(
+    'title' => t('Panels'),
+    'access arguments' => array('access administration pages'),
+    'page callback' => 'system_admin_menu_block_page',
+    'file' => 'system.admin.inc',
+    'file path' => drupal_get_path('module', 'system'),
+    'description' => t('Administer items related to the Panels module.'),
+  );
+  $items['panels/node/autocomplete'] = array(
+    'title' => t('Autocomplete node'),
+    'page callback' => 'panels_node_autocomplete',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
+  $items['panels/ajax'] = array(
+    'title' => t('ajax'),
+    'page callback' => 'panels_ajax_passthru',
+    'page arguments' => array('panels_ajax'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
+  $items['panels/common/ajax'] = array(
+    'title' => t('ajax'),
+    'page callback' => 'panels_ajax_passthru',
+    'page arguments' => array('panels_common_ajax'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
+  $items['panels/ajax/add-content'] = array(
+    'title' => t('ajax'),
+    'page callback' => 'panels_ajax_passthru',
+    'page arguments' => array('panels_ajax_add_content'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
+  $items['panels/ajax/add-config'] = array(
+    'title' => t('ajax'),
+    'page callback' => 'panels_ajax_passthru',
+    'page arguments' => array('panels_ajax_add_config'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
+  $items['panels/ajax/configure'] = array(
+    'title' => t('ajax'),
+    'page callback' => 'panels_ajax_passthru',
+    'page arguments' => array('panels_ajax_configure'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
+  $items['panels/ajax/cache'] = array(
+    'title' => t('ajax'),
+    'page callback' => 'panels_ajax_passthru',
+    'page arguments' => array('panels_ajax_cache'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
+  $items['panels/ajax/cache-settings'] = array(
+    'title' => t('ajax'),
+    'page callback' => 'panels_ajax_passthru',
+    'page arguments' => array('panels_ajax_cache_settings'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
+  $items['panels/ajax/panel_settings'] = array(
+    'title' => t('ajax'),
+    'page callback' => 'panels_ajax_passthru',
+    'page arguments' => array('panels_panel_settings_ajax'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+    'file' => 'panels.callbacks.inc',
+  );
   return $items;
 }
 
+
+/**
+ * Implementation of hook_init().
+ */
+function panels_init() {
+  menu_rebuild();
+  drupal_add_css(panels_get_path('css/panels.css'));
+  drupal_add_js(panels_get_path('js/panels.js'));  
+}
+
 /**
  * Load a panels include file.
  */
@@ -127,22 +156,7 @@
   require_once './' . panels_get_path("$path$include.inc");
 }
 
-/**
- * Helper function for our AJAX stuff to call through to the right location
- */
-function panels_ajax_passthru() {
-  $args = func_get_args();
-  $callback = array_shift($args);
 
-  panels_load_include('plugins');
-  if (arg(1) == 'common') {
-    panels_load_include('common');
-  }
-  else {
-    panels_load_include('display_edit');
-  }
-  return call_user_func_array($callback, $args);
-}
 
 /**
  * Simple render function to make sure output is what we want.
@@ -234,25 +248,10 @@
  * Custom form element to do our nice images.
  */
 function panels_elements() {
-  $type['panels_imagebutton'] = array('#input' => TRUE, '#button_type' => 'submit',);
+  $type['panels_imagebutton'] = array('#input' => TRUE, '#button_type' => 'submit');
   return $type;
 }
 
-/**
- * Theme our image button.
- */
-function theme_panels_imagebutton($element) {
-  return '<input type="image" ' .
-    'class="form-' . $element['#button_type'] . ' ' . $element['#class'] . '" ' .
-    'name="'. $element['#name'] .'" ' .
-    'value="'. check_plain($element['#default_value']) .'" ' .
-    'id="' . $element['#id'] . '" ' .
-    drupal_attributes($element['#attributes']) .
-    ' src="' . base_path() . $element['#image'] . '" ' .
-    'alt="' . $element['#title'] . '" ' .
-    'title="' . $element['#title'] . '" ' .
-    "/>\n";
-}
 
 function panels_imagebutton_value() {
   // null function guarantees default_value doesn't get moved to #value.
@@ -522,7 +521,7 @@
     db_query("DELETE FROM {panels_pane} WHERE did = %d", $display->did);
   }
   else {
-    $display->did = db_next_id("{panels_display}_did");
+    $display->did = db_last_insert_id('panels_display', 'did');
     db_query("INSERT INTO {panels_display} (did, layout, layout_settings, panel_settings, cache) VALUES (%d, '%s', '%s', '%s', '%s')", $display->did, $display->layout, serialize($display->layout_settings), serialize($display->panel_settings), serialize($display->cache));
   }
 
@@ -885,7 +884,7 @@
 function panels_print_layout_link($id, $layout, $link) {
   drupal_add_css(panels_get_path('css/panels_admin.css'));
   $file = panels_get_path($layout['icon'], false, $layout['module']);
-  $image = l(theme('image', $file), $link, NULL, NULL, NULL, NULL, TRUE);
+  $image = l(theme('image', $file), $link,array('html' => true));
   $title = l($layout['title'], $link);
   return theme('panels_layout_link', $title, $id, $image, $link);
 }
@@ -895,122 +894,4 @@
   drupal_add_css(panels_get_path('css/panels_admin.css'));
   $file = panels_get_path($layout['icon'], false, $layout['module']);
   return theme('panels_layout_icon', $id, theme('image', $file), $title);
-}
-
-/**
- * Theme the layout link image
- * @layout
- */
-function theme_panels_layout_link($title, $id, $image, $link) {
-  $output .= '<div class="layout-link">';
-  $output .= $image;
-  $output .= '<div>' . $title . '</div>';
-  $output .= '</div>';
-  return $output;
-}
-
-/**
- * Theme the layout icon image
- * @layout
- */
-function theme_panels_layout_icon($id, $image, $title = NULL) {
-  $output .= '<div class="layout-icon">';
-  $output .= $image;
-  if ($title) {
-    $output .= '<div class="caption">' . $title . '</div>';
-  }
-  $output .= '</div>';
-  return $output;
-}
-
-/**
- * Render a panel pane like a block.
- *
- * A panel pane can have the following fields:
- *
- * $pane->type -- the content type inside this pane
- * $pane->subtype -- The subtype, if applicable. If a view it will be the
- *   view name; if a node it will be the nid, etc.
- * $content->title -- The title of the content
- * $content->content -- The actual content
- * $content->links -- Any links associated with the content
- * $content->more -- An optional 'more' link (destination only)
- * $content->admin_links -- Administrative links associated with the content
- * $content->feeds -- Any feed icons or associated with the content
- * $content->subject -- A legacy setting for block compatibility
- * $content->module -- A legacy setting for block compatibility
- * $content->delta -- A legacy setting for block compatibility
- */
-function theme_panels_pane($content, $pane, $display) {
-  if (!empty($content->content)) {
-    $idstr = $classstr = '';
-    if (!empty($content->css_id)) {
-      $idstr = ' id="' . $content->css_id . '"';
-    }
-    if (!empty($content->css_class)) {
-      $classstr = ' ' . $content->css_class;
-    }
-
-    $output = "<div class=\"panel-pane$classstr\"$idstr>\n";
-    if (user_access('view pane admin links') && !empty($content->admin_links)) {
-      $output .= "<div class=\"admin-links panel-hide\">" . theme('links', $content->admin_links) . "</div>\n";
-    }
-    if (!empty($content->title)) {
-      $output .= "<h2 class=\"title\">$content->title</h2>\n";
-    }
-
-    if (!empty($content->feeds)) {
-      $output .= "<div class=\"feed\">" . implode(' ', $content->feeds) . "</div>\n";
-    }
-
-    $output .= "<div class=\"content\">$content->content</div>\n";
-
-    if (!empty($content->links)) {
-      $output .= "<div class=\"links\">" . theme('links', $content->links) . "</div>\n";
-    }
-
-
-    if (!empty($content->more)) {
-      if (empty($content->more['title'])) {
-        $content->more['title'] = t('more');
-      }
-      $output .= "<div class=\"more-link\">" . l($content->more['title'], $content->more['href']) . "</div>\n";
-    }
-
-    $output .= "</div>\n";
-    return $output;
-  }
-}
-
-/**
- * Helper function for autocompletion of node titles.
- * This is mostly stolen from clipper.
- */
-function panels_node_autocomplete($string) {
-  // TODO: Compare this to the nodequeue version, see which is better.
-  // TODO: The nodequeue version is totally better. Steal it.
-  if ($string != '') { // if there are node_types passed, we'll use those in a MySQL IN query.
-    $preg_matches = array();
-    $match = preg_match('/\[nid: (\d+)\]/', $string, $preg_matches);
-    if (!$match) {
-      $match = preg_match('/^nid: (\d+)/', $string, $preg_matches);
-    }
-    if ($match) {
-      $arg = $preg_matches[1];
-      $where = "n.nid = %d";
-    }
-    else {
-      $arg = $string;
-      $where = "LOWER(title) LIKE LOWER('%%%s%%')";
-    }
-    $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, u.name FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE $where"), $arg, 0, 10);
-
-    $matches = array();
-    while ($node = db_fetch_object($result)) {
-      $name = empty($node->name) ? variable_get('anonymous', t('Anonymous')) : check_plain($node->name);
-      $matches[$node->title . " [nid: $node->nid]"] = '<span class="autocomplete_title">'. check_plain($node->title) .'</span> <span class="autocomplete_user">('. t('by @user', array('@user' => $name)) .')</span>';
-    }
-    drupal_set_header('Content-Type: text/javascript; charset=utf-8');
-    print drupal_to_js($matches);
-  }
-}
+}
\ No newline at end of file
Index: panels/includes/display_edit.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/includes/Attic/display_edit.inc,v
retrieving revision 1.1.2.23
diff -u -r1.1.2.23 display_edit.inc
--- panels/includes/display_edit.inc	24 Jan 2008 17:51:12 -0000	1.1.2.23
+++ panels/includes/display_edit.inc	17 Apr 2008 17:05:30 -0000
@@ -584,7 +584,10 @@
         }
         $output = '<div class="content-type-button">';
         $link_text = theme('image', $path . '/' . $icon, $description, $description);
-        $output .= l($link_text, 'javascript: void()', array('class' => 'panels-modal-add-config', 'id' => $id . '-' . $panel_id . '-' . $content_id), NULL, NULL, NULL, TRUE);
+        $output .= l($link_text, 'javascript: void()', array(
+          'attributes' => array('class' => 'panels-modal-add-config', 'id' => $id . '-' . $panel_id . '-' . $content_id),
+          'html' => true
+        ));
         $output .= "<div>$title</div>";
         $output .= '</div>';
         if (!isset($categories[$category])) {
@@ -881,7 +884,7 @@
   }
 
   $method = panels_ajax_form('panels_edit_cache_method_form',
-     t('Select cache method'), url($_GET['q'], NULL, NULL, TRUE),
+     t('Select cache method'), url($_GET['q'], array('absolute' => true)),
      $cache->display, $pid);
   return panels_ajax_cache_settings($cache, $pid, $method);
 }
@@ -947,7 +950,7 @@
   }
   else {
     $cache->display = panels_ajax_form('panels_edit_cache_settings_form',
-      t('Configure cache settings'), url($_GET['q'], NULL, NULL, TRUE),
+      t('Configure cache settings'), url($_GET['q'], array('absolute' => true)),
       $cache->display, $pid, $method, $function);
   }
 
@@ -1131,7 +1134,7 @@
   );
 
   // Set up the AJAX settings for the modal.
-  $modals['#panels-style-settings'] = array(url('panels/ajax/panel_settings/' . $display->did . '/default', NULL, NULL, TRUE), '#panel-settings-style');
+  $modals['#panels-style-settings'] = array(url('panels/ajax/panel_settings/' . $display->did . '/default',  array('absolute' => true)), '#panel-settings-style');
 
   $form['panel_settings']['end_box'] = array(
     '#value' => '</div>',
@@ -1173,7 +1176,7 @@
     $checkboxes[] = '#panels-style-settings-' . $id;
 
     // Set up the AJAX settings for the modal.
-    $modals['#panels-style-settings-' . $id ] = array(url('panels/ajax/panel_settings/' . $display->did . '/' . $id, NULL, NULL, TRUE), '#panel-settings-style-' . $id);
+    $modals['#panels-style-settings-' . $id ] = array(url('panels/ajax/panel_settings/' . $display->did . '/' . $id, array('absolute' => true)), '#panel-settings-style-' . $id);
 
     $form['panel_settings']['panel'][$id]['end_box'] = array(
       '#value' => '</div>',
@@ -1235,7 +1238,7 @@
   // submit; otherwise the form is rendered for us and nothing else happens.
   $style_settings[$panel] = panels_ajax_form('panels_common_style_settings_form',
      t('Edit style settings for @style', array('@style' => $style['title'])),
-    url($_GET['q'], NULL, NULL, TRUE),
+    url($_GET['q'],  array('absolute' => true)),
     $did, $style, $style_settings[$panel]);
 
   panels_common_cache_set('style_settings', $did, $style_settings);
Index: panels/includes/common.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/panels/includes/Attic/common.inc,v
retrieving revision 1.1.2.21
diff -u -r1.1.2.21 common.inc
--- panels/includes/common.inc	31 Dec 2007 06:30:16 -0000	1.1.2.21
+++ panels/includes/common.inc	17 Apr 2008 17:05:29 -0000
@@ -391,12 +391,12 @@
     'top' => "input.$type-top",
     'bottom' => "input.$type-bottom",
     'configure' => "input.$type-settings",
-    'configure_path' => url("panels/common/ajax/edit/$module/$type/$name", NULL, NULL, TRUE),
+    'configure_path' => url("panels/common/ajax/edit/$module/$type/$name", array('absolute' => true)),
 
     // The button that adds an item
     'add' => "input#edit-buttons-$type-add",
     // Path for ajax on adding an item
-    'path' => url("panels/common/ajax/add/$module/$type/$name", NULL, NULL, TRUE),
+    'path' => url("panels/common/ajax/add/$module/$type/$name", array('absolute' => true)),
     // Which items to post when adding
     'post' => array("#edit-buttons-$type-item", "input#edit-buttons-$type-add"),
     // Where to get the id of an item
@@ -702,7 +702,7 @@
     $title = t('Add @type "@context"', array('@type' => $type_info['singular title'], '@context' => $info['title']));
     $output = theme('status_messages');
     $output .= drupal_render_form($form_id, $form);
-    panels_ajax_render($output, $title, url($_GET['q'], NULL, NULL, TRUE));
+    panels_ajax_render($output, $title, url($_GET['q'], array('absolute' => true)));
   }
 }
 
@@ -784,7 +784,7 @@
   else {
     $output = theme('status_messages');
     $output .= drupal_render_form($form_id, $form);
-    panels_ajax_render($output, $title, url($_GET['q'], NULL, NULL, TRUE));
+    panels_ajax_render($output, $title, url($_GET['q'], array('absolute' => true)));
   }
 }
 
Index: panels/panels.theme.inc
===================================================================
RCS file: panels/panels.theme.inc
diff -N panels/panels.theme.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ panels/panels.theme.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,110 @@
+<?php
+// $Id: panels.module,v 1.10.4.82 2008/02/10 07:48:19 merlinofchaos Exp $
+/**
+ * @file panels.theme.inc
+ * Core theme functions for Panels.
+ */
+
+/**
+ * Theme our image button.
+ */
+function theme_panels_imagebutton($element) {
+  return '<input type="image" ' .
+    'class="form-' . $element['#button_type'] . ' ' . $element['#class'] . '" ' .
+    'name="'. $element['#name'] .'" ' .
+    'value="'. check_plain($element['#default_value']) .'" ' .
+    'id="' . $element['#id'] . '" ' .
+    drupal_attributes($element['#attributes']) .
+    ' src="' . base_path() . $element['#image'] . '" ' .
+    'alt="' . $element['#title'] . '" ' .
+    'title="' . $element['#title'] . '" ' .
+    "/>\n";
+}
+
+
+
+/**
+ * Theme the layout link image
+ * @layout
+ */
+function theme_panels_layout_link($title, $id, $image, $link) {
+  $output .= '<div class="layout-link">';
+  $output .= $image;
+  $output .= '<div>' . $title . '</div>';
+  $output .= '</div>';
+  return $output;
+}
+
+/**
+ * Theme the layout icon image
+ * @layout
+ */
+function theme_panels_layout_icon($id, $image, $title = NULL) {
+  $output .= '<div class="layout-icon">';
+  $output .= $image;
+  if ($title) {
+    $output .= '<div class="caption">' . $title . '</div>';
+  }
+  $output .= '</div>';
+  return $output;
+}
+
+/**
+ * Render a panel pane like a block.
+ *
+ * A panel pane can have the following fields:
+ *
+ * $pane->type -- the content type inside this pane
+ * $pane->subtype -- The subtype, if applicable. If a view it will be the
+ *   view name; if a node it will be the nid, etc.
+ * $content->title -- The title of the content
+ * $content->content -- The actual content
+ * $content->links -- Any links associated with the content
+ * $content->more -- An optional 'more' link (destination only)
+ * $content->admin_links -- Administrative links associated with the content
+ * $content->feeds -- Any feed icons or associated with the content
+ * $content->subject -- A legacy setting for block compatibility
+ * $content->module -- A legacy setting for block compatibility
+ * $content->delta -- A legacy setting for block compatibility
+ */
+function theme_panels_pane($content, $pane, $display) {
+  if (!empty($content->content)) {
+    $idstr = $classstr = '';
+    if (!empty($content->css_id)) {
+      $idstr = ' id="' . $content->css_id . '"';
+    }
+    if (!empty($content->css_class)) {
+      $classstr = ' ' . $content->css_class;
+    }
+
+    $output = "<div class=\"panel-pane$classstr\"$idstr>\n";
+    if (user_access('view pane admin links') && !empty($content->admin_links)) {
+      $output .= "<div class=\"admin-links panel-hide\">" . theme('links', $content->admin_links) . "</div>\n";
+    }
+    if (!empty($content->title)) {
+      $output .= "<h2 class=\"title\">$content->title</h2>\n";
+    }
+
+    if (!empty($content->feeds)) {
+      $output .= "<div class=\"feed\">" . implode(' ', $content->feeds) . "</div>\n";
+    }
+
+    $output .= "<div class=\"content\">$content->content</div>\n";
+
+    if (!empty($content->links)) {
+      $output .= "<div class=\"links\">" . theme('links', $content->links) . "</div>\n";
+    }
+
+
+    if (!empty($content->more)) {
+      if (empty($content->more['title'])) {
+        $content->more['title'] = t('more');
+      }
+      $output .= "<div class=\"more-link\">" . l($content->more['title'], $content->more['href']) . "</div>\n";
+    }
+
+    $output .= "</div>\n";
+    return $output;
+  }
+}
+
Index: panels/panels.callbacks.inc
===================================================================
RCS file: panels/panels.callbacks.inc
diff -N panels/panels.callbacks.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ panels/panels.callbacks.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,60 @@
+<?php
+// $Id: panels.module,v 1.10.4.82 2008/02/10 07:48:19 merlinofchaos Exp $
+/**
+ * @file panels.callbacks.inc
+ * Core menu callbacks for Panels.
+ */
+
+
+
+/**
+ * Helper function for autocompletion of node titles.
+ * This is mostly stolen from clipper.
+ */
+function panels_node_autocomplete($string) {
+  // TODO: Compare this to the nodequeue version, see which is better.
+  // TODO: The nodequeue version is totally better. Steal it.
+  if ($string != '') { // if there are node_types passed, we'll use those in a MySQL IN query.
+    $preg_matches = array();
+    $match = preg_match('/\[nid: (\d+)\]/', $string, $preg_matches);
+    if (!$match) {
+      $match = preg_match('/^nid: (\d+)/', $string, $preg_matches);
+    }
+    if ($match) {
+      $arg = $preg_matches[1];
+      $where = "n.nid = %d";
+    }
+    else {
+      $arg = $string;
+      $where = "LOWER(title) LIKE LOWER('%%%s%%')";
+    }
+    $result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, u.name FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE $where"), $arg, 0, 10);
+
+    $matches = array();
+    while ($node = db_fetch_object($result)) {
+      $name = empty($node->name) ? variable_get('anonymous', t('Anonymous')) : check_plain($node->name);
+      $matches[$node->title . " [nid: $node->nid]"] = '<span class="autocomplete_title">'. check_plain($node->title) .'</span> <span class="autocomplete_user">('. t('by @user', array('@user' => $name)) .')</span>';
+    }
+    drupal_set_header('Content-Type: text/javascript; charset=utf-8');
+    print drupal_to_js($matches);
+  }
+}
+
+
+
+/**
+ * Helper function for our AJAX stuff to call through to the right location
+ */
+function panels_ajax_passthru() {
+  $args = func_get_args();
+  $callback = array_shift($args);
+
+  panels_load_include('plugins');
+  if (arg(1) == 'common') {
+    panels_load_include('common');
+  }
+  else {
+    panels_load_include('display_edit');
+  }
+  return call_user_func_array($callback, $args);
+}
