-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_b3_gallery.php
65 lines (55 loc) · 2.25 KB
/
mod_b3_gallery.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* B3 Gallery Module
*
* @package Joomla.Site
* @subpackage mod_b3_gallery
*
* @author Hugo Fittipaldi <[email protected]>
* @copyright Copyright (C) 2019 Hugo Fittipaldi. All rights reserved.
* @license GNU General Public License version 2 or later;
* @link https://github.com/hfittipaldi/mod_b3_gallery
*/
// No direct access
defined('_JEXEC') or die;
// Include the related items functions only once
JLoader::register('B3GalleryHelper', __DIR__ . '/helper.php');
JHtml::_('stylesheet', 'mod_b3_gallery/b3_gallery.css', array('relative' => true));
JHtml::_('bootstrap.framework');
JHtml::_('script', 'mod_b3_gallery/b3_gallery.js', array('relative' => true));
/* Module */
$module_id = $module->id;
$mod_title = htmlspecialchars($module->title, ENT_COMPAT, 'UTF-8');
/* Params */
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$size = (int) $params->get('size', 260);
$counter = (bool) $params->get('counter', true);
/* Carousel modal params */
if ($params->get('autoslide', 1)) {
$interval = (int) $params->get('interval', 5000);
$interval = $interval !== 5000 ? ' data-interval="' . $interval . '"' : '';
$interval = ' data-ride="carousel"' . $interval;
$pause = (int) $params->get('pause') !== 1 ? ' data-pause="false"' : '';
}
$transition = (int) $params->get('transition', 0);
$transition = $transition !== 0 ? ' carousel-fade' : '';
if ($controls = (int) $params->get('controls', 1)) {
$keyboard = (int) $params->get('keyboard') !== 1 ? ' data-keyboard="false"' : '';
}
$wrap = (int) $params->get('wrap') !== 1 ? ' data-wrap="false"' : '';
$version = '';
$item = 'carousel-';
$ctrlNext = 'carousel-control-next';
$ctrlPrev = 'carousel-control-prev';
$spanNext = 'carousel-control-next-icon';
$spanPrev = 'carousel-control-prev-icon';
if ($params->get('version') === '3.x') {
$version = ' b3';
$item = '';
$ctrlNext = 'right carousel-control';
$ctrlPrev = 'left carousel-control';
$spanNext = 'glyphicon glyphicon-chevron-right';
$spanPrev = 'glyphicon glyphicon-chevron-left';
}
$gallery = B3GalleryHelper::getGallery($params, $module_id);
require JModuleHelper::getLayoutPath('mod_b3_gallery', $params->get('layout', 'default'));