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/"] 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/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'], 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 +{ +}