1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Fixes #1372 - Gallery Slideshow with default category.

This commit is contained in:
Cameron 2016-02-25 12:29:17 -08:00
parent 310d5ff512
commit 751ce52c13
2 changed files with 15 additions and 10 deletions

View File

@ -114,13 +114,14 @@ class gallery_cat_admin_ui extends e_admin_ui
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
// 'media_cat_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE),
'media_cat_image' => array('title'=> LAN_IMAGE, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
'media_cat_owner' => array('title'=> "Owner", 'type' => 'hidden', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'writeParms' =>'value=gallery'),
'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'hidden', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
'media_cat_owner' => array('title'=> "Owner", 'type' => 'hidden', 'nolist'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'writeParms' =>'value=gallery'),
'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'hidden', 'nolist'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
'media_cat_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
'media_cat_sef' => array('title'=> LAN_SEFURL, 'type'=>'text', 'inline'=>true, 'width'=>'auto', 'thclass' => 'left'),
'media_cat_diz' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=150&bb=1','readonly'=>FALSE), // Display name
'media_cat_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'data' => 'int', 'filter'=>TRUE, 'batch'=>TRUE),
'media_cat_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => '5%', 'thclass' => 'right', 'class'=> 'right' ),
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center')
'media_cat_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'center', 'class'=> 'center' ),
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '5%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'right')
);

View File

@ -186,8 +186,8 @@ class gallery_shortcodes extends e_shortcode
$tmpl = e107::getTemplate('gallery','gallery');
$limit = vartrue($parm['limit'], 6);
$list = e107::getMedia()->getImages('gallery_'.$cat.'|gallery_image_'.$cat, 0, $limit);
$list = e107::getMedia()->getImages('gallery_image|gallery_'.$cat.'|gallery_image_'.$cat, 0, $limit);
if(count($list) < 1 && vartrue($parm['placeholder']))
{
$list = array();
@ -198,7 +198,8 @@ class gallery_shortcodes extends e_shortcode
}
}
//NOTE: Using tablerender() allows the theme developer to set the number of columns etc using col-xx-xx
//NOTE: Using tablerender() allows the theme developer to set the number of columns etc using col-xx-xx
$text = '';
foreach($list as $val)
{
$this->var = $val;
@ -226,7 +227,7 @@ class gallery_shortcodes extends e_shortcode
$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.'|gallery_image_'.$this->sliderCat,0,$limit);
$list = e107::getMedia()->getImages('gallery_image|gallery_'.$this->sliderCat.'|gallery_image_'.$this->sliderCat,0,$limit);
$tmpl = e107::getTemplate('gallery','gallery');
$tmpl = array_change_key_case($tmpl); // change template key to lowercase (BC fix)
$tmpl_key = vartrue($parms['template'],'slideshow_slide_item');
@ -235,6 +236,7 @@ class gallery_shortcodes extends e_shortcode
$cat = $catList['gallery_'.$this->sliderCat];
$count = 1;
$inner = '';
foreach($list as $row)
{
$this->setVars($row)
@ -258,11 +260,13 @@ class gallery_shortcodes extends e_shortcode
$inner .= ($count != 1) ? "</div><!-- END SLIDES -->" : "";
return $inner;
}
function sc_gallery_jumper($parm)
{
// echo "SlideCount=".$this->slideCount;
if($this->slideCount ==1 ){ return "gallery-jumper must be loaded after Gallery-Slides"; }
if($this->slideCount ==1 && deftrue('E107_DBG_BASIC')){ return "gallery-jumper must be loaded after Gallery-Slides"; }
$text = '';
for($i=1; $i < ($this->slideCount); $i++)