Example #1
0
# Websites: http://www.graphicaholic.com

-------------------------------------------------------------------------*/
// No direct access
defined('_JEXEC') or die('Restricted access');
abstract class modResponsiveGalleryHelper
{
    static function getimgList($params, $moduleID)
    {
        $filter = '\\.png$|\\.gif$|\\.jpg$|\\.jpeg$|\\.bmp$';
        $path = $params->get('path');
        $thumbratio = $params->get('thumbratio', 1) ? true : false;
        $thumbwidth = trim($params->get('thumbwidth', 264));
        $thumbheight = trim($params->get('thumbheight', 244));
        $files = JFolder::files(JPATH_BASE . $path, $filter);
        $i = 0;
        $lists = array();
        foreach ($files as $file) {
            $image = modResponsiveGalleryHelper::getImages($path . '/' . $file, $thumbwidth, $thumbheight, $thumbratio);
            $lists[$i] = new stdClass();
    $document->addScript($modbase . 'js/gallery.js');
} else {
    $document->addScript($modbase . 'js/gallery_NL.js');
}
if ($styles == "light") {
    $document->addStyleSheet($modbase . 'css/style_light.css');
    $document->addStyleSheet($modbase . 'css/elastislide_light.css');
} elseif ($styles == "dark") {
    $document->addStyleSheet($modbase . 'css/style_dark.css');
    $document->addStyleSheet($modbase . 'css/elastislide_dark.css');
} elseif ($styles == "custom") {
    $document->addStyleSheet($modbase . 'css/style_custom.css');
    $document->addStyleSheet($modbase . 'css/elastislide_custom.css');
}
if ($lightboxScript == "1") {
    $document->addScript($modbase . 'js/jquery.fancybox.js');
    $document->addStyleSheet($modbase . 'css/jquery.fancybox.css');
}
$document->addScript($modbase . 'js/jquery.tmpl.js');
$document->addScript($modbase . 'js/jquery.easing.1.3.js');
$document->addScript($modbase . 'js/jquery.elastislide.js');
$moduleId = $module->id;
if ($imageFeed == "5") {
    require_once __DIR__ . '/helpers/jhelper.php';
    $param = modResponsiveGalleryHelper::render($params);
    require JModuleHelper::getLayoutPath('mod_responsivegallery', $params->get('layout', 'default'));
} else {
    require_once dirname(__FILE__) . DS . 'helper.php';
    $list = modResponsiveGalleryHelper::getimgList($params, $moduleID);
    require JModuleHelper::getLayoutPath('mod_responsivegallery');
}
Example #3
0
	<div id="gallery">		
	<ul>
	<?php 
    $imagesJSON = new stdClass();
    if ($params->get('data_source.images')) {
        $imagesJSON = json_decode($params->get('data_source.images'));
    }
    $folder = $params->get('data_source.folder');
    $images = array();
    foreach ($imagesJSON as $img) {
        $images[$img->position] = $img;
    }
    ksort($images);
    foreach ($images as $k => $image) {
        if ($params->get('thumbnail_mode') != 'none') {
            $imageCache = modResponsiveGalleryHelper::renderImage($folder . '/' . $image->image, $params);
        } else {
            $imageCache = $LiveSite . $folder . '/' . $image->image;
        }
        ?>
	
			<li>					
				<a href="#"><img src="<?php 
        echo $imageCache;
        ?>
" style="height:<?php 
        echo $params->get('heightRatio');
        ?>
; width:<?php 
        echo $params->get('heightRatio');
        ?>