@@ -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->stat('slide_tab_title') ?: _t(__CLASS__ . '.SLIDES', 'Slides'); |
|
116 | + $slideTitle = $this->owner->stat('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 | }) |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | $slideLink = $this->findOrMakeLink($linkID, $linkLabel); |
60 | 60 | |
61 | - if ($slideLink !== false && $slideLink instanceof Link) { |
|
61 | + if ($slideLink!==false && $slideLink instanceof Link) { |
|
62 | 62 | DB::prepared_query( |
63 | 63 | "UPDATE \"{$table}\" SET \"SlideLinkID\" = ? WHERE \"ID\" = ?", |
64 | 64 | [$slideLink->ID, $record['ID']] |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $link->SiteTreeID = $linkID; |
101 | 101 | $link->Template = 'button'; |
102 | 102 | |
103 | - if ($linkLabel !== null && $linkLabel !== '') { |
|
103 | + if ($linkLabel!==null && $linkLabel!=='') { |
|
104 | 104 | $link->Title = $linkLabel; |
105 | 105 | } else { |
106 | 106 | $link->Title = $page->Title; |
@@ -89,7 +89,7 @@ |
||
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
92 | - static::write_message($ct . " Sliders updated"); |
|
92 | + static::write_message($ct." Sliders updated"); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -138,13 +138,13 @@ discard block |
||
138 | 138 | { |
139 | 139 | $labels = parent::fieldLabels($includerelations); |
140 | 140 | |
141 | - $labels['Name'] = _t(__CLASS__ . '.NAME', 'Name'); |
|
142 | - $labels['Headline'] = _t(__CLASS__ . '.HEADLINE', 'Headline'); |
|
143 | - $labels['Description'] = _t(__CLASS__ . '.DESCRIPTION', 'Description'); |
|
144 | - $labels['SlideLinkID'] = _t(__CLASS__ . '.PAGE_LINK', "Call to action link"); |
|
145 | - $labels['Image'] = _t(__CLASS__ . '.IMAGE', 'Image'); |
|
146 | - $labels['SlideType'] = _t(__CLASS__ . '.SlideType', 'Image or Video'); |
|
147 | - $labels['Video'] = _t(__CLASS__ . '.VideoLabel', 'Video URL'); |
|
141 | + $labels['Name'] = _t(__CLASS__.'.NAME', 'Name'); |
|
142 | + $labels['Headline'] = _t(__CLASS__.'.HEADLINE', 'Headline'); |
|
143 | + $labels['Description'] = _t(__CLASS__.'.DESCRIPTION', 'Description'); |
|
144 | + $labels['SlideLinkID'] = _t(__CLASS__.'.PAGE_LINK', "Call to action link"); |
|
145 | + $labels['Image'] = _t(__CLASS__.'.IMAGE', 'Image'); |
|
146 | + $labels['SlideType'] = _t(__CLASS__.'.SlideType', 'Image or Video'); |
|
147 | + $labels['Video'] = _t(__CLASS__.'.VideoLabel', 'Video URL'); |
|
148 | 148 | |
149 | 149 | return $labels; |
150 | 150 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function getCMSFields() |
156 | 156 | { |
157 | - $this->beforeUpdateCMSFields(function ($fields) { |
|
157 | + $this->beforeUpdateCMSFields(function($fields) { |
|
158 | 158 | $fields->removeByName([ |
159 | 159 | 'ShowSlide', |
160 | 160 | 'SortOrder', |
@@ -169,19 +169,19 @@ discard block |
||
169 | 169 | // Name |
170 | 170 | $fields->dataFieldByName('Name') |
171 | 171 | ->setDescription( |
172 | - _t(__CLASS__ . '.INTERNAL_USE', 'for internal reference only') |
|
172 | + _t(__CLASS__.'.INTERNAL_USE', 'for internal reference only') |
|
173 | 173 | ); |
174 | 174 | |
175 | 175 | // Headline |
176 | 176 | $fields->dataFieldByName('Headline') |
177 | 177 | ->setDescription( |
178 | - _t(__CLASS__ . '.USED_IN_TEMPLATE', 'optional, used in template') |
|
178 | + _t(__CLASS__.'.USED_IN_TEMPLATE', 'optional, used in template') |
|
179 | 179 | ); |
180 | 180 | |
181 | 181 | // Description |
182 | 182 | $fields->dataFieldByName('Description') |
183 | 183 | ->setDescription( |
184 | - _t(__CLASS__ . '.USED_IN_TEMPLATE', 'optional, used in template') |
|
184 | + _t(__CLASS__.'.USED_IN_TEMPLATE', 'optional, used in template') |
|
185 | 185 | ); |
186 | 186 | |
187 | 187 | // Page link |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | )->displayIf('SlideType')->isEqualTo('Image')->orIf('SlideType')->isEqualTo('Video')->end(), |
207 | 207 | Wrapper::create( |
208 | 208 | $videoField = EmbeddedObjectField::create('Video', $this->fieldLabel('Video')) |
209 | - ->setDescription(_t(__CLASS__ . '.VideoDescription', 'Supported links: YouTube, Vimeo')) |
|
209 | + ->setDescription(_t(__CLASS__.'.VideoDescription', 'Supported links: YouTube, Vimeo')) |
|
210 | 210 | )->displayIf('SlideType')->isEqualTo('Video')->end() |
211 | 211 | ))->setName('MediaFields'), |
212 | 212 | 'Description' |
@@ -229,27 +229,27 @@ discard block |
||
229 | 229 | |
230 | 230 | if (!$this->Name) { |
231 | 231 | $result->addError( |
232 | - _t(__CLASS__ . '.NAME_REQUIRED', 'A Name is required before you can save') |
|
232 | + _t(__CLASS__.'.NAME_REQUIRED', 'A Name is required before you can save') |
|
233 | 233 | ); |
234 | 234 | } |
235 | 235 | |
236 | 236 | $types = $this->getTypeSource(); |
237 | 237 | |
238 | - if (isset($types['Video']) && $this->SlideType == 'Video' && !$this->VideoID) { |
|
238 | + if (isset($types['Video']) && $this->SlideType=='Video' && !$this->VideoID) { |
|
239 | 239 | $result->addError( |
240 | - _t(__CLASS__ . '.VIDEO_REQUIRED', 'An Video Link is required before you can save') |
|
240 | + _t(__CLASS__.'.VIDEO_REQUIRED', 'An Video Link is required before you can save') |
|
241 | 241 | ); |
242 | 242 | } |
243 | 243 | |
244 | - if (isset($types['Image']) && $this->SlideType == 'Image' && !$this->ImageID) { |
|
244 | + if (isset($types['Image']) && $this->SlideType=='Image' && !$this->ImageID) { |
|
245 | 245 | $result->addError( |
246 | - _t(__CLASS__ . '.IMAGE_REQUIRED', 'An Image is required before you can save') |
|
246 | + _t(__CLASS__.'.IMAGE_REQUIRED', 'An Image is required before you can save') |
|
247 | 247 | ); |
248 | 248 | } |
249 | 249 | |
250 | - if (isset($types['Text']) && $this->SlideType == 'Text' && !$this->Description) { |
|
250 | + if (isset($types['Text']) && $this->SlideType=='Text' && !$this->Description) { |
|
251 | 251 | $result->addError( |
252 | - _t(__CLASS__ . '.DESCRIPTION_REQUIRED', 'A Description is required before you can save') |
|
252 | + _t(__CLASS__.'.DESCRIPTION_REQUIRED', 'A Description is required before you can save') |
|
253 | 253 | ); |
254 | 254 | } |
255 | 255 | |
@@ -329,9 +329,9 @@ discard block |
||
329 | 329 | */ |
330 | 330 | public function renderWith($template = null, $customFields = null) |
331 | 331 | { |
332 | - if ($template === null) { |
|
332 | + if ($template===null) { |
|
333 | 333 | $template = static::class; |
334 | - $template = ($this->SlideType) ? $template . "_{$this->SlideType}" : ''; |
|
334 | + $template = ($this->SlideType) ? $template."_{$this->SlideType}" : ''; |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | return parent::renderWith($template); |