From ea61ffbaa126c7f8c1568d0376604fad69913d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 26 May 2015 09:33:07 +0200 Subject: [PATCH 1/3] Added compatibility for Contao 4 --- dca/tl_rocksolid_slider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dca/tl_rocksolid_slider.php b/dca/tl_rocksolid_slider.php index b187411..a8877ab 100644 --- a/dca/tl_rocksolid_slider.php +++ b/dca/tl_rocksolid_slider.php @@ -41,7 +41,7 @@ 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slider']['editLicense'], 'href' => 'table=tl_rocksolid_slider_license', 'class' => 'header_icon', - 'icon' => 'system/themes/default/images/settings.gif', + 'icon' => 'system/themes/' . \Controller::getTheme() . '/images/settings.gif', ), 'all' => array( 'label' => &$GLOBALS['TL_LANG']['MSC']['all'], From 53ad5f4462b7e537cfe5d931e71f99e0e8d3e06d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 16 Jun 2015 10:46:22 +0200 Subject: [PATCH 2/3] Updated composer requirements for Contao 4 --- composer.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 514b2a3..289df89 100644 --- a/composer.json +++ b/composer.json @@ -18,9 +18,7 @@ "source":"https://github.com/madeyourday/contao-rocksolid-slider" }, "require":{ - "php":">=5.3", - "contao/core":">=3,<4", - "contao-community-alliance/composer-plugin":"~2.0" + "php":">=5.3" }, "autoload":{ "classmap":["src/"] From efee75ada3f57d89fb8de57a1246d59e54a39a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Tue, 16 Jun 2015 14:40:14 +0200 Subject: [PATCH 3/3] Added bundle and resources for Contao 4 --- config/autoload.php | 6 +++++- config/config.php | 5 ++++- src/MadeYourDay/Contao/Module/Slider.php | 10 +++++++--- src/MadeYourDay/Contao/Resources/contao | 1 + src/MadeYourDay/Contao/Resources/public | 1 + .../Contao/RockSolidSliderBundle.php | 20 +++++++++++++++++++ 6 files changed, 38 insertions(+), 5 deletions(-) create mode 120000 src/MadeYourDay/Contao/Resources/contao create mode 120000 src/MadeYourDay/Contao/Resources/public create mode 100644 src/MadeYourDay/Contao/RockSolidSliderBundle.php diff --git a/config/autoload.php b/config/autoload.php index f1b5010..4840c29 100644 --- a/config/autoload.php +++ b/config/autoload.php @@ -23,6 +23,10 @@ 'MadeYourDay\\Contao\\Model\\ContentModel' => 'system/modules/rocksolid-slider/src/MadeYourDay/Contao/Model/ContentModel.php', )); +$templatesFolder = version_compare(VERSION, '4.0', '>=') + ? 'vendor/madeyourday/contao-rocksolid-slider/templates' + : 'system/modules/rocksolid-slider/templates'; + TemplateLoader::addFiles(array( - 'rsts_default' => 'system/modules/rocksolid-slider/templates', + 'rsts_default' => $templatesFolder, )); diff --git a/config/config.php b/config/config.php index 533de5e..950f4ac 100644 --- a/config/config.php +++ b/config/config.php @@ -24,7 +24,10 @@ 'tl_content', 'tl_rocksolid_slider_license', ), - 'icon' => 'system/modules/rocksolid-slider/assets/img/icon.png', + 'icon' => (version_compare(VERSION, '4.0', '>=') + ? 'bundles/rocksolidslider' + : 'system/modules/rocksolid-slider/assets' + ) . '/img/icon.png', ); array_insert($GLOBALS['FE_MOD'], 2, array( diff --git a/src/MadeYourDay/Contao/Module/Slider.php b/src/MadeYourDay/Contao/Module/Slider.php index 60637e5..ffda388 100644 --- a/src/MadeYourDay/Contao/Module/Slider.php +++ b/src/MadeYourDay/Contao/Module/Slider.php @@ -338,9 +338,13 @@ protected function compile() $this->Template->options = $options; - $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rocksolid-slider/assets/js/rocksolid-slider.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->arrData['rsts_skin']) ? 'default' : $this->arrData['rsts_skin']) . '-skin.min.css'; + $assetsDir = version_compare(VERSION, '4.0', '>=') + ? 'web/bundles/rocksolidslider' + : 'system/modules/rocksolid-slider/assets'; + + $GLOBALS['TL_JAVASCRIPT'][] = $assetsDir . '/js/rocksolid-slider.min.js|static'; + $GLOBALS['TL_CSS'][] = $assetsDir . '/css/rocksolid-slider.min.css||static'; + $skinPath = $assetsDir . '/css/' . (empty($this->arrData['rsts_skin']) ? 'default' : $this->arrData['rsts_skin']) . '-skin.min.css'; if (file_exists(TL_ROOT . '/' . $skinPath)) { $GLOBALS['TL_CSS'][] = $skinPath . '||static'; } diff --git a/src/MadeYourDay/Contao/Resources/contao b/src/MadeYourDay/Contao/Resources/contao new file mode 120000 index 0000000..c866b86 --- /dev/null +++ b/src/MadeYourDay/Contao/Resources/contao @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/src/MadeYourDay/Contao/Resources/public b/src/MadeYourDay/Contao/Resources/public new file mode 120000 index 0000000..2b56518 --- /dev/null +++ b/src/MadeYourDay/Contao/Resources/public @@ -0,0 +1 @@ +../../../../assets \ No newline at end of file diff --git a/src/MadeYourDay/Contao/RockSolidSliderBundle.php b/src/MadeYourDay/Contao/RockSolidSliderBundle.php new file mode 100644 index 0000000..599af3a --- /dev/null +++ b/src/MadeYourDay/Contao/RockSolidSliderBundle.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace MadeYourDay\Contao; + +use Symfony\Component\HttpKernel\Bundle\Bundle; + +/** + * Configures the RockSolid Slider bundle. + * + * @author Martin Auswöger + */ +class RockSolidSliderBundle extends Bundle +{ +}