vendor/contao-themes-net/mate-theme-bundle/src/Module/ModuleNewsListMate.php line 10

Open in your IDE?
  1. <?php
  2. namespace ContaoThemesNet\MateThemeBundle\Module;
  3. class ModuleNewsListMate extends \Contao\ModuleNewsList {
  4.     /**
  5.      * Generate the module
  6.      */
  7.     protected function compile()
  8.     {
  9.         if( strpos($this->customTpl,"mod_newslist_mate_slider") !== false ) {
  10.             if($this->mateSliderHeight == ""$mateSliderHeight "460";
  11.             else $mateSliderHeight $this->mateSliderHeight;
  12.             if($this->mateSliderInterval == ""$mateSliderInterval "12000";
  13.             else $mateSliderInterval $this->mateSliderInterval;
  14.             if($this->mateSliderDuration == ""$mateSliderDuration "150";
  15.             else $mateSliderDuration $this->mateSliderDuration;
  16.             $indicators "";
  17.             if($this->mateSliderIndicators == 1) {
  18.                 $mateSliderIndicators 'true';
  19.                 $indicators '
  20.                 $( ".slider.mod_newslist .sliderImage" ).each(function( index ) {
  21.                   var headline = $(this).find("h2").text();
  22.                   var subheadline = $(this).find(".subheadline").text();
  23.                   var i = index;
  24.                   $( ".slider.mod_newslist .indicator-item" ).each(function( index ) {
  25.                     if(i == index) {
  26.                         $(this).append("<span class=\'inner\'></span>");
  27.                         $(this).find(".inner").append("<span class=\'subheadline\'>" + subheadline + "</span>");
  28.                         $(this).find(".inner").append("<span class=\'headline\'>" + headline + "</span>");
  29.                     }
  30.                   });
  31.                 });
  32.             ';
  33.             } else {
  34.                 $mateSliderIndicators 'false';
  35.             }
  36.             $GLOBALS['TL_BODY'][] = '
  37.             <script>
  38.             jQuery(document).ready(function($) {
  39.                 $(".slider.mod_newslist").slider({
  40.                     height: '.$mateSliderHeight.',
  41.                     indicators: '.$mateSliderIndicators.',
  42.                     interval: '.$mateSliderInterval.',
  43.                     duration: '.$mateSliderDuration.'
  44.                 });
  45.                 $( ".slider.mod_newslist .next" ).click(function() {
  46.                   $(this).closest(".slider").slider("next");
  47.                 });
  48.                 $( ".slider.mod_newslist .prev" ).click(function() {
  49.                   $(this).closest(".slider").slider("prev");
  50.                 });
  51.                 '.$indicators.'
  52.             });
  53.             </script>
  54.             ';
  55.         }
  56.         return parent::compile();
  57.     }
  58. }