summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2009-10-07 22:56:43 (GMT)
committer Earl Miles2009-10-07 22:56:43 (GMT)
commit604ac14dcfff84db9dc717662ce09f5fae700d69 (patch)
tree0036dda6c16591c1fda2d068193860fcee84e22c
parent4bac51cfb67ac91138c8193a88f8469bd284c098 (diff)
#562560 by Damien McKenna: Integration with export.module
-rw-r--r--CHANGELOG.txt1
-rw-r--r--panels_node/panels_node.module23
2 files changed, 23 insertions, 1 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6e6d814..960e8b7 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -7,6 +7,7 @@ Panels 6.x-dev
#529816: Allow flexible layout to add custom classes to each region.
Rearrange the pane dropdown menus to be better organized and look a little nicer.
Add a new field to allow setting a panel title from one of its panes.
+#562560 by Damien McKenna: Integration with export.module
Panels 6.x-3.0
==============
diff --git a/panels_node/panels_node.module b/panels_node/panels_node.module
index 3edb875..1be242e 100644
--- a/panels_node/panels_node.module
+++ b/panels_node/panels_node.module
@@ -174,7 +174,7 @@ function panels_node_form(&$node, &$param) {
'#description' => t('The teaser is a piece of text to describe when the panel is listed (such as when promoted to front page); the actual content will only be displayed on the full node view.'),
'#default_value' => $node->body,
);
- $form['format'] = filter_form($node->format); // Now we can set the format!
+ $form['format'] = filter_form($node->format); // Now we can set the format!
}
// drupal_set_message('<pre>' . check_plain(var_export($node, true)) . '</pre>');
@@ -223,6 +223,14 @@ function panels_node_insert(&$node) {
// Create a new display and record that.
$display = panels_new_display();
$display->layout = $node->panels_node['layout'];
+
+ // Special handling for nodes being imported from an export.module data dump.
+ if (!empty($node->export_display)) {
+ // This works by overriding the $display set above
+ eval($node->export_display);
+ unset($node->export_display);
+ }
+
panels_save_display($display);
$css_id = $node->panels_node['css_id'];
@@ -338,3 +346,16 @@ function panels_node_get_context(&$node) {
$context->keyword = 'node';
return array('panel-node' => $context);
}
+
+/**
+ * hook_export_node_alter() - integegrate with export.module for saving
+ * panel_nodes into code.
+ */
+function panels_node_export_node_alter(&$node, $original_node, $method) {
+ if ($method == 'export') {
+ drupal_set_message(t("NOTE: in order to import panel_nodes you must first set the export.module settings to \"Save as a new node then edit\", otherwise it won't work."));
+ $display = panels_load_display($node->panels_node['did']);
+ $export = panels_export_display($display);
+ $node->export_display = $export;
+ }
+}