forked from vinaora/vinaora-nivo-slider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod_vt_nivo_slider.php
119 lines (86 loc) · 3.67 KB
/
mod_vt_nivo_slider.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/**
* @package VINAORA NIVO SLIDER
* @subpackage mod_vt_nivo_slider
* @copyright Copyright (C) 2011-2014 VINAORA. All rights reserved.
* @license GNU General Public License version 2 or later.
*/
// no direct access
defined('_JEXEC') or die;
use Joomla\CMS\Uri\Uri;
// Require the base helper class only once
require_once __DIR__ . '/helper.php';
$module_id = $module->id;
$params->set('module_id', $module_id);
$helper = new ModVTNivoSliderHelper($params);
// Add the main stylesheet of Nivo Slider to <head> tag
$helper->addNivoCSS();
// Running demo slideshow
$demo = $params->get('demo');
if ($demo != "-1") $params->set('layout', $demo);
// Get Nivo theme and module layout
$theme = $params->get('theme', 'default');
$layout = $params->get('layout', 'default');
// Add the theme stylesheet of Nivo Slider to <head> tag
$helper->addThemCSS($theme, $layout);
// Add jQuery library.
$helper->addJQuery();
// Add Nivo Slider script to <head> tag
$helper->addNivoScript();
// Get basic parameters for Nivo Slider script
$effect = $params->get('effect');
$slices = $params->get('slices');
$boxCols = $params->get('boxCols');
$boxRows = $params->get('boxRows');
$animSpeed = (int) $params->get('animSpeed');
$pauseTime = (int) $params->get('pauseTime');
$startSlide = (int) $params->get('startSlide');
$directionNav = $params->get('directionNav');
$controlNav = $params->get('controlNav');
$controlNavThumbs = $params->get('controlNavThumbs', 'false');
$pauseOnHover = $params->get('pauseOnHover');
$manualAdvance = $params->get('manualAdvance');
$randomStart = $startSlide ? 'false' : 'true';
$prevText = htmlspecialchars($params->get('prevText'), ENT_QUOTES);
$nextText = htmlspecialchars($params->get('nextText'), ENT_QUOTES);
$ribbon = (int) $params->get('ribbon');
if ($layout == 'default')
{
$slide_width = $params->get('slide_width');
$slide_height = $params->get('slide_height');
// Get the parameters for 'amazing' theme
$slide_bgcolor = $params->get('slide_bgcolor');
$slide_bdcolor = $params->get('slide_bdcolor');
$slide_bdwidth = $params->get('slide_bdwidth');
$slide_bdrounded = $params->get('slide_bdrounded');
$slide_bdshadow = $params->get('slide_bdshadow');
$controlPosition = $params->get('controlPosition');
$controlStyle = $params->get('controlStyle');
$arrowStyle = $params->get('arrowStyle');
$captionPosition = $params->get('captionPosition');
$captionMarginVertical = $params->get('captionMarginVertical');
$captionMarginHorizontal = $params->get('captionMarginHorizontal');
$titleFontStyle = $params->get('titleFontStyle');
$titleFontSize = $params->get('titleFontSize');
$titleColor = $params->get('titleColor');
$descFontSize = $params->get('descFontSize');
$descColor = $params->get('descColor');
$descFontStyle = $params->get('descFontStyle');
$captionWidth = $params->get('captionWidth');
$captionHeight = $params->get('captionHeight');
$captionBackground = $params->get('captionBackground');
$captionMargin = $params->get('captionMargin');
$captionRounded = $params->get('captionRounded');
// Create slider
$startSlide = $helper->getStartSlide($params);
$slider = $helper->getSlider($params);
// Get the HTML code of images
$images = $slider['images'];
// Image not found
if (empty($images)) $images = JText::_('MOD_VT_NIVO_SLIDER_ERROR_IMAGE_NOT_FOUND');
// Get the HTML code of captions
$captions = $slider['captions'];
}
$base_url = Uri::root(true);
$moduleclass_sfx = htmlspecialchars((string)$params->get('moduleclass_sfx'));
require Joomla\CMS\Helper\ModuleHelper::getLayoutPath('mod_vt_nivo_slider', $params->get('layout', 'default'));