Skip to content

Commit

Permalink
Added options invertControls, slideClass and sliderClass, closes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Dec 12, 2014
1 parent bf66229 commit 2f14c6c
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
23 changes: 22 additions & 1 deletion dca/tl_rocksolid_slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
),

'palettes' => array(
'default' => '{title_legend},title,videoURL,singleSRC,scaleMode,imagePosition,centerContent;{background_legend},getPro;{publish_legend},published,start,stop',
'default' => '{title_legend},title,videoURL,singleSRC,scaleMode,imagePosition,centerContent,invertControls;{background_legend},getPro;{expert_legend},slideClass,sliderClass;{publish_legend},published,start,stop',
),

'fields' => array(
Expand Down Expand Up @@ -176,13 +176,34 @@
),
'sql' => "varchar(64) NOT NULL default ''",
),
'invertControls' => array(
'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['invertControls'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''",
),
'getPro' => array(
'input_field_callback' => function() {
return '<div>'
. $GLOBALS['TL_LANG']['tl_rocksolid_slide']['getPro']
. '</div>';
},
),
'slideClass' => array(
'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['slideClass'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50 clr'),
'sql' => "varchar(255) NOT NULL default ''",
),
'sliderClass' => array(
'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['sliderClass'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('maxlength' => 255, 'tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''",
),
'published' => array(
'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'],
'exclude' => true,
Expand Down
7 changes: 7 additions & 0 deletions languages/de/tl_rocksolid_slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['x'] = 'Horizontal zentrieren';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['y'] = 'Vertikal zentrieren';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['true'] = 'Horizontal und vertikal zentrieren';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['invertControls'][0] = 'Slider-Navigation invertieren';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['invertControls'][1] = 'Invertiert die Slider-Navigation für diesen Slide (nicht auf alle Skins anwendbar).';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['background_legend'] = 'Hintergrund';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['getPro'] = 'Für dieses Feature wird die Pro-Version des Sliders benötigt, <a target="_blank" href="http://rocksolidthemes.com/de/contao/plugins/responsive-slider">jetzt Pro-Version kaufen</a>.';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['expert_legend'] = 'Experten-Einstellungen';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['slideClass'][0] = 'CSS-Klasse';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['slideClass'][1] = 'Eine oder mehrere Klassen für das Slide-Element.';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['sliderClass'][0] = 'Slider-CSS-Klasse';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['sliderClass'][1] = 'Diese Klasse wird dem Slider zugewiesen sobald dieser Slide aktiv ist.';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['publish_legend'] = 'Veröffentlichung';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][0] = 'Slide veröffentlichen';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][1] = 'Den Slide auf der Webseite anzeigen.';
Expand Down
7 changes: 7 additions & 0 deletions languages/en/tl_rocksolid_slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['x'] = 'Horizontal';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['y'] = 'Vertical';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['centerContents']['true'] = 'Horizontal and vertical';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['invertControls'][0] = 'Invert slider controls';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['invertControls'][1] = 'Inverts the slider controls for this slide (not applicable for all skins).';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['background_legend'] = 'Background';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['getPro'] = 'This feature requires the pro version of the slider, <a target="_blank" href="http://rocksolidthemes.com/en/contao/plugins/responsive-slider">buy pro version now</a>.';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['expert_legend'] = 'Expert settings';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['slideClass'][0] = 'CSS class';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['slideClass'][1] = 'One or more classes for this slide element.';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['sliderClass'][0] = 'Slider CSS class';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['sliderClass'][1] = 'This class gets assigned to the slider once this slide is active.';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['publish_legend'] = 'Publish';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][0] = 'Publish slide';
$GLOBALS['TL_LANG']['tl_rocksolid_slide']['published'][1] = 'Display the slide on the website.';
Expand Down
11 changes: 11 additions & 0 deletions templates/rsts_default.html5
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
}
$attributes[] = 'data-rsts-center="' . $slide['centerContent'] . '"';
}
if (!empty($slide['slideClass'])) {
$attributes[] = 'class="' . $slide['slideClass'] . '"';
}
if (!empty($slide['invertControls'])) {
$slide['sliderClass'] = (empty($slide['sliderClass']) ? '' : $slide['sliderClass'] . ' ')
. (empty($this->options['cssPrefix']) ? 'rsts-' : $this->options['cssPrefix'])
. 'invert-controls';
}
if (!empty($slide['sliderClass'])) {
$attributes[] = 'data-rsts-class="' . $slide['sliderClass'] . '"';
}
$attributes = implode(' ', $attributes);

$imageAttributes = array();
Expand Down
11 changes: 11 additions & 0 deletions templates/rsts_default.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
}
$attributes[] = 'data-rsts-center="' . $slide['centerContent'] . '"';
}
if (!empty($slide['slideClass'])) {
$attributes[] = 'class="' . $slide['slideClass'] . '"';
}
if (!empty($slide['invertControls'])) {
$slide['sliderClass'] = (empty($slide['sliderClass']) ? '' : $slide['sliderClass'] . ' ')
. (empty($this->options['cssPrefix']) ? 'rsts-' : $this->options['cssPrefix'])
. 'invert-controls';
}
if (!empty($slide['sliderClass'])) {
$attributes[] = 'data-rsts-class="' . $slide['sliderClass'] . '"';
}
$attributes = implode(' ', $attributes);

$imageAttributes = array();
Expand Down

0 comments on commit 2f14c6c

Please sign in to comment.