Skip to content

Commit

Permalink
Added slider content element, closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Feb 18, 2014
1 parent 41e49c8 commit 0036204
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
$GLOBALS['TL_MODELS']['tl_rocksolid_slider'] = 'MadeYourDay\\Contao\\Model\\SliderModel';
$GLOBALS['TL_MODELS']['tl_rocksolid_slide'] = 'MadeYourDay\\Contao\\Model\\SlideModel';

$GLOBALS['TL_CTE']['includes']['rocksolid_slider'] = 'MadeYourDay\\Contao\\Module\\Slider';

$GLOBALS['BE_MOD']['content']['rocksolid_slider'] = array(
'tables' => array('tl_rocksolid_slider', 'tl_rocksolid_slide', 'tl_content'),
'icon' => 'system/modules/rocksolid-slider/assets/img/icon.png',
Expand Down
229 changes: 229 additions & 0 deletions dca/tl_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,232 @@
if (Input::get('do') == 'rocksolid_slider') {
$GLOBALS['TL_DCA']['tl_content']['config']['ptable'] = 'tl_rocksolid_slide';
}

$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_slider'] = '{type_legend},type,headline;{rocksolid_slider_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_autoplay,rsts_videoAutoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_navType,rsts_controls,rsts_scaleMode,rsts_deepLinkPrefix,rsts_keyboard,rsts_captions;{template_legend:hide},rsts_template,imgSize;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop';

$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_id'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_id'],
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('MadeYourDay\\Contao\\Slider', 'getSliderIds'),
'eval' => array('mandatory' => true),
'sql' => "int(10) unsigned NOT NULL default '0'",
);
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_template'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_template'],
'default' => 'rsts_default',
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('MadeYourDay\\Contao\\Slider', 'getSliderTemplates'),
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(32) NOT NULL default ''",
);
// slider type (slide or fade)
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_type'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_type'],
'exclude' => true,
'inputType' => 'select',
'options' => array('slide' => 'slide', 'fade' => 'fade'),
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''",
);
// "x" for horizontal or "y" for vertical
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_direction'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_direction'],
'exclude' => true,
'inputType' => 'select',
'options' => array(
'x' => $GLOBALS['TL_LANG']['tl_content']['rsts_direction_x'],
'y' => $GLOBALS['TL_LANG']['tl_content']['rsts_direction_y'],
),
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''",
);
// if true the slides get shuffled once on initialization
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_random'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_random'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''",
);
// slider skin (set this to "none" to disable the default skin)
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_skin'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_skin'],
'exclude' => true,
'inputType' => 'select',
'options' => array(
'',
'default-content',
'liquid',
'dark',
'light',
'custom',
),
'reference' => &$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options'],
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''",
);
// set width and height to one of the following values
// - "css": get the size from the applied css (default)
// - a css lenght value: e.g. "100%", "500px", "50em"
// - "auto": get the size from the active slide dimensions at runtime
// height can be set to auto only if the direction is "x"
// - a proportion: keep a fixed proportion for the slides, e.g. "480x270"
// this must not set to both dimensions
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_width'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_width'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''",
);
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_height'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_height'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''",
);
// number of slides to preload (to the left/right or top/bottom)
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_preloadSlides'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_preloadSlides'],
'exclude' => true,
'inputType' => 'select',
'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9),
'eval' => array('tl_class' => 'w50', 'includeBlankOption' => true),
'sql' => "int(10) unsigned NOT NULL default '0'",
);
// gap between the slides
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_gapSize'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_gapSize'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'",
);
// duration of the slide animation in milliseconds
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_duration'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_duration'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'",
);
// false or the duration between slides in milliseconds
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_autoplay'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'",
);
// true to autoplay videos
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_videoAutoplay'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_videoAutoplay'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default ''",
);
// false or the duration between user interaction and autoplay
// (must be bigger than autoplay)
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_autoplayRestart'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayRestart'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50'),
'sql' => "int(10) unsigned NOT NULL default '0'",
);
// displays a progress bar
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_autoplayProgress'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayProgress'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
);
// true to pause the autoplay on hover
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_pauseAutoplayOnHover'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_pauseAutoplayOnHover'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default ''",
);
// navigation type (bullets, numbers, tabs)
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_navType'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_navType'],
'exclude' => true,
'inputType' => 'select',
'options' => array(
'bullets' => $GLOBALS['TL_LANG']['tl_content']['rsts_navType_bullets'],
'numbers' => $GLOBALS['TL_LANG']['tl_content']['rsts_navType_numbers'],
'tabs' => $GLOBALS['TL_LANG']['tl_content']['rsts_navType_tabs'],
'none' => $GLOBALS['TL_LANG']['tl_content']['rsts_navType_none'],
),
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''",
);
// false to hide the prev and next controls
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_controls'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_controls'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50 m12'),
'sql' => "char(1) NOT NULL default '1'",
);
// image scale mode (fit, crop, scale)
// only works if width and height are not set to "auto"
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_scaleMode'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode'],
'exclude' => true,
'inputType' => 'select',
'options' => array(
'fit' => $GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_fit'],
'crop' => $GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_crop'],
'scale' => $GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_scale'],
),
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''",
);
// URL hash prefix or false to disable deep linking, e.g. "slider-"
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_deepLinkPrefix'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_deepLinkPrefix'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(255) NOT NULL default ''",
);
// true to enable keyboard arrow navigation
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_keyboard'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_keyboard'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default '1'",
);
// true to enable keyboard arrow navigation
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_captions'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_captions'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class' => 'w50'),
'sql' => "char(1) NOT NULL default '1'",
);
// custom slider skin (rsts_skin gets ignored if this is set)
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_customSkin'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_customSkin'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50 clr'),
'sql' => "varchar(64) NOT NULL default ''",
);
// prefix for all RockSolid Slider specific css class names
$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_cssPrefix'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['rsts_cssPrefix'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('tl_class' => 'w50'),
'sql' => "varchar(64) NOT NULL default ''",
);
4 changes: 3 additions & 1 deletion languages/de/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
$GLOBALS['TL_LANG']['MOD']['rocksolid_slider'][0] = 'RockSolid Slider';
$GLOBALS['TL_LANG']['MOD']['rocksolid_slider'][1] = 'Slider und Slider-Elemente verwalten';

