? 744832.patch
Index: nd.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nd/nd.module,v
retrieving revision 1.1.2.123.2.36
diff -u -p -r1.1.2.123.2.36 nd.module
--- nd.module	15 Mar 2010 19:13:42 -0000	1.1.2.123.2.36
+++ nd.module	17 Mar 2010 20:12:35 -0000
@@ -80,6 +80,23 @@ function nd_theme_registry_alter(&$regis
 }
 
 /**
+ * Implementation of hook_form_alter().
+ */
+function nd_form_alter(&$form, $form_state, $form_id) {
+  // Add build modes on the node content form of ctools.
+  if ($form_id == 'ctools_node_content_type_edit_form') {
+    $form['identifier']['#type'] = 'select';
+    $form['identifier']['#description'] = t('Node displays has taken over the identifier textfield and is now a select box with the available build modes. The template suggestion will now be node-panel-BUILDMODE.tpl.php.');
+    $build_modes = array();
+    $all_build_modes = ds_get_build_modes('nd');
+    foreach ($all_build_modes as $key => $build_mode) {
+      $build_modes[$key] = $build_mode['title'];
+    }
+    $form['identifier']['#options'] = $build_modes;
+  }
+}
+
+/**
  * Implementation of hook_nodeapi().
  */
 function nd_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
@@ -105,9 +122,16 @@ function nd_nodeapi(&$node, $op, $teaser
         $node->build_mode = $build_mode;
       }
 
+      // Sticky.
       if ($node->build_mode == 'teaser' && $node->sticky == 1) {
         $node->build_mode = 'sticky';
       }
+
+      // Panels support.
+      if (isset($node->panel_identifier)) {
+        $node->build_mode = $node->panel_identifier;
+      }
+
       break;
 
     // Alter the node object for viewing.
