### Eclipse Workspace Patch 1.0
#P drupcontrib
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	28 Feb 2008 19:04:59 -0000
@@ -200,11 +200,11 @@
   }
 }
 
-function _panels_edit_layout($display, $finish, $destination = NULL) {
+function _panels_edit_layout($display, $finish, $destination = NULL, $layout_types = NULL) {
   // Break out the form pieces so we can return the new $display upon
   // successful submit.
   $form_id = 'panels_choose_layout';
-  $form = drupal_retrieve_form($form_id, $display, $finish, $destination);
+  $form = drupal_retrieve_form($form_id, $display, $finish, $destination, $layout_types);
 
   if ($result = drupal_process_form($form_id, $form)) {
     // successful submit
@@ -217,9 +217,13 @@
 /**
  * Form to change the layout of a display.
  */
-function panels_choose_layout($display, $finish, $destination) {
+function panels_choose_layout($display, $finish, $destination, $layout_types) {
+  // allow the caller to determine which layouts should be available
   $layouts = panels_get_layouts();
-
+  if (!empty($layout_types) && is_array($layout_types)) {
+     $layouts = array_intersect_key($layouts, array_flip($layout_types));
+  }
+  
   foreach ($layouts as $id => $layout) {
     $options[$id] = panels_print_layout_icon($id, $layout, check_plain($layout['title']));
   }
