@@ -139,13 +139,13 @@ discard block |
||
139 | 139 | { |
140 | 140 | $labels = parent::fieldLabels($includerelations); |
141 | 141 | |
142 | - $labels['Name'] = _t(__CLASS__ . '.NAME', 'Name'); |
|
143 | - $labels['Headline'] = _t(__CLASS__ . '.HEADLINE', 'Headline'); |
|
144 | - $labels['Description'] = _t(__CLASS__ . '.DESCRIPTION', 'Description'); |
|
145 | - $labels['SlideLinkID'] = _t(__CLASS__ . '.PAGE_LINK', "Call to action link"); |
|
146 | - $labels['Image'] = _t(__CLASS__ . '.IMAGE', 'Image'); |
|
147 | - $labels['SlideType'] = _t(__CLASS__ . '.SlideType', 'Image or Video'); |
|
148 | - $labels['Video'] = _t(__CLASS__ . '.VideoLabel', 'Video URL'); |
|
142 | + $labels['Name'] = _t(__CLASS__.'.NAME', 'Name'); |
|
143 | + $labels['Headline'] = _t(__CLASS__.'.HEADLINE', 'Headline'); |
|
144 | + $labels['Description'] = _t(__CLASS__.'.DESCRIPTION', 'Description'); |
|
145 | + $labels['SlideLinkID'] = _t(__CLASS__.'.PAGE_LINK', "Call to action link"); |
|
146 | + $labels['Image'] = _t(__CLASS__.'.IMAGE', 'Image'); |
|
147 | + $labels['SlideType'] = _t(__CLASS__.'.SlideType', 'Image or Video'); |
|
148 | + $labels['Video'] = _t(__CLASS__.'.VideoLabel', 'Video URL'); |
|
149 | 149 | |
150 | 150 | return $labels; |
151 | 151 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function getCMSFields() |
157 | 157 | { |
158 | - $this->beforeUpdateCMSFields(function ($fields) { |
|
158 | + $this->beforeUpdateCMSFields(function($fields) { |
|
159 | 159 | $fields->removeByName([ |
160 | 160 | 'ShowSlide', |
161 | 161 | 'SortOrder', |
@@ -170,19 +170,19 @@ discard block |
||
170 | 170 | // Name |
171 | 171 | $fields->dataFieldByName('Name') |
172 | 172 | ->setDescription( |
173 | - _t(__CLASS__ . '.INTERNAL_USE', 'for internal reference only') |
|
173 | + _t(__CLASS__.'.INTERNAL_USE', 'for internal reference only') |
|
174 | 174 | ); |
175 | 175 | |
176 | 176 | // Headline |
177 | 177 | $fields->dataFieldByName('Headline') |
178 | 178 | ->setDescription( |
179 | - _t(__CLASS__ . '.USED_IN_TEMPLATE', 'optional, used in template') |
|
179 | + _t(__CLASS__.'.USED_IN_TEMPLATE', 'optional, used in template') |
|
180 | 180 | ); |
181 | 181 | |
182 | 182 | // Description |
183 | 183 | $fields->dataFieldByName('Description') |
184 | 184 | ->setDescription( |
185 | - _t(__CLASS__ . '.USED_IN_TEMPLATE', 'optional, used in template') |
|
185 | + _t(__CLASS__.'.USED_IN_TEMPLATE', 'optional, used in template') |
|
186 | 186 | ); |
187 | 187 | |
188 | 188 | // Page link |
@@ -233,27 +233,27 @@ discard block |
||
233 | 233 | |
234 | 234 | if (!$this->Name) { |
235 | 235 | $result->addError( |
236 | - _t(__CLASS__ . '.NAME_REQUIRED', 'A Name is required before you can save') |
|
236 | + _t(__CLASS__.'.NAME_REQUIRED', 'A Name is required before you can save') |
|
237 | 237 | ); |
238 | 238 | } |
239 | 239 | |
240 | 240 | $types = $this->getTypeSource(); |
241 | 241 | |
242 | - if (isset($types['Video']) && $this->SlideType == 'Video' && !$this->VideoID) { |
|
242 | + if (isset($types['Video']) && $this->SlideType=='Video' && !$this->VideoID) { |
|
243 | 243 | $result->addError( |
244 | - _t(__CLASS__ . '.VIDEO_REQUIRED', 'An Video Link is required before you can save') |
|
244 | + _t(__CLASS__.'.VIDEO_REQUIRED', 'An Video Link is required before you can save') |
|
245 | 245 | ); |
246 | 246 | } |
247 | 247 | |
248 | - if (isset($types['Image']) && $this->SlideType == 'Image' && !$this->ImageID) { |
|
248 | + if (isset($types['Image']) && $this->SlideType=='Image' && !$this->ImageID) { |
|
249 | 249 | $result->addError( |
250 | - _t(__CLASS__ . '.IMAGE_REQUIRED', 'An Image is required before you can save') |
|
250 | + _t(__CLASS__.'.IMAGE_REQUIRED', 'An Image is required before you can save') |
|
251 | 251 | ); |
252 | 252 | } |
253 | 253 | |
254 | - if (isset($types['Text']) && $this->SlideType == 'Text' && !$this->Description) { |
|
254 | + if (isset($types['Text']) && $this->SlideType=='Text' && !$this->Description) { |
|
255 | 255 | $result->addError( |
256 | - _t(__CLASS__ . '.DESCRIPTION_REQUIRED', 'A Description is required before you can save') |
|
256 | + _t(__CLASS__.'.DESCRIPTION_REQUIRED', 'A Description is required before you can save') |
|
257 | 257 | ); |
258 | 258 | } |
259 | 259 | |
@@ -333,9 +333,9 @@ discard block |
||
333 | 333 | */ |
334 | 334 | public function renderWith($template = null, $customFields = null) |
335 | 335 | { |
336 | - if ($template === null) { |
|
336 | + if ($template===null) { |
|
337 | 337 | $template = static::class; |
338 | - $template = ($this->SlideType) ? $template . "_{$this->SlideType}" : ''; |
|
338 | + $template = ($this->SlideType) ? $template."_{$this->SlideType}" : ''; |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | return parent::renderWith($template); |
@@ -108,63 +108,63 @@ discard block |
||
108 | 108 | ]); |
109 | 109 | $SlidesField = GridField::create( |
110 | 110 | 'Slides', |
111 | - _t(__CLASS__ . '.SLIDES', 'Slides'), |
|
111 | + _t(__CLASS__.'.SLIDES', 'Slides'), |
|
112 | 112 | $this->owner->Slides()->sort('SortOrder'), |
113 | 113 | $config |
114 | 114 | ); |
115 | 115 | |
116 | - $slideTitle = $this->owner->slide_tab_title ?: _t(__CLASS__ . '.SLIDES', 'Slides'); |
|
116 | + $slideTitle = $this->owner->slide_tab_title ?: _t(__CLASS__.'.SLIDES', 'Slides'); |
|
117 | 117 | |
118 | 118 | $animations = []; |
119 | 119 | $animationOptions = $this->owner->dbObject('Animation')->getEnum(); |
120 | 120 | foreach ($animationOptions as $value) { |
121 | - $animations[$value] = _t(__CLASS__ . ".$value", $value); |
|
121 | + $animations[$value] = _t(__CLASS__.".$value", $value); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $fields->addFieldsToTab("Root.{$slideTitle}", [ |
125 | 125 | $SlidesField, |
126 | - ToggleCompositeField::create('ConfigHD', _t(__CLASS__ . '.SettingsLabel', 'Slider Settings'), [ |
|
126 | + ToggleCompositeField::create('ConfigHD', _t(__CLASS__.'.SettingsLabel', 'Slider Settings'), [ |
|
127 | 127 | DropdownField::create( |
128 | 128 | 'Animation', |
129 | - _t(__CLASS__ . '.ANIMATION_OPTION', 'Animation option'), |
|
129 | + _t(__CLASS__.'.ANIMATION_OPTION', 'Animation option'), |
|
130 | 130 | $animations |
131 | 131 | ), |
132 | 132 | CheckboxField::create( |
133 | 133 | 'Animate', |
134 | - _t(__CLASS__ . '.ANIMATE', 'Animate automatically') |
|
134 | + _t(__CLASS__.'.ANIMATE', 'Animate automatically') |
|
135 | 135 | ), |
136 | 136 | CheckboxField::create( |
137 | 137 | 'Loop', |
138 | - _t(__CLASS__ . '.LOOP', 'Loop the carousel') |
|
138 | + _t(__CLASS__.'.LOOP', 'Loop the carousel') |
|
139 | 139 | ), |
140 | 140 | CheckboxField::create( |
141 | 141 | 'SliderControlNav', |
142 | - _t(__CLASS__ . '.CONTROL_NAV', 'Show ControlNav') |
|
142 | + _t(__CLASS__.'.CONTROL_NAV', 'Show ControlNav') |
|
143 | 143 | ), |
144 | 144 | CheckboxField::create( |
145 | 145 | 'SliderDirectionNav', |
146 | - _t(__CLASS__ . '.DIRECTION_NAV', 'Show DirectionNav') |
|
146 | + _t(__CLASS__.'.DIRECTION_NAV', 'Show DirectionNav') |
|
147 | 147 | ), |
148 | 148 | CheckboxField::create( |
149 | 149 | 'ThumbnailNav', |
150 | - _t(__CLASS__ . '.THUMBNAIL_NAV', 'Thumbnail Navigation') |
|
150 | + _t(__CLASS__.'.THUMBNAIL_NAV', 'Thumbnail Navigation') |
|
151 | 151 | ), |
152 | 152 | //DisplayLogicWrapper::create( |
153 | 153 | CheckboxField::create( |
154 | 154 | 'CarouselControlNav', |
155 | - _t(__CLASS__ . '.CAROUSEL_CONTROL_NAV', 'Show Carousel ControlNav') |
|
155 | + _t(__CLASS__.'.CAROUSEL_CONTROL_NAV', 'Show Carousel ControlNav') |
|
156 | 156 | ), |
157 | 157 | CheckboxField::create( |
158 | 158 | 'CarouselDirectionNav', |
159 | - _t(__CLASS__ . '.CAROUSEL_DIRECTION_NAV', 'Show Carousel DirectionNav') |
|
159 | + _t(__CLASS__.'.CAROUSEL_DIRECTION_NAV', 'Show Carousel DirectionNav') |
|
160 | 160 | ), |
161 | 161 | NumericField::create( |
162 | 162 | 'CarouselThumbnailCt', |
163 | - _t(__CLASS__ . '.CAROUSEL_THUMBNAIL_COUNT', 'Number of thumbnails') |
|
163 | + _t(__CLASS__.'.CAROUSEL_THUMBNAIL_COUNT', 'Number of thumbnails') |
|
164 | 164 | ), |
165 | 165 | NumericField::create( |
166 | 166 | 'FlexSliderSpeed', |
167 | - _t(__CLASS__ . '.SLIDER_SPEED', 'Slider Speed') |
|
167 | + _t(__CLASS__.'.SLIDER_SPEED', 'Slider Speed') |
|
168 | 168 | ) |
169 | 169 | ->setDescription('In Seconds') |
170 | 170 | ->setScale(2), |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | public function getCustomScript() |
207 | 207 | { |
208 | 208 | // Flexslider options |
209 | - $sync = ($this->owner->ThumbnailNav == true) ? "sync: '.fs-carousel:eq('+index+')'," : ''; |
|
209 | + $sync = ($this->owner->ThumbnailNav==true) ? "sync: '.fs-carousel:eq('+index+')'," : ''; |
|
210 | 210 | |
211 | 211 | $before = $this->owner->hasMethod('flexSliderBeforeAction') |
212 | 212 | ? $this->owner->flexSliderBeforeAction() |
@@ -225,18 +225,18 @@ discard block |
||
225 | 225 | |
226 | 226 | if(jQuery('.fs-carousel').eq(index).length) { |
227 | 227 | jQuery('.fs-carousel').eq(index).flexslider({ |
228 | - slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean() . ", |
|
228 | + slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean().", |
|
229 | 229 | animation: 'slide', |
230 | - animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean() . ", |
|
231 | - controlNav: " . $this->owner->obj('CarouselControlNav')->NiceAsBoolean() . ", |
|
232 | - directionNav: " . $this->owner->obj('CarouselDirectionNav')->NiceAsBoolean() . ", |
|
230 | + animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean().", |
|
231 | + controlNav: " . $this->owner->obj('CarouselControlNav')->NiceAsBoolean().", |
|
232 | + directionNav: " . $this->owner->obj('CarouselDirectionNav')->NiceAsBoolean().", |
|
233 | 233 | prevText: '', |
234 | 234 | nextText: '', |
235 | 235 | pausePlay: false, |
236 | 236 | asNavFor: '.flexslider:eq('+index+')', |
237 | - minItems: " . $this->owner->obj('CarouselThumbnailCt') . ", |
|
238 | - maxItems: " . $this->owner->obj('CarouselThumbnailCt') . ", |
|
239 | - move: " . $this->owner->obj('CarouselThumbnailCt') . ", |
|
237 | + minItems: " . $this->owner->obj('CarouselThumbnailCt').", |
|
238 | + maxItems: " . $this->owner->obj('CarouselThumbnailCt').", |
|
239 | + move: " . $this->owner->obj('CarouselThumbnailCt').", |
|
240 | 240 | itemWidth: 100, |
241 | 241 | itemMargin: 10 |
242 | 242 | }); |
@@ -244,22 +244,22 @@ discard block |
||
244 | 244 | |
245 | 245 | if(jQuery('.flexslider').eq(index).length){ |
246 | 246 | jQuery('.flexslider').eq(index).flexslider({ |
247 | - slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean() . ", |
|
248 | - animation: '" . $this->owner->Animation . "', |
|
249 | - animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean() . ", |
|
250 | - controlNav: " . $this->owner->obj('SliderControlNav')->NiceAsBoolean() . ", |
|
251 | - directionNav: " . $this->owner->obj('SliderDirectionNav')->NiceAsBoolean() . ", |
|
247 | + slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean().", |
|
248 | + animation: '" . $this->owner->Animation."', |
|
249 | + animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean().", |
|
250 | + controlNav: " . $this->owner->obj('SliderControlNav')->NiceAsBoolean().", |
|
251 | + directionNav: " . $this->owner->obj('SliderDirectionNav')->NiceAsBoolean().", |
|
252 | 252 | prevText: '', |
253 | 253 | nextText: '', |
254 | 254 | pauseOnAction: true, |
255 | 255 | pauseOnHover: true, |
256 | - " . $sync . " |
|
256 | + " . $sync." |
|
257 | 257 | start: function(slider){ |
258 | 258 | $('body').removeClass('loading'); |
259 | 259 | }, |
260 | - before: " . $before . ', |
|
261 | - after: ' . $after . ', |
|
262 | - slideshowSpeed: ' . $speed . ' |
|
260 | + before: " . $before.', |
|
261 | + after: ' . $after.', |
|
262 | + slideshowSpeed: ' . $speed.' |
|
263 | 263 | }); |
264 | 264 | } |
265 | 265 | }) |