| Server IP : 54.36.91.62 / Your IP : 216.73.217.94 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/c/o/o/coopiak/amisdesseniors-fr/dijon/components/com_djmediatools/layouts/masonry/ |
Upload File : |
<?php
/**
* @version $Id: helper.php 99 2017-08-04 10:55:30Z szymon $
* @package DJ-MediaTools
* @copyright Copyright (C) 2017 DJ-Extensions.com, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email contact@dj-extensions.com
* @developer Szymon Woronowski - szymon.woronowski@design-joomla.eu
*
* DJ-MediaTools is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DJ-MediaTools is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DJ-MediaTools. If not, see <http://www.gnu.org/licenses/>.
*
*/
// no direct access
defined('_JEXEC') or die ('Restricted access');
class MasonryDJMediatoolsLayoutHelper extends DJMediatoolsLayoutHelper
{
public function addScripts(&$params) {
$mid = $params->get('gallery_id');
JHTML::_('jquery.framework');
$document = JFactory::getDocument();
if($params->get('link_image',1)==2) $this->addLightbox($params->get('lightbox','magnific'));
//$canDefer = preg_match('/(?i)msie [6-9]/',@$_SERVER['HTTP_USER_AGENT']) ? false : true;
$document->addScript(JURI::root(true).'/media/djextensions/picturefill/picturefill.min.js', array('mime'=>'text/javascript', 'defer'=>self::canDefer()));
$document->addScript(JURI::root(true).'/components/com_djmediatools/layouts/masonry/js/masonry.pkgd.min.js?v='.self::$_version, array('mime'=>'text/javascript', 'defer'=>self::canDefer()));
$animationOptions = "{".implode(', ', $this->getAnimationOptions($params))."}";
$js = " jQuery(document).ready(function(){
window.masonry$mid = jQuery('#dj-masonry$mid').masonry($animationOptions);
jQuery(window).on('load',function(){
window.masonry$mid.masonry('layout');
});
});";
$document->addScriptDeclaration($js);
}
public function getAnimationOptions(&$params) {
if(!is_numeric($duration = $params->get('duration')) || !$duration) $duration = 200;
if(!is_numeric($stagger = $params->get('lag'))) $stagger = 50;
if($stagger > $duration) $stagger = $duration;
$width = $params->get('image_width');
if(in_array($params->get('desc_position'), array('left','right'))) $width += $params->get('desc_width');
$options[] = "itemSelector: '.dj-slide'";
$options[] = "columnWidth: $width";
$options[] = "gutter: ".$params->get('space_between_images');
$options[] = "transitionDuration: $duration";
$options[] = "stagger: $stagger";
$options[] = "fitWidth: true";
return $options;
}
public function getStyleSheetParams(&$params) {
$options = parent::getStyleSheetParams($params);
$options['s'] = $params->get('space_between_images');
return $options;
}
}