summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gallery.module33
-rw-r--r--gallery_block.inc13
2 files changed, 21 insertions, 25 deletions
diff --git a/gallery.module b/gallery.module
index 769425b..384e2da 100644
--- a/gallery.module
+++ b/gallery.module
@@ -192,6 +192,7 @@ function gallery_block($op = 'list', $delta = 0, $edit = array()) {
* Main gallery display page
*/
function gallery_page() {
+ global $gallery_sidebar;
list ($success, $ret) = _gallery_init(true);
if (!$success) {
gallery_error(t('Unable to initialize embedded Gallery'), $ret);
@@ -200,12 +201,7 @@ function gallery_page() {
array('%link' => url('admin/settings/gallery')));
return $err_msg;
}
- /* Pass any excess path info to G2 - NEEDED??? */
-// $path = substr($_GET['q'], 7 /* length of 'gallery/' */);
- /* if (!empty($path)) {
- $_GET[GALLERY_FORM_VARIABLE_PREFIX . 'path'] = $path;
- }*/
- // Turn off sidebar and pathbar
+ // Turn off sidebar
GalleryCapabilities::set('showSidebarBlocks', false);
$result = GalleryEmbed::handleRequest();
if (!$result['isDone']) {
@@ -217,18 +213,21 @@ function gallery_page() {
drupal_set_title($title);
// Add pathbar. See http://gallery.menalto.com/node/33447
if (isset($result['themeData'])) {
- $urlGenerator =& $GLOBALS['gallery']->getUrlGenerator();
- $breadcrumb = array(l(t('Home'), ''));
- foreach ($result['themeData']['parents'] as $parent) {
- $parent_title = $parent['title'];
- // Simple strip of bbcode (italics)
- $parent_title = str_replace("[i]", "<i>", $parent_title);
- $parent_title = str_replace("[/i]", "</i>", $parent_title);
- $breadcrumb[] = '<a href="'.$urlGenerator->generateUrl(
- array('itemId' => $parent['id'])) .'">'.$parent_title."</a>";
- }
- drupal_set_breadcrumb($breadcrumb);
+ $urlGenerator =& $GLOBALS['gallery']->getUrlGenerator();
+ $breadcrumb = array(l(t('Home'), ''));
+ foreach ($result['themeData']['parents'] as $parent) {
+ $parent_title = $parent['title'];
+ // Simple strip of bbcode (italics)
+ $parent_title = str_replace("[i]", "<i>", $parent_title);
+ $parent_title = str_replace("[/i]", "</i>", $parent_title);
+ $breadcrumb[] = '<a href="'.$urlGenerator->generateUrl(
+ array('itemId' => $parent['id'])) .'">'.$parent_title."</a>";
}
+ 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'];
}
}
diff --git a/gallery_block.inc b/gallery_block.inc
index 7c98754..527b6db 100644
--- a/gallery_block.inc
+++ b/gallery_block.inc
@@ -83,17 +83,14 @@ function _gallery_block($op = 'list', $delta = 0, $edit = array()) {
break;
// 1 = Navigation Block
case 1:
- if (arg(0) == 'gallery') {
- GalleryCapabilities::set('showSidebarBlocks', false);
- $result = GalleryEmbed::handleRequest();
- if (isset($result['sidebarBlocksHtml']) && !empty($result['sidebarBlocksHtml'])) {
- $block['subject'] = t('Gallery Navigation');
- $block['content'] = '<div id="gsSidebar" class="gcBorder1">' . join('', $result['sidebarBlocksHtml']) . '</div>';
- }
+ global $gallery_sidebar;
+ if ((arg(0) == 'gallery') && (isset($gallery_sidebar) && !empty($gallery_sidebar))) {
+ $block['subject'] = t('Gallery Navigation');
+ $block['content'] = '<div id="gsSidebar" class="gcBorder1">' . join('', $gallery_sidebar) . '</div>';
}
break;
// 2 = Image Grid Block
- case 2:
+ case 2:
$num_cols = variable_get('gallery_grid_num_cols', 2);
$num_rows = variable_get('gallery_grid_num_rows', 2);
$num_images = $num_cols * $num_rows;