-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_b3_carousel.php
60 lines (48 loc) · 2.06 KB
/
mod_b3_carousel.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
<?php
/**
* B3 Carousel Module
*
* @package Joomla.Site
* @subpackage mod_b3_carousel
*
* @author Hugo Fittipaldi <[email protected]>
* @copyright Copyright (C) 2020 Hugo Fittipaldi. All rights reserved.
* @license GNU General Public License version 2 or later;
* @link https://github.com/hfittipaldi/mod_b3_carousel
*/
// no direct access
defined('_JEXEC') or die;
// Register helper
JLoader::register('modB3CarouselHelper', __DIR__ . '/helper.php');
JHtml::_('script', 'mod_b3_carousel/jquery.mobile.touch.min.js', ['relative' => true]);
JHtml::_('script', 'mod_b3_carousel/b3_carousel.js', ['relative' => true]);
$doc = JFactory::getDocument();
$now = JFactory::getDate();
/* Module id */
$module_id = $module->id;
/* Params */
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
$indicators = (int) $params->get('indicators', 1);
$controls = (int) $params->get('controls', 1);
$interval = (int) $params->get('interval', 5000);
$interval = $interval !== 5000 ? ' data-interval="' . $interval . '"' : '';
$interval = $params->def('autoslide', 1) ? $interval : ' data-interval="false"';
$transition = (int) $params->get('transition') !== 0 ? ' carousel-fade' : '';
$pause = !$params->def('pause', 1) ? ' data-pause="false"' : '';
$wrap = !$params->def('wrap', 1) ? ' data-wrap="false"' : '';
$keyboard = !$params->def('keyboard', 1) ? ' data-keyboard="false"' : '';
$images = $params->get('slides');
$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') {
$item = '';
$ctrlNext = 'right carousel-control';
$ctrlPrev = 'left carousel-control';
$spanNext = 'glyphicon glyphicon-chevron-right';
$spanPrev = 'glyphicon glyphicon-chevron-left';
JHtml::_('stylesheet', 'mod_b3_carousel/b3_carousel.css', ['relative' => true]);
}
require JModuleHelper::getLayoutPath('mod_b3_carousel', $params->get('layout', 'default'));