diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d17491ece09e5c1144c797679795c5c1f9e6ff10..e41db413290425e115f99a48a4548451f8f1a3d2 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 99d72de7dc6d8ebe03d2913dca5d497c1b1e6c73..03f5490c220a535bd0392f83a216ee44a3a28df1 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 480cd111519f3ff9b88d5b5dc657425210b201cb..16e724dc75e63f574d17faf841dc1b5ffe22b897 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']),