summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2009-04-30 21:05:29 (GMT)
committer Earl Miles2009-04-30 21:05:29 (GMT)
commit2505a50c5ff2c5cc32309d48e91eb19e1f38260d (patch)
tree7d9c7e4a99e18c54071bc669195b1c51a059e2ca
parente9983567ad1e3695bbbaa7c671735e1533422fd2 (diff)
#375686: Create panels_get_current_page_display() to replace the old panels_get_current_page() function.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--panels.module17
-rw-r--r--plugins/task_handlers/panel_context.inc3
3 files changed, 21 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d17491e..e41db41 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -19,6 +19,7 @@ Rearranged the menus, created the Panel dashboard.
Returned the allowed content settings form to panel page
Added allowed layouts to settings form for panel pages, nodes, minis.
#362754 by dereine: Fix invalid XHTML in 3col 33/34/33 template.
+#375686: Create panels_get_current_page_display() to replace the old panels_get_current_page() function.
Panels 6.x-3.0-alpha3
=====================
diff --git a/panels.module b/panels.module
index 99d72de..03f5490 100644
--- a/panels.module
+++ b/panels.module
@@ -959,3 +959,20 @@ function panels_ctools_plugin_styles() {
);
}
+/**
+ * Get the display that is currently being rendered as a page.
+ *
+ * Unlike in previous versions of this, this only returns the display,
+ * not the page itself, because there are a number of different ways
+ * to get to this point. It is hoped that the page data isn't needed
+ * at this point. If it turns out there is, we will do something else to
+ * get that functionality.
+ */
+function panels_get_current_page_display($change = NULL) {
+ static $display = NULL;
+ if ($change) {
+ $display = $change;
+ }
+
+ return $display;
+}
diff --git a/plugins/task_handlers/panel_context.inc b/plugins/task_handlers/panel_context.inc
index 480cd11..16e724d 100644
--- a/plugins/task_handlers/panel_context.inc
+++ b/plugins/task_handlers/panel_context.inc
@@ -156,6 +156,9 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR
drupal_add_css($handler->conf['css_cache']);
}
+ // With an argument, this actually sets the display.
+ panels_get_current_page_display($display);
+
$info = array(
'content' => panels_render_display($display),
'no_blocks' => !empty($handler->conf['no_blocks']),