@@ -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); |
@@ -109,63 +109,63 @@ discard block |
||
109 | 109 | ]); |
110 | 110 | $SlidesField = GridField::create( |
111 | 111 | 'Slides', |
112 | - _t(__CLASS__ . '.SLIDES', 'Slides'), |
|
112 | + _t(__CLASS__.'.SLIDES', 'Slides'), |
|
113 | 113 | $this->owner->Slides()->sort('SortOrder'), |
114 | 114 | $config |
115 | 115 | ); |
116 | 116 | |
117 | - $slideTitle = $this->owner->stat('slide_tab_title') ?: _t(__CLASS__ . '.SLIDES', 'Slides'); |
|
117 | + $slideTitle = $this->owner->stat('slide_tab_title') ?: _t(__CLASS__.'.SLIDES', 'Slides'); |
|
118 | 118 | |
119 | 119 | $animations = []; |
120 | 120 | $animationOptions = $this->owner->dbObject('Animation')->getEnum(); |
121 | 121 | foreach ($animationOptions as $value) { |
122 | - $animations[$value] = _t(__CLASS__ . ".$value", $value); |
|
122 | + $animations[$value] = _t(__CLASS__.".$value", $value); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | $fields->addFieldsToTab("Root.{$slideTitle}", [ |
126 | 126 | $SlidesField, |
127 | - ToggleCompositeField::create('ConfigHD', _t(__CLASS__ . '.SettingsLabel', 'Slider Settings'), [ |
|
127 | + ToggleCompositeField::create('ConfigHD', _t(__CLASS__.'.SettingsLabel', 'Slider Settings'), [ |
|
128 | 128 | DropdownField::create( |
129 | 129 | 'Animation', |
130 | - _t(__CLASS__ . '.ANIMATION_OPTION', 'Animation option'), |
|
130 | + _t(__CLASS__.'.ANIMATION_OPTION', 'Animation option'), |
|
131 | 131 | $animations |
132 | 132 | ), |
133 | 133 | CheckboxField::create( |
134 | 134 | 'Animate', |
135 | - _t(__CLASS__ . '.ANIMATE', 'Animate automatically') |
|
135 | + _t(__CLASS__.'.ANIMATE', 'Animate automatically') |
|
136 | 136 | ), |
137 | 137 | CheckboxField::create( |
138 | 138 | 'Loop', |
139 | - _t(__CLASS__ . '.LOOP', 'Loop the carousel') |
|
139 | + _t(__CLASS__.'.LOOP', 'Loop the carousel') |
|
140 | 140 | ), |
141 | 141 | CheckboxField::create( |
142 | 142 | 'SliderControlNav', |
143 | - _t(__CLASS__ . '.CONTROL_NAV', 'Show ControlNav') |
|
143 | + _t(__CLASS__.'.CONTROL_NAV', 'Show ControlNav') |
|
144 | 144 | ), |
145 | 145 | CheckboxField::create( |
146 | 146 | 'SliderDirectionNav', |
147 | - _t(__CLASS__ . '.DIRECTION_NAV', 'Show DirectionNav') |
|
147 | + _t(__CLASS__.'.DIRECTION_NAV', 'Show DirectionNav') |
|
148 | 148 | ), |
149 | 149 | CheckboxField::create( |
150 | 150 | 'ThumbnailNav', |
151 | - _t(__CLASS__ . '.THUMBNAIL_NAV', 'Thumbnail Navigation') |
|
151 | + _t(__CLASS__.'.THUMBNAIL_NAV', 'Thumbnail Navigation') |
|
152 | 152 | ), |
153 | 153 | //DisplayLogicWrapper::create( |
154 | 154 | CheckboxField::create( |
155 | 155 | 'CarouselControlNav', |
156 | - _t(__CLASS__ . '.CAROUSEL_CONTROL_NAV', 'Show Carousel ControlNav') |
|
156 | + _t(__CLASS__.'.CAROUSEL_CONTROL_NAV', 'Show Carousel ControlNav') |
|
157 | 157 | ), |
158 | 158 | CheckboxField::create( |
159 | 159 | 'CarouselDirectionNav', |
160 | - _t(__CLASS__ . '.CAROUSEL_DIRECTION_NAV', 'Show Carousel DirectionNav') |
|
160 | + _t(__CLASS__.'.CAROUSEL_DIRECTION_NAV', 'Show Carousel DirectionNav') |
|
161 | 161 | ), |
162 | 162 | NumericField::create( |
163 | 163 | 'CarouselThumbnailCt', |
164 | - _t(__CLASS__ . '.CAROUSEL_THUMBNAIL_COUNT', 'Number of thumbnails') |
|
164 | + _t(__CLASS__.'.CAROUSEL_THUMBNAIL_COUNT', 'Number of thumbnails') |
|
165 | 165 | ), |
166 | 166 | NumericField::create( |
167 | 167 | 'FlexSliderSpeed', |
168 | - _t(__CLASS__ . '.SLIDER_SPEED', 'Slider Speed') |
|
168 | + _t(__CLASS__.'.SLIDER_SPEED', 'Slider Speed') |
|
169 | 169 | ) |
170 | 170 | ->setDescription('In Seconds') |
171 | 171 | ->setScale(2), |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | public function getCustomScript() |
208 | 208 | { |
209 | 209 | // Flexslider options |
210 | - $sync = ($this->owner->ThumbnailNav == true) ? "sync: '.fs-carousel:eq('+index+')'," : ''; |
|
210 | + $sync = ($this->owner->ThumbnailNav==true) ? "sync: '.fs-carousel:eq('+index+')'," : ''; |
|
211 | 211 | |
212 | 212 | $before = $this->owner->hasMethod('flexSliderBeforeAction') |
213 | 213 | ? $this->owner->flexSliderBeforeAction() |
@@ -226,18 +226,18 @@ discard block |
||
226 | 226 | |
227 | 227 | if(jQuery('.fs-carousel').eq(index).length) { |
228 | 228 | jQuery('.fs-carousel').eq(index).flexslider({ |
229 | - slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean() . ", |
|
229 | + slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean().", |
|
230 | 230 | animation: 'slide', |
231 | - animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean() . ", |
|
232 | - controlNav: " . $this->owner->obj('CarouselControlNav')->NiceAsBoolean() . ", |
|
233 | - directionNav: " . $this->owner->obj('CarouselDirectionNav')->NiceAsBoolean() . ", |
|
231 | + animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean().", |
|
232 | + controlNav: " . $this->owner->obj('CarouselControlNav')->NiceAsBoolean().", |
|
233 | + directionNav: " . $this->owner->obj('CarouselDirectionNav')->NiceAsBoolean().", |
|
234 | 234 | prevText: '', |
235 | 235 | nextText: '', |
236 | 236 | pausePlay: false, |
237 | 237 | asNavFor: '.flexslider:eq('+index+')', |
238 | - minItems: " . $this->owner->obj('CarouselThumbnailCt') . ", |
|
239 | - maxItems: " . $this->owner->obj('CarouselThumbnailCt') . ", |
|
240 | - move: " . $this->owner->obj('CarouselThumbnailCt') . ", |
|
238 | + minItems: " . $this->owner->obj('CarouselThumbnailCt').", |
|
239 | + maxItems: " . $this->owner->obj('CarouselThumbnailCt').", |
|
240 | + move: " . $this->owner->obj('CarouselThumbnailCt').", |
|
241 | 241 | itemWidth: 100, |
242 | 242 | itemMargin: 10 |
243 | 243 | }); |
@@ -245,22 +245,22 @@ discard block |
||
245 | 245 | |
246 | 246 | if(jQuery('.flexslider').eq(index).length){ |
247 | 247 | jQuery('.flexslider').eq(index).flexslider({ |
248 | - slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean() . ", |
|
249 | - animation: '" . $this->owner->Animation . "', |
|
250 | - animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean() . ", |
|
251 | - controlNav: " . $this->owner->obj('SliderControlNav')->NiceAsBoolean() . ", |
|
252 | - directionNav: " . $this->owner->obj('SliderDirectionNav')->NiceAsBoolean() . ", |
|
248 | + slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean().", |
|
249 | + animation: '" . $this->owner->Animation."', |
|
250 | + animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean().", |
|
251 | + controlNav: " . $this->owner->obj('SliderControlNav')->NiceAsBoolean().", |
|
252 | + directionNav: " . $this->owner->obj('SliderDirectionNav')->NiceAsBoolean().", |
|
253 | 253 | prevText: '', |
254 | 254 | nextText: '', |
255 | 255 | pauseOnAction: true, |
256 | 256 | pauseOnHover: true, |
257 | - " . $sync . " |
|
257 | + " . $sync." |
|
258 | 258 | start: function(slider){ |
259 | 259 | $('body').removeClass('loading'); |
260 | 260 | }, |
261 | - before: " . $before . ', |
|
262 | - after: ' . $after . ', |
|
263 | - slideshowSpeed: ' . $speed . ' |
|
261 | + before: " . $before.', |
|
262 | + after: ' . $after.', |
|
263 | + slideshowSpeed: ' . $speed.' |
|
264 | 264 | }); |
265 | 265 | } |
266 | 266 | }) |