$GLOBALS['TL_LANG']['FMD']['rocksolid_slider'] = array('RockSolid Slider', 'jQuery Slider für Bilder, Videos und Content-Elemente.');
$GLOBALS['TL_LANG']['FMD']['rocksolid_slider'] =
$GLOBALS['TL_LANG']['CTE']['rocksolid_slider'] =
array('RockSolid Slider', 'jQuery Slider für Bilder, Videos und Content-Elemente.');
78 changes: 78 additions & 0 deletions languages/de/tl_content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php
/*
* Copyright MADE/YOUR/DAY OG <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

/**
* RockSolid Slider module translations
*
* @author Martin Auswöger <[email protected]>
*/

$GLOBALS['TL_LANG']['tl_content']['rocksolid_slider_legend'] = 'RockSolid Slider';
$GLOBALS['TL_LANG']['tl_content']['rsts_id'][0] = 'Slider';
$GLOBALS['TL_LANG']['tl_content']['rsts_id'][1] = 'Die Inhalte können unter <i>Inhalte › RockSolid Slider</i> verwaltet werden.';
$GLOBALS['TL_LANG']['tl_content']['rsts_type'][0] = 'Animationstyp';
$GLOBALS['TL_LANG']['tl_content']['rsts_type'][1] = 'Bei "slide" bewegen sich die Elemente horizontal oder vertikal. Bei "fade" werden die Elemente überblendet.';
$GLOBALS['TL_LANG']['tl_content']['rsts_direction'][0] = 'Ausrichtung';
$GLOBALS['TL_LANG']['tl_content']['rsts_direction'][1] = 'Ausrichtung der Slide-Bewegung (nur für Animationstyp "slide").';
$GLOBALS['TL_LANG']['tl_content']['rsts_direction_x'] = 'Horizontal';
$GLOBALS['TL_LANG']['tl_content']['rsts_direction_y'] = 'Vertikal';
$GLOBALS['TL_LANG']['tl_content']['rsts_random'][0] = 'Zufällige Sortierung';
$GLOBALS['TL_LANG']['tl_content']['rsts_random'][1] = 'Wenn aktiviert werden die einzelnen Slides beim Start zufällig sortiert.';
$GLOBALS['TL_LANG']['tl_content']['rsts_skin'][0] = 'Slider-Skin';
$GLOBALS['TL_LANG']['tl_content']['rsts_skin'][1] = 'Wählen Sie einen der mitgelieferten Skins oder verwenden Sie Ihren eigenen.';
$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options'][''] = 'Standard';
$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['default-content'] = 'Standard Inhalt';
$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['liquid'] = 'Liquid';
$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['dark'] = 'Dark';
$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['light'] = 'Light';
$GLOBALS['TL_LANG']['tl_content']['rsts_skin_options']['custom'] = 'eigener Skin (siehe Experten-Einstellungen)';
$GLOBALS['TL_LANG']['tl_content']['rsts_width'][0] = 'Breite';
$GLOBALS['TL_LANG']['tl_content']['rsts_width'][1] = 'Mögliche Werte: "css", "auto", eine CSS-Längen-Angabe oder eine Proportion (z.B.: 640x360). Bei "css" wird die Breite aus dem Stylesheet übernommen.';
$GLOBALS['TL_LANG']['tl_content']['rsts_height'][0] = 'Höhe';
$GLOBALS['TL_LANG']['tl_content']['rsts_height'][1] = 'Mögliche Werte: "css", "auto", eine CSS-Längen-Angabe oder eine Proportion (z.B.: 640x360). Bei "css" wird die Höhe aus dem Stylesheet übernommen.';
$GLOBALS['TL_LANG']['tl_content']['rsts_preloadSlides'][0] = 'Slides vorausladen';
$GLOBALS['TL_LANG']['tl_content']['rsts_preloadSlides'][1] = 'Anzahl der Slides die vorausgeladen werden sollen.';
$GLOBALS['TL_LANG']['tl_content']['rsts_gapSize'][0] = 'Slide-Abstand';
$GLOBALS['TL_LANG']['tl_content']['rsts_gapSize'][1] = 'Abstand zwischen den einzelnen Slider-Elementen in Pixeln.';
$GLOBALS['TL_LANG']['tl_content']['rsts_duration'][0] = 'Animationsdauer';
$GLOBALS['TL_LANG']['tl_content']['rsts_duration'][1] = 'Dauer der Animation in Millisekunden (0 für die Standarddauer).';
$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay'][0] = 'Autoplaydauer';
$GLOBALS['TL_LANG']['tl_content']['rsts_autoplay'][1] = 'Autoplay-Wartezeit zwischen den Slide-Vorgängen in Millisekunden (0 für kein Autoplay).';
$GLOBALS['TL_LANG']['tl_content']['rsts_videoAutoplay'][0] = 'Video-Autoplay';
$GLOBALS['TL_LANG']['tl_content']['rsts_videoAutoplay'][1] = 'Videos automatisch starten sobald sie angezeigt werden.';
$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayRestart'][0] = 'Autoplay-Neustart-Dauer';
$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayRestart'][1] = 'Wartezeit bis ein Autoplay-Vorgang nach einer Benutzer-Interaktion erneut gestartet wird (muss größer als die Autoplay-Dauer sein oder 0 für keinen Autoplay-Neustart).';
$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayProgress'][0] = 'Autoplay-Fortschrittsbalken';
$GLOBALS['TL_LANG']['tl_content']['rsts_autoplayProgress'][1] = 'Zeigt den aktuellen Autoplay-Status als Fortschrittsbalken an.';
$GLOBALS['TL_LANG']['tl_content']['rsts_pauseAutoplayOnHover'][0] = 'Autoplay bei hover pausieren';
$GLOBALS['TL_LANG']['tl_content']['rsts_pauseAutoplayOnHover'][1] = 'Autoplay pausieren sobald man die Maus über den Slider bewegt.';
$GLOBALS['TL_LANG']['tl_content']['rsts_navType'][0] = 'Navigationstyp';
$GLOBALS['TL_LANG']['tl_content']['rsts_navType'][1] = 'Wählen Sie den gewünschten Navigations-Typ.';
$GLOBALS['TL_LANG']['tl_content']['rsts_navType_bullets'] = 'Punkte';
$GLOBALS['TL_LANG']['tl_content']['rsts_navType_numbers'] = 'Nummeriert';
$GLOBALS['TL_LANG']['tl_content']['rsts_navType_tabs'] = 'Tabs';
$GLOBALS['TL_LANG']['tl_content']['rsts_navType_none'] = 'Navigation ausblenden';
$GLOBALS['TL_LANG']['tl_content']['rsts_controls'][0] = 'Weiter und Zurück anzeigen';
$GLOBALS['TL_LANG']['tl_content']['rsts_controls'][1] = 'Aktiviert die Navigationspfeile.';
$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode'][0] = 'Skalierungsmodus';
$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode'][1] = 'Achtung: Hat keine Auswirkung wenn Höhe oder Breite auf "auto" gesetzt ist.';
$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_fit'] = 'Proportional';
$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_crop'] = 'Beschneiden';
$GLOBALS['TL_LANG']['tl_content']['rsts_scaleMode_scale'] = 'Verzerren';
$GLOBALS['TL_LANG']['tl_content']['rsts_deepLinkPrefix'][0] = 'Deep-Link-Prefix';
$GLOBALS['TL_LANG']['tl_content']['rsts_deepLinkPrefix'][1] = 'Beispiel: "slide-". Tragen Sie ein Prefix ein um Deep-Linking zu aktivieren.';
$GLOBALS['TL_LANG']['tl_content']['rsts_keyboard'][0] = 'Tastaturnavigation aktivieren';
$GLOBALS['TL_LANG']['tl_content']['rsts_keyboard'][1] = 'Bei aktivierter Tastatur-Navigation kann der Slider mit den Pfeiltasten gesteuert werden.';
$GLOBALS['TL_LANG']['tl_content']['rsts_captions'][0] = 'Titel in Slides anzeigen';
$GLOBALS['TL_LANG']['tl_content']['rsts_captions'][1] = 'Zeigt die Titel der Slides als Überschriften an.';
$GLOBALS['TL_LANG']['tl_content']['rsts_template'][0] = 'Template';
$GLOBALS['TL_LANG']['tl_content']['rsts_template'][1] = 'Slider-Template auswählen.';
$GLOBALS['TL_LANG']['tl_content']['rsts_customSkin'][0] = 'Eigener Slider-Skin';
$GLOBALS['TL_LANG']['tl_content']['rsts_customSkin'][1] = 'Geben Sie den Namen Ihres Skins ein. Weitere Informationen dazu finden Sie in der Dokumentation.';
$GLOBALS['TL_LANG']['tl_content']['rsts_cssPrefix'][0] = 'CSS-Prefix';
$GLOBALS['TL_LANG']['tl_content']['rsts_cssPrefix'][1] = 'Warnung: Nur bei Bedarf ändern! Lassen Sie das Feld leer um das Standard-Prefix "rsts-" zu verwenden.';
4 changes: 3 additions & 1 deletion languages/en/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
$GLOBALS['TL_LANG']['MOD']['rocksolid_slider'][0] = 'RockSolid Slider';
$GLOBALS['TL_LANG']['MOD']['rocksolid_slider'][1] = 'Edit slider and slider elements';

$GLOBALS['TL_LANG']['FMD']['rocksolid_slider'] = array('RockSolid Slider', 'jQuery slider for images, videos and content elements.');
$GLOBALS['TL_LANG']['FMD']['rocksolid_slider'] =
$GLOBALS['TL_LANG']['CTE']['rocksolid_slider'] =
array('RockSolid Slider', 'jQuery slider for images, videos and content elements.');
Loading

0 comments on commit 0036204

Please sign in to comment.