Skip to content

Commit

Permalink
Added bundle and resources for Contao 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Jun 16, 2015
1 parent 53ad5f4 commit efee75a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
6 changes: 5 additions & 1 deletion config/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
));
5 changes: 4 additions & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 7 additions & 3 deletions src/MadeYourDay/Contao/Module/Slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down
1 change: 1 addition & 0 deletions src/MadeYourDay/Contao/Resources/contao
1 change: 1 addition & 0 deletions src/MadeYourDay/Contao/Resources/public
20 changes: 20 additions & 0 deletions src/MadeYourDay/Contao/RockSolidSliderBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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.
*/

namespace MadeYourDay\Contao;

use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* Configures the RockSolid Slider bundle.
*
* @author Martin Auswöger <[email protected]>
*/
class RockSolidSliderBundle extends Bundle
{
}

0 comments on commit efee75a

Please sign in to comment.