-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rocksolid-slider/assets/js/rocksolid-slider-1.1.0.min.js|static'; | ||
$GLOBALS['TL_CSS'][] = 'system/modules/rocksolid-slider/assets/css/rocksolid-slider.min.css||static'; | ||
$skinPath = 'system/modules/rocksolid-slider/assets/css/' . (empty($this->options['rsts_skin']) ? 'default' : $this->options['rsts_skin']) . '-skin.min.css'; | ||
if (file_exists(TL_ROOT . '/' . $skinPath)) { | ||
$GLOBALS['TL_CSS'][] = $skinPath . '||static'; | ||
} | ||
?> | ||
|
||
<div class="<?php echo $this->class ?> block"<?php echo $this->cssID ?><?php if ($this->style): ?> style="<?php echo $this->style ?>"<?php endif ?>> | ||
|
||
<?php if ($this->headline): ?> | ||
<<?php echo $this->hl ?>><?php echo $this->headline ?></<?php echo $this->hl ?>> | ||
<?php endif ?> | ||
|
||
<?php foreach ($this->images as $image): ?> | ||
|
||
<div data-rsts-type="image"> | ||
<img src="<?php echo $image->src ?>"<?php echo $image->imgSize ?> alt="<?php echo $image->alt ?>" /> | ||
<?php if ($image->href): ?> | ||
<a href="<?php echo $image->href ?>">more...</a> | ||
<?php endif ?> | ||
<?php if ($image->caption): ?> | ||
<p class="caption"><?php echo $image->caption ?></p> | ||
<?php endif ?> | ||
</div> | ||
|
||
<?php endforeach ?> | ||
|
||
<?php foreach ($this->slides as $slide): ?> | ||
|
||
<?php if (! empty($slide['videoURL'])): ?> | ||
|
||
<img<?php if (! empty($slide['title'])): ?> data-rsts-name="<?php echo $slide['title'] ?>"<?php endif ?> data-rsts-type="video" data-rsts-video="<?php echo $slide['videoURL'] ?>" src="<?php echo $slide['image']->src ?>" /> | ||
|
||
<?php elseif (! empty($slide['image'])): ?> | ||
|
||
<div data-rsts-type="image"<?php if (! empty($slide['title'])): ?> data-rsts-name="<?php echo $slide['title'] ?>"<?php endif ?>> | ||
<img src="<?php echo $slide['image']->src ?>"<?php echo $slide['image']->imgSize ?> alt="<?php echo $slide['image']->alt ?>" /> | ||
<?php if ($slide['image']->href): ?> | ||
<a class="rsts-details" href="<?php echo $slide['image']->href ?>">more...</a> | ||
<?php endif ?> | ||
<?php if ($slide['image']->caption): ?> | ||
<p class="rsts-text"><?php echo $slide['image']->caption ?></p> | ||
<?php endif ?> | ||
</div> | ||
|
||
<?php else: ?> | ||
|
||
<div<?php if (! empty($slide['title'])): ?> data-rsts-name="<?php echo $slide['title'] ?>"<?php endif ?>> | ||
<?php echo $slide['text'] ?> | ||
</div> | ||
|
||
<?php endif ?> | ||
|
||
<?php endforeach ?> | ||
|
||
</div> | ||
|
||
<script type="text/javascript"> | ||
//<![CDATA[ | ||
jQuery('.mod_rocksolid_slider').last().rstSlider(<?php | ||
|
||
$options = array(); | ||
|
||
// strings | ||
foreach (array('type', 'direction', 'cssPrefix', 'skin', 'width', 'height', 'navType', 'scaleMode', 'deepLinkPrefix') as $key) { | ||
if (! empty($this->options['rsts_' . $key])) { | ||
$options[$key] = $this->options['rsts_' . $key]; | ||
} | ||
} | ||
|
||
// boolean | ||
foreach (array('random', 'videoAutoplay', 'autoplayProgress', 'pauseAutoplayOnHover', 'keyboard', 'captions') as $key) { | ||
$options[$key] = (bool) $this->options['rsts_' . $key]; | ||
} | ||
|
||
// positive numbers | ||
foreach (array('preloadSlides', 'duration', 'autoplay', 'autoplayRestart') as $key) { | ||
if (! empty($this->options['rsts_' . $key]) && $this->options['rsts_' . $key] > 0) { | ||
$options[$key] = $this->options['rsts_' . $key] * 1; | ||
} | ||
} | ||
|
||
$options['gapSize'] = $this->options['rsts_gapSize'] * 1; | ||
|
||
echo json_encode($options); | ||
?>); | ||
//]]> | ||
</script> |