Index: panels_page/panels_page.module
===================================================================
RCS file: /cvs/drupal-contrib/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_page/panels_page.module	21 Feb 2008 01:24:30 -0000	1.1.2.41
+++ panels_page/panels_page.module	9 May 2008 18:09:04 -0000
@@ -384,7 +384,7 @@
   if ($type == MENU_LOCAL_TASK || $type == MENU_DEFAULT_LOCAL_TASK) {
     $weight = $panel_page->menu_tab_weight;
   }
-  $items[] = _panels_page_menu_item($path, $title, $panel_page, $args, $access, $type, $weight);
+  $items[] = _panels_page_menu_item($path, $title, $panel_page, $args, $access, $type, isset($weight) ? $weight : NULL);
 
   if ($type == MENU_DEFAULT_LOCAL_TASK && dirname($path) && dirname($path) != '.') {
     switch ($panel_page->menu_tab_default_parent_type) {
@@ -496,6 +496,10 @@
     return $panel_page->menu_title;
   }
 
+  if (isset($panel_page->display->title) && $panel_page->did != $panel_page->display->did) {
+    return $panel_page->display->title;
+  }  
+  
   if ($panel_page->context) {
     $title = NULL;
     foreach ($panel_page->context as $id => $context) {
@@ -678,7 +682,7 @@
   // Figure out which display to use.
   $display_id = panels_argument_get_display($panel_page->arguments, $panel_page->context);
 
-  $display = panels_page_fetch_display($panel_page, $display_id);
+  $panel_page->display = $display = panels_page_fetch_display($panel_page, $display_id);
 
   // Figure out if these contexts include a form; will be NULL if there
   // isn't one, or the context if there is.
@@ -712,7 +716,9 @@
     return drupal_not_found();
   }
 
+  if (!$display->hide_title) {
   drupal_set_title(filter_xss_admin(panels_page_get_title($panel_page, 'page', '')));
+  }
 
   if ($panel_page->css) {
     drupal_set_html_head("<style type=\"text/css\" media=\"all\">" . filter_xss_admin($panel_page->css) . "</style>\n");
Index: panels_page/panels_page.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/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_page/panels_page.admin.inc	24 Jan 2008 17:51:13 -0000	1.1.2.37
+++ panels_page/panels_page.admin.inc	9 May 2008 18:09:04 -0000
@@ -275,7 +275,7 @@
     '#size' => 35,
     '#default_value' => $panel_page->title,
     '#title' => t('Page title'),
-    '#description' => t('The page title for this panels layout'),
+    '#description' => t("The page title for this panels layout. It will be used as the main title on this panel page, unless it is overriden later."),
   );
 
   $form['left']['info']['css_id'] = array(
@@ -720,7 +720,7 @@
 
   // The following form will return the $display upon successful submit, if
   // we didn't send the $dest. Which we don't, here.
-  $output = panels_edit_layout_settings($display, $button);
+  $output = panels_edit_layout_settings($display, $button, NULL, $panel_page->title);
   if (is_object($output)) {
     panels_page_set_display($panel_page, $did, $output);
     drupal_goto($dest);
Index: includes/display_edit.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/panels/includes/Attic/display_edit.inc,v
retrieving revision 1.1.2.23
diff -u -r1.1.2.23 display_edit.inc
--- includes/display_edit.inc	24 Jan 2008 17:51:12 -0000	1.1.2.23
+++ includes/display_edit.inc	9 May 2008 18:09:04 -0000
@@ -372,19 +372,45 @@
 /**
  * Form to change the layout of a display.
  */
-function panels_edit_layout_settings_form($display, $finish, $destination) {
+function panels_edit_layout_settings_form($display, $finish, $destination, $title) {
   $layout = panels_get_layout($display->layout);
-  if (!empty($layout['settings form']) && function_exists($layout['settings form'])) {
+  if (!empty($layout['settings form']) && function_exists($layout['settings form'])) { // TODO doc the ability to do this as part of the API
     $form['layout_settings'] = $layout['settings form']($display, $layout, $display->layout_settings);
   }
 
   $form['layout_settings']['#tree'] = TRUE;
 
+  if ($title) {
+    $form['display_title'] = array (
+      '#type' => 'fieldset',
+      '#title' => t('Panel Title'),
+      '#tree' => TRUE,
+    );
+      
+    $form['display_title']['title'] = array(
+      '#type' => 'textfield',
+      '#size' => 35,
+      '#default_value' => $display->title,
+      '#title' => t('Title'),
+      '#description' => t('The title of this panel. Your theme will render this text as the main page title users view this display, unless this text is overridden elsewhere.'),
+    );
+    
+    $form['display_title']['hide_title'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Hide Title?'),
+      '#description' => t('Check this box to hide the main page title for this panel.'),
+    );
+          
+    if (is_string($title)) {
+      $form['display_title']['title']['#description'] .= t(" If you leave this field blank, then the default title, '@title', will be used instead.", array('@title' => $title));
+    }
+  }
+
   $form += panels_panel_settings($display);
 
   $form['variables'] = array(
     '#type' => 'value',
-    '#value' => array($display, $finish, $destination),
+    '#value' => array($display, $finish, $destination, $title),
   );
 
   if (empty($destination)) {
@@ -424,7 +450,7 @@
 }
 
 function panels_edit_layout_settings_form_submit($form_id, $form_values) {
-  list($display, $finish, $destination) = $form_values['variables'];
+  list($display, $finish, $destination, $title) = $form_values['variables'];
   panels_panel_settings_submit($form_id, $form_values);
 
   $layout = $form_values['layout'];
@@ -432,6 +458,11 @@
     $layout['settings submit']($form_values['layout_settings'], $display, $layout, $display->layout_settings);
   }
 
+  if (isset($form_values['display_title']['title'])) {
+    $display->title = $form_values['display_title']['title'];
+    $display->hide_title = $form_values['display_title']['hide_title'];
+  }
+
   if ($form_values['op'] == $finish || $form_values['op'] == t('Save')) {
     $display->layout_settings = $form_values['layout_settings'];
     $display->panel_settings = $form_values['panel_settings'];
Index: panels.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/panels/panels.module,v
retrieving revision 1.10.4.83
diff -u -r1.10.4.83 panels.module
--- panels.module	18 Mar 2008 01:30:25 -0000	1.10.4.83
+++ panels.module	9 May 2008 18:09:04 -0000
@@ -401,10 +401,10 @@
  *
  * TODO: Doc this. Important.
  */
-function panels_edit_layout_settings($display, $finish, $destination = NULL) {
+function panels_edit_layout_settings($display, $finish, $destination = NULL, $title = FALSE) {
   panels_load_include('display_edit');
   panels_load_include('plugins');
-  return _panels_edit_layout_settings( $display, $finish, $destination);
+  return _panels_edit_layout_settings( $display, $finish, $destination, $title);
 }
 
 

