Commit 9028ba95 authored by kiz_0987's avatar kiz_0987
Browse files

#70593 - Fixed GalleryEmbed::handleRequest being called twice.

parent 9e6b9178
...@@ -192,6 +192,7 @@ function gallery_block($op = 'list', $delta = 0, $edit = array()) { ...@@ -192,6 +192,7 @@ function gallery_block($op = 'list', $delta = 0, $edit = array()) {
* Main gallery display page * Main gallery display page
*/ */
function gallery_page() { function gallery_page() {
global $gallery_sidebar;
list ($success, $ret) = _gallery_init(true); list ($success, $ret) = _gallery_init(true);
if (!$success) { if (!$success) {
gallery_error(t('Unable to initialize embedded Gallery'), $ret); gallery_error(t('Unable to initialize embedded Gallery'), $ret);
...@@ -200,12 +201,7 @@ function gallery_page() { ...@@ -200,12 +201,7 @@ function gallery_page() {
array('%link' => url('admin/settings/gallery'))); array('%link' => url('admin/settings/gallery')));
return $err_msg; return $err_msg;
} }
/* Pass any excess path info to G2 - NEEDED??? */ // Turn off sidebar
// $path = substr($_GET['q'], 7 /* length of 'gallery/' */);
/* if (!empty($path)) {
$_GET[GALLERY_FORM_VARIABLE_PREFIX . 'path'] = $path;
}*/
// Turn off sidebar and pathbar
GalleryCapabilities::set('showSidebarBlocks', false); GalleryCapabilities::set('showSidebarBlocks', false);
$result = GalleryEmbed::handleRequest(); $result = GalleryEmbed::handleRequest();
if (!$result['isDone']) { if (!$result['isDone']) {
...@@ -229,6 +225,9 @@ function gallery_page() { ...@@ -229,6 +225,9 @@ function gallery_page() {
} }
drupal_set_breadcrumb($breadcrumb); drupal_set_breadcrumb($breadcrumb);
} }
// Store the sidebar info in a global variable for use in the gallery navigation block
$gallery_sidebar = $result['sidebarBlocksHtml'];
return $result['bodyHtml']; return $result['bodyHtml'];
} }
} }
......
...@@ -83,13 +83,10 @@ function _gallery_block($op = 'list', $delta = 0, $edit = array()) { ...@@ -83,13 +83,10 @@ function _gallery_block($op = 'list', $delta = 0, $edit = array()) {
break; break;
// 1 = Navigation Block // 1 = Navigation Block
case 1: case 1:
if (arg(0) == 'gallery') { global $gallery_sidebar;
GalleryCapabilities::set('showSidebarBlocks', false); if ((arg(0) == 'gallery') && (isset($gallery_sidebar) && !empty($gallery_sidebar))) {
$result = GalleryEmbed::handleRequest();
if (isset($result['sidebarBlocksHtml']) && !empty($result['sidebarBlocksHtml'])) {
$block['subject'] = t('Gallery Navigation'); $block['subject'] = t('Gallery Navigation');
$block['content'] = '<div id="gsSidebar" class="gcBorder1">' . join('', $result['sidebarBlocksHtml']) . '</div>'; $block['content'] = '<div id="gsSidebar" class="gcBorder1">' . join('', $gallery_sidebar) . '</div>';
}
} }
break; break;
// 2 = Image Grid Block // 2 = Image Grid Block
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment