diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index 3a68ec723..d9197726d 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -370,6 +370,41 @@ class news_shortcodes extends e_shortcode return $this->sc_newsimage($parm); } + private function news_carousel($parm) + { + if(empty($this->news_item['news_thumbnail'])) + { + return null; + } + + $options = $parm; + + if(!isset($options['interval'])) + { + $options['interval'] = 'false'; + } + + + $tp = e107::getParser(); + + $media = explode(",", $this->news_item['news_thumbnail']); + $images = array(); + + foreach($media as $file) + { + if($tp->isVideo($file) || empty($file)) + { + continue; + } + + $images[] = array('caption'=>'', 'text'=> $tp->toImage($file,$parm)); + } + + // return print_a($images,true); + + return e107::getForm()->carousel('news-carousel-'.$this->news_item['news_id'],$images, $options); + } + public function sc_news_related($parm=null) { return $this->sc_newsrelated($parm); @@ -841,6 +876,11 @@ class news_shortcodes extends e_shortcode */ function sc_newsimage($parm = null) { + if(!empty($parm['carousel'])) + { + return $this->news_carousel($parm); + } + $tp = e107::getParser(); if(is_string($parm)) diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 0d8b92cb3..f0433e196 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -580,7 +580,7 @@ class e_form * @param string $name : A unique name * @param array $array * @param array $options : default, interval, pause, wrap - * @return string + * @return string|array * @example * $array = array( * 'slide1' => array('caption' => 'Slide 1', 'text' => 'first slide content' ),