From bbe3731cc7c0c5932d5ea96e415d22b2a7d8eb23 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 17 Oct 2017 10:52:04 -0700 Subject: [PATCH] Fixes #2816 - Gallery custom caption fix. --- e107_plugins/gallery/controllers/index.php | 5 +++-- e107_plugins/gallery/e_shortcode.php | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/e107_plugins/gallery/controllers/index.php b/e107_plugins/gallery/controllers/index.php index 4e826d151..f4a6c603b 100644 --- a/e107_plugins/gallery/controllers/index.php +++ b/e107_plugins/gallery/controllers/index.php @@ -136,7 +136,7 @@ class plugin_gallery_index_controller extends eControllerFront $text .= e107::getParser()->parseTemplate($template['cat']['end'], true, $sc); - if(isset($template['cat_caption'])) + if(isset($template['cat']['caption'])) { $title = e107::getParser()->parseTemplate($template['cat']['caption'], true, $sc); @@ -183,6 +183,7 @@ class plugin_gallery_index_controller extends eControllerFront $tp = e107::getParser(); $template = $this->getTemplate(); $template = array_change_key_case($template); + $sc = e107::getScBatch('gallery', true); if(defset('BOOTSTRAP') === true || defset('BOOTSTRAP') === 2) // Convert bootsrap3 to bootstrap2 compat. @@ -215,7 +216,7 @@ class plugin_gallery_index_controller extends eControllerFront $text .= $inner; $text .= $tp->parseTemplate($template['list']['end'], true, $sc); - if(isset($template['list_caption'])) + if(isset($template['list']['caption'])) { $title = $tp->parseTemplate($template['list']['caption'], true, $sc); $this->addTitle($title)->addBody($text); diff --git a/e107_plugins/gallery/e_shortcode.php b/e107_plugins/gallery/e_shortcode.php index e5f8a22ef..c74d3881c 100644 --- a/e107_plugins/gallery/e_shortcode.php +++ b/e107_plugins/gallery/e_shortcode.php @@ -69,7 +69,11 @@ class gallery_shortcodes extends e_shortcode { $breadcrumb = array(); - $breadcrumb[] = array('text' => LAN_PLUGIN_GALLERY_TITLE, 'url' => e107::getUrl()->create('gallery', $this->var)); + $template = e107::getTemplate('gallery', 'gallery', 'cat'); + + $caption = isset($template['caption']) ? $template['caption'] : LAN_PLUGIN_GALLERY_TITLE; + + $breadcrumb[] = array('text' => $caption, 'url' => e107::getUrl()->create('gallery', $this->var)); if(vartrue($this->curCat)) {