-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmod_anythingslider.php
148 lines (134 loc) · 5.23 KB
/
mod_anythingslider.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<?php
/**
* AnythingSlider Module Entry Point
*
* @version 1.3.0
* @package Joomla 1.5.0
* @subpackage Modules
* @Copyright Copyright (c)2010 Dnote Software; Joomla 2.5 updates (c)2012-2013 Akadamia
* @license GNU/GPL, see the gpl-3.0.txt file included in this package
* Modified by Akadamia http://www.akadamia.co.uk to work with Joomla 2.5.8
*
* mod_anythingslider 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.
*
* This program 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.
*
* Parts of this software are based on AnythingSlider By Chris Coyier: http://css-tricks.com
**/
//no direct access
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
// include the helper file
require_once(dirname(__FILE__).'/helper.php');
$params->set('intro_only', 1);
$params->set('hide_author', 1);
$params->set('hide_createdate', 0);
$params->set('hide_modifydate', 1);
// Disable edit ability icon
$access = new stdClass();
$access->canEdit = 0;
$access->canEditOwn = 0;
$access->canPublish = 0;
//params
$sliderwidth=$params->get( 'width' );
$sliderheight=$params->get( 'height' );
$loadjquery = $params->get( 'loadjquery' );
$loadfx = $params->get( 'loadfx' );
$loadvideo = $params->get( 'loadvideo' );
$number_items = $params->get( 'items' );
// Appearance
$slidertheme=$params->get( 'theme' );
$slidermode=$params->get( 'mode' );
$aswrapper=$params->get( 'wrapper' );
$sliderexpand=$params->get( 'expand' );
$resizecontents=$params->get( 'resizecontents' );
$showmultiple=$params->get( 'showmultiple' );
$easing=$params->get( 'easing' );
$togglearrows=$params->get( 'togglearrows' );
$togglecontrols=$params->get( 'togglecontrols' );
// $buildArrows
// $buildNavigation
// $buildStartStop
$starttext=$params->get( 'starttext' );
$stoptext=$params->get( 'stoptext' );
$forwardtext=$params->get( 'forwardtext' );
$backtext=$params->get( 'backtext' );
$tooltipclass=$params->get( 'tooltipclass' );
// Function
$enablearrows=$params->get( 'enablearrows' );
$enablenavigation=$params->get( 'enablenavigation' );
$enablestartstop=$params->get( 'enablestartstop' );
$enablekeyboard=$params->get( 'enablekeyboard' );
// Navigation
$startpanel=$params->get( 'startpanel' );
$changeby=$params->get( 'changeby' );
$hashtags=$params->get( 'hashtags' );
$infiniteslides=$params->get( 'infiniteslides' );
$navigation = $params->get( 'navigation' );
// $navigationFormatter
// $navigationSize
// Slideshow options
$autoplay = $params->get( 'autoplay' );
$autoplaylocked = $params->get( 'autoplaylocked' );
$autoplaydelayed = $params->get( 'autoplaydelayed' );
$pauseonhover = $params->get( 'pauseonhover' );
$stopatend = $params->get( 'stopatend' );
$playrtl = $params->get( 'playrtl' );
// Times
$delay = $params->get( 'delay' );
$resumedelay = $params->get( 'resumedelay' );
$animationtime = $params->get( 'animationtime' );
$delaybeforeanimate = $params->get( 'delaybeforeanimate' );
//append javascript AND css files
$document =& JFactory::getDocument();
if ($loadjquery) $document->addscript('http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
$document->addscript(JURI::root().'/modules/mod_anythingslider/js/jquery.easing.1.2.js');
$document->addscript(JURI::root().'/modules/mod_anythingslider/js/jquery.anythingslider.min.js');
if ($loadvideo) $document->addscript(JURI::root().'/modules/mod_anythingslider/js/jquery.anythingslider.video.min.js');
if ($loadfx) $document->addscript(JURI::root().'/modules/mod_anythingslider/js/jquery.anythingslider.fx.min.js');
if ($slidertheme != "default") {
$document->addStyleSheet(JURI::root().'/modules/mod_anythingslider/css/theme-'.$slidertheme.'.css');
} else {
$document->addStyleSheet(JURI::root().'/modules/mod_anythingslider/css/anythingslider.css');
}
$document->addStyleSheet(JURI::root().'/modules/mod_anythingslider/css/wrapper-'.$aswrapper.'.css');
$doc =& JFactory::getDocument();
// width is allowed to be a percentage, or a number (of px, px optional)
// check we have something valid, or use 100% as default
if (!preg_match('/^\d+%$/',$sliderwidth)) // NNN% is OK
{
if (!preg_match('/^\d+px$/',$sliderwidth)) // NNNpx is OK
{
if (preg_match('/^\d+$/',$sliderwidth))
{
$sliderwidth=$sliderwidth."px"; // NNN means NNNpx
} else {
$sliderwidth="100%"; // otherwise force 100%
}
}
}
$uniqueID = $module->id;
// set the slider, and the wrapper (needed for "expand")
$style = '#slider'.$uniqueID.' {'
. 'width:'.$sliderwidth.';'
. 'height:'.$sliderheight.'px;'
. 'list-style: none;'
. 'overflow-y: auto;'
. 'overflow-x: hidden;'
. '} '
. '#aswrapper {'
. 'width:'.$sliderwidth.';'
. 'height:'.$sliderheight.'px;'
. '}';
$doc->addStyleDeclaration( $style );
// get the items to display from the helper
$slideShow = ModSlideShow::getSlideshow($params, $access);
if ($number_items=="") $number_items = count($slideShow);
// include the template for display
require(JModuleHelper::getLayoutPath('mod_anythingslider'));
?>