From c90b8aee4bb5838250abdf1e757fd77c4d2f6733 Mon Sep 17 00:00:00 2001 From: secretr Date: Thu, 30 Aug 2012 13:41:04 +0000 Subject: [PATCH] Gallery - more template slideshow control --- e107_plugins/gallery/e_shortcode.php | 28 +++++++++++++++++-------- e107_plugins/gallery/slideshow_menu.php | 2 ++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/e107_plugins/gallery/e_shortcode.php b/e107_plugins/gallery/e_shortcode.php index 792a7f1c5..7652d0187 100644 --- a/e107_plugins/gallery/e_shortcode.php +++ b/e107_plugins/gallery/e_shortcode.php @@ -141,22 +141,32 @@ class gallery_shortcodes extends e_shortcode function sc_gallery_slideshow($parm='') { - $this->sliderCat = ($parm) ? intval($parm) : vartrue(e107::getPlugPref('gallery','slideshow_category'),1); + $this->sliderCat = ($parm) ? $parm : vartrue(e107::getPlugPref('gallery','slideshow_category'),1); $template = e107::getTemplate('gallery','gallery','SLIDESHOW_WRAPPER'); return e107::getParser()->parseTemplate($template); } + /** + * All possible parameters + * {GALLERY_SLIDES=4|limit=16&template=MY_SLIDESHOW_SLIDE_ITEM} + * first parameter is always number of slides, default is 3 + * limit - (optional) total limit of pcitures to be shown + * template - (optional) template - name of template to be used for parsing the slideshow item + */ function sc_gallery_slides($parm) { - $this->slideMode = TRUE; - $amount = ($parm) ? intval($parm) : 3; // vartrue(e107::getPlugPref('gallery','slideshow_perslide'),3); - $tp = e107::getParser(); - $limit = varset($gp['slideshow_limit'],16); - $list = e107::getMedia()->getImages('gallery_'.$this->sliderCat,0,$limit); - $item_template = e107::getTemplate('gallery','gallery','SLIDESHOW_SLIDE_ITEM'); - $catList = e107::getMedia()->getCategories('gallery'); - $cat = $catList['gallery_'.$this->sliderCat]; + $tp = e107::getParser(); + $this->slideMode = TRUE; + $parms = eHelper::scDualParams($parm); + + $amount = $parms[1] ? intval($parms[1]) : 3; // vartrue(e107::getPlugPref('gallery','slideshow_perslide'),3); + $parms = $parms[2]; + $limit = (integer) vartrue($parms['limit'], 16); + $list = e107::getMedia()->getImages('gallery_'.$this->sliderCat,0,$limit); + $item_template = e107::getTemplate('gallery','gallery', vartrue($parms['template'], 'SLIDESHOW_SLIDE_ITEM')); + $catList = e107::getMedia()->getCategories('gallery'); + $cat = $catList['gallery_'.$this->sliderCat]; $count = 1; foreach($list as $row) diff --git a/e107_plugins/gallery/slideshow_menu.php b/e107_plugins/gallery/slideshow_menu.php index 4ca111724..850fd4c63 100644 --- a/e107_plugins/gallery/slideshow_menu.php +++ b/e107_plugins/gallery/slideshow_menu.php @@ -7,6 +7,8 @@ */ if (!defined('e107_INIT')) { exit; } +e107::plugLan('gallery', 'front'); + $text = e107::getParser()->parseTemplate("{GALLERY_SLIDESHOW}"); e107::getRender()->tablerender("Gallery",$text,'gallery_slideshow'); unset($text);