Example #1
0
 static function getSlides($params)
 {
     $slidesource = $params->get('slider_source', 1);
     switch ($slidesource) {
         case 1:
             return modJmSlideshowHelper::getSlidesFromCategories($params);
             break;
         case 2:
             return modJmSlideshowHelper::getSlidesFromArticleIDs($params);
             break;
         case 3:
             return modJmSlideshowHelper::getSlidesFromK2Categories($params);
             break;
         case 4:
             return modJmSlideshowHelper::getSlidesFromK2IDs($params);
             break;
         case 5:
             return modJmSlideshowHelper::getSlidesFromCategoriesProduct($params);
             break;
         case 6:
             return modJmSlideshowHelper::getSlidesFromProductIDs($params);
             break;
         case 7:
             return modJmSlideshowHelper::getSlidesFeatured($params);
             break;
         case 8:
             return modJmSlideshowHelper::getSlidesK2Featured($params);
             break;
         case 9:
             return modJmSlideshowHelper::getSlidesFromFile($params);
             break;
         case 10:
             return modJmSlideshowHelper::getSlidesFromFoder($params);
             break;
     }
 }
}
if (!file_exists(JM_SLIDESHOW_IMAGE_FOLDER)) {
    @mkdir(JM_SLIDESHOW_IMAGE_FOLDER, 0755) or die('The folder "' . JPATH_SITE . DS . 'media" is not writeable, please change the permission');
}
if (!class_exists('JMSlide')) {
    require_once JPATH_SITE . DS . 'modules' . DS . 'mod_jmslideshow' . DS . 'classes' . DS . 'slide.php';
}
// Include the syndicate functions only once
require_once dirname(__FILE__) . DS . 'helper.php';
$module_id = $module->id;
$slides = modJmSlideshowHelper::getSlides($params);
$doc = JFactory::getDocument();
$app = JFactory::getApplication();
$custom_css = JPATH_SITE . '/templates/' . modJmSlideshowHelper::getTemplate() . '/css/' . $module->module . '_' . $params->get('jmslideshow_layout', 'default') . '.css';
if (file_exists($custom_css)) {
    $doc->addStylesheet(JURI::base(true) . '/templates/' . modJmSlideshowHelper::getTemplate() . '/css/' . $module->module . '_' . $params->get('jmslideshow_layout', 'default') . '.css');
} else {
    $doc->addStylesheet(JURI::base(true) . '/modules/mod_jmslideshow/assets/css/mod_jmslideshow_' . $params->get('jmslideshow_layout', 'default') . '.css');
}
if ($params->get('jmslideshow_include_jquery', 0) == 1) {
    $doc->addScript(JURI::base(true) . '/modules/mod_jmslideshow/assets/js/jquery.js');
}
$jm_responsive = $params->get('jmslideshow_responsive', 1);
$jm_width = $params->get('jmslideshow_width', 1);
$jm_speed = $params->get('jmslideshow_speed', 500);
$jm_auto = $params->get('jmslideshow_auto', 1);
$timeout = $params->get('jmslideshow_timeout', 0);
$jm_effect = $params->get('jmslideshow_effect', 'fade');
$jm_pause_onhover = $params->get('jmslideshow_pause_onhover', 0);
$jm_show_nav_buttons = $params->get('jmslideshow_show_nav_buttons', 0);
$jm_caption_width = $params->get('jmslideshow_caption_width', 500);