Passed
Pull Request — 4.1 (#212)
by
unknown
03:54
created
src/ORM/FlexSlider.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -109,63 +109,63 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                     })
Please login to merge, or discard this patch.
Indentation   +234 added lines, -234 removed lines patch added patch discarded remove patch
@@ -37,205 +37,205 @@  discard block
 block discarded – undo
37 37
  */
38 38
 class FlexSlider extends DataExtension
39 39
 {
40
-    use Configurable;
41
-
42
-    /**
43
-     * @var array
44
-     */
45
-    private static $db = [
46
-        'Animation' => "Enum('slide, fade', 'slide')",
47
-        'Loop' => 'Boolean',
48
-        'Animate' => 'Boolean',
49
-        'ThumbnailNav' => 'Boolean',
50
-        'SliderControlNav' => 'Boolean',
51
-        'SliderDirectionNav' => 'Boolean',
52
-        'CarouselControlNav' => 'Boolean',
53
-        'CarouselDirectionNav' => 'Boolean',
54
-        'CarouselThumbnailCt' => 'Int',
55
-        'FlexSliderSpeed' => 'Double',
56
-    ];
57
-
58
-    /**
59
-     * @var array
60
-     */
61
-    private static $has_many = [
62
-        'Slides' => SlideImage::class,
63
-    ];
64
-
65
-    /**
66
-     * @var bool
67
-     */
68
-    private static $jquery_enabled = true;
69
-
70
-    /**
71
-     * @var bool
72
-     */
73
-    private static $flexslider_enabled = true;
74
-
75
-    /**
76
-     *
77
-     */
78
-    public function populateDefaults()
79
-    {
80
-        $this->owner->Loop = 1;
81
-        $this->owner->Animate = 1;
82
-        $this->owner->SliderControlNav = 0;
83
-        $this->owner->SliderDirectionNav = 1;
84
-        $this->owner->CarouselControlNav = 0;
85
-        $this->owner->CarouselDirectionNav = 1;
86
-        $this->owner->CarouselThumbnailCt = 6;
87
-        $this->owner->FlexSliderSpeed = $this->getDefaultSpeed();
88
-
89
-        return parent::populateDefaults();
90
-    }
91
-
92
-    /**
93
-     * @param FieldList $fields
94
-     */
95
-    public function updateCMSFields(FieldList $fields)
96
-    {
97
-        $fields->removeByName([
98
-            'Animation',
99
-            'Loop',
100
-            'Animate',
101
-            'ThumbnailNav',
102
-            'SliderControlNav',
103
-            'SliderDirectionNav',
104
-            'CarouselControlNav',
105
-            'CarouselDirectionNav',
106
-            'CarouselThumbnailCt',
107
-            'FlexSliderSpeed',
108
-            'Slides',
109
-        ]);
110
-
111
-        // Slides
112
-        if ($this->owner->ID) {
113
-            $config = GridFieldConfig_RecordEditor::create();
114
-            $config->addComponent(new GridFieldOrderableRows('SortOrder'));
115
-            $config->removeComponentsByType([
116
-                GridFieldAddExistingAutocompleter::class,
117
-                GridFieldDeleteAction::class,
118
-            ]);
119
-            $SlidesField = GridField::create(
120
-                'Slides',
121
-                _t(__CLASS__ . '.SLIDES', 'Slides'),
122
-                $this->owner->Slides()->sort('SortOrder'),
123
-                $config
124
-            );
125
-
126
-            $slideTitle = $this->owner->stat('slide_tab_title') ?: _t(__CLASS__ . '.SLIDES', 'Slides');
127
-
128
-            $animations = [];
129
-            $animationOptions = $this->owner->dbObject('Animation')->getEnum();
130
-            foreach ($animationOptions as $value) {
131
-                $animations[$value] = _t(__CLASS__ . ".$value", $value);
132
-            }
133
-
134
-            $fields->addFieldsToTab("Root.{$slideTitle}", [
135
-                $SlidesField,
136
-                ToggleCompositeField::create('ConfigHD', _t(__CLASS__ . '.SettingsLabel', 'Slider Settings'), [
137
-                    DropdownField::create(
138
-                        'Animation',
139
-                        _t(__CLASS__ . '.ANIMATION_OPTION', 'Animation option'),
140
-                        $animations
141
-                    ),
142
-                    CheckboxField::create(
143
-                        'Animate',
144
-                        _t(__CLASS__ . '.ANIMATE', 'Animate automatically')
145
-                    ),
146
-                    CheckboxField::create(
147
-                        'Loop',
148
-                        _t(__CLASS__ . '.LOOP', 'Loop the carousel')
149
-                    ),
150
-                    CheckboxField::create(
151
-                        'SliderControlNav',
152
-                        _t(__CLASS__ . '.CONTROL_NAV', 'Show ControlNav')
153
-                    ),
154
-                    CheckboxField::create(
155
-                        'SliderDirectionNav',
156
-                        _t(__CLASS__ . '.DIRECTION_NAV', 'Show DirectionNav')
157
-                    ),
158
-                    CheckboxField::create(
159
-                        'ThumbnailNav',
160
-                        _t(__CLASS__ . '.THUMBNAIL_NAV', 'Thumbnail Navigation')
161
-                    ),
162
-                    //DisplayLogicWrapper::create(
163
-                    CheckboxField::create(
164
-                        'CarouselControlNav',
165
-                        _t(__CLASS__ . '.CAROUSEL_CONTROL_NAV', 'Show Carousel ControlNav')
166
-                    ),
167
-                    CheckboxField::create(
168
-                        'CarouselDirectionNav',
169
-                        _t(__CLASS__ . '.CAROUSEL_DIRECTION_NAV', 'Show Carousel DirectionNav')
170
-                    ),
171
-                    NumericField::create(
172
-                        'CarouselThumbnailCt',
173
-                        _t(__CLASS__ . '.CAROUSEL_THUMBNAIL_COUNT', 'Number of thumbnails')
174
-                    ),
175
-                    NumericField::create(
176
-                        'FlexSliderSpeed',
177
-                        _t(__CLASS__ . '.SLIDER_SPEED', 'Slider Speed')
178
-                    )
179
-                        ->setDescription('In Seconds')
180
-                        ->setScale(2),
181
-                ]),
182
-            ]);
183
-        }
184
-    }
185
-
186
-    /**
187
-     * @return mixed
188
-     */
189
-    public function getSlideShow()
190
-    {
191
-        $owner = $this->owner;
192
-
193
-        if (!($owner instanceof SiteTree)) {
194
-            $this->getCustomScript();
195
-        }
196
-
197
-        return $this->owner->Slides()->sort('SortOrder');
198
-    }
199
-
200
-    /**
201
-     * add requirements to PageController init()
202
-     */
203
-    public function contentcontrollerInit()
204
-    {
205
-        // only call custom script if page has Slides and DataExtension
206
-        if (DataObject::has_extension($this->owner->Classname, FlexSlider::class)) {
207
-            if ($this->owner->config()->get('jquery_enabled')) {
208
-                Requirements::javascript('//code.jquery.com/jquery-3.6.1.min.js');
209
-            }
210
-
211
-            if ($this->owner->getSlideShow()->exists() && $this->owner->config()->get('flexslider_enabled')) {
212
-                Requirements::javascript('dynamic/flexslider:thirdparty/flexslider/jquery.flexslider-min.js');
213
-            }
214
-
215
-            $this->getCustomScript();
216
-        }
217
-    }
218
-
219
-    /**
220
-     *
221
-     */
222
-    public function getCustomScript()
223
-    {
224
-        // Flexslider options
225
-        $sync = ($this->owner->ThumbnailNav == true) ? "sync: '.fs-carousel:eq('+index+')'," : '';
226
-
227
-        $before = $this->owner->hasMethod('flexSliderBeforeAction')
228
-            ? $this->owner->flexSliderBeforeAction()
229
-            : 'function(){}';
230
-
231
-        $after = $this->owner->hasMethod('flexSliderAfterAction')
232
-            ? $this->owner->flexSliderAfterAction()
233
-            : 'function(){}';
234
-
235
-        $speed = $this->getSlideshowSpeed();
236
-
237
-        Requirements::customScript(
238
-            "(function($) {
40
+	use Configurable;
41
+
42
+	/**
43
+	 * @var array
44
+	 */
45
+	private static $db = [
46
+		'Animation' => "Enum('slide, fade', 'slide')",
47
+		'Loop' => 'Boolean',
48
+		'Animate' => 'Boolean',
49
+		'ThumbnailNav' => 'Boolean',
50
+		'SliderControlNav' => 'Boolean',
51
+		'SliderDirectionNav' => 'Boolean',
52
+		'CarouselControlNav' => 'Boolean',
53
+		'CarouselDirectionNav' => 'Boolean',
54
+		'CarouselThumbnailCt' => 'Int',
55
+		'FlexSliderSpeed' => 'Double',
56
+	];
57
+
58
+	/**
59
+	 * @var array
60
+	 */
61
+	private static $has_many = [
62
+		'Slides' => SlideImage::class,
63
+	];
64
+
65
+	/**
66
+	 * @var bool
67
+	 */
68
+	private static $jquery_enabled = true;
69
+
70
+	/**
71
+	 * @var bool
72
+	 */
73
+	private static $flexslider_enabled = true;
74
+
75
+	/**
76
+	 *
77
+	 */
78
+	public function populateDefaults()
79
+	{
80
+		$this->owner->Loop = 1;
81
+		$this->owner->Animate = 1;
82
+		$this->owner->SliderControlNav = 0;
83
+		$this->owner->SliderDirectionNav = 1;
84
+		$this->owner->CarouselControlNav = 0;
85
+		$this->owner->CarouselDirectionNav = 1;
86
+		$this->owner->CarouselThumbnailCt = 6;
87
+		$this->owner->FlexSliderSpeed = $this->getDefaultSpeed();
88
+
89
+		return parent::populateDefaults();
90
+	}
91
+
92
+	/**
93
+	 * @param FieldList $fields
94
+	 */
95
+	public function updateCMSFields(FieldList $fields)
96
+	{
97
+		$fields->removeByName([
98
+			'Animation',
99
+			'Loop',
100
+			'Animate',
101
+			'ThumbnailNav',
102
+			'SliderControlNav',
103
+			'SliderDirectionNav',
104
+			'CarouselControlNav',
105
+			'CarouselDirectionNav',
106
+			'CarouselThumbnailCt',
107
+			'FlexSliderSpeed',
108
+			'Slides',
109
+		]);
110
+
111
+		// Slides
112
+		if ($this->owner->ID) {
113
+			$config = GridFieldConfig_RecordEditor::create();
114
+			$config->addComponent(new GridFieldOrderableRows('SortOrder'));
115
+			$config->removeComponentsByType([
116
+				GridFieldAddExistingAutocompleter::class,
117
+				GridFieldDeleteAction::class,
118
+			]);
119
+			$SlidesField = GridField::create(
120
+				'Slides',
121
+				_t(__CLASS__ . '.SLIDES', 'Slides'),
122
+				$this->owner->Slides()->sort('SortOrder'),
123
+				$config
124
+			);
125
+
126
+			$slideTitle = $this->owner->stat('slide_tab_title') ?: _t(__CLASS__ . '.SLIDES', 'Slides');
127
+
128
+			$animations = [];
129
+			$animationOptions = $this->owner->dbObject('Animation')->getEnum();
130
+			foreach ($animationOptions as $value) {
131
+				$animations[$value] = _t(__CLASS__ . ".$value", $value);
132
+			}
133
+
134
+			$fields->addFieldsToTab("Root.{$slideTitle}", [
135
+				$SlidesField,
136
+				ToggleCompositeField::create('ConfigHD', _t(__CLASS__ . '.SettingsLabel', 'Slider Settings'), [
137
+					DropdownField::create(
138
+						'Animation',
139
+						_t(__CLASS__ . '.ANIMATION_OPTION', 'Animation option'),
140
+						$animations
141
+					),
142
+					CheckboxField::create(
143
+						'Animate',
144
+						_t(__CLASS__ . '.ANIMATE', 'Animate automatically')
145
+					),
146
+					CheckboxField::create(
147
+						'Loop',
148
+						_t(__CLASS__ . '.LOOP', 'Loop the carousel')
149
+					),
150
+					CheckboxField::create(
151
+						'SliderControlNav',
152
+						_t(__CLASS__ . '.CONTROL_NAV', 'Show ControlNav')
153
+					),
154
+					CheckboxField::create(
155
+						'SliderDirectionNav',
156
+						_t(__CLASS__ . '.DIRECTION_NAV', 'Show DirectionNav')
157
+					),
158
+					CheckboxField::create(
159
+						'ThumbnailNav',
160
+						_t(__CLASS__ . '.THUMBNAIL_NAV', 'Thumbnail Navigation')
161
+					),
162
+					//DisplayLogicWrapper::create(
163
+					CheckboxField::create(
164
+						'CarouselControlNav',
165
+						_t(__CLASS__ . '.CAROUSEL_CONTROL_NAV', 'Show Carousel ControlNav')
166
+					),
167
+					CheckboxField::create(
168
+						'CarouselDirectionNav',
169
+						_t(__CLASS__ . '.CAROUSEL_DIRECTION_NAV', 'Show Carousel DirectionNav')
170
+					),
171
+					NumericField::create(
172
+						'CarouselThumbnailCt',
173
+						_t(__CLASS__ . '.CAROUSEL_THUMBNAIL_COUNT', 'Number of thumbnails')
174
+					),
175
+					NumericField::create(
176
+						'FlexSliderSpeed',
177
+						_t(__CLASS__ . '.SLIDER_SPEED', 'Slider Speed')
178
+					)
179
+						->setDescription('In Seconds')
180
+						->setScale(2),
181
+				]),
182
+			]);
183
+		}
184
+	}
185
+
186
+	/**
187
+	 * @return mixed
188
+	 */
189
+	public function getSlideShow()
190
+	{
191
+		$owner = $this->owner;
192
+
193
+		if (!($owner instanceof SiteTree)) {
194
+			$this->getCustomScript();
195
+		}
196
+
197
+		return $this->owner->Slides()->sort('SortOrder');
198
+	}
199
+
200
+	/**
201
+	 * add requirements to PageController init()
202
+	 */
203
+	public function contentcontrollerInit()
204
+	{
205
+		// only call custom script if page has Slides and DataExtension
206
+		if (DataObject::has_extension($this->owner->Classname, FlexSlider::class)) {
207
+			if ($this->owner->config()->get('jquery_enabled')) {
208
+				Requirements::javascript('//code.jquery.com/jquery-3.6.1.min.js');
209
+			}
210
+
211
+			if ($this->owner->getSlideShow()->exists() && $this->owner->config()->get('flexslider_enabled')) {
212
+				Requirements::javascript('dynamic/flexslider:thirdparty/flexslider/jquery.flexslider-min.js');
213
+			}
214
+
215
+			$this->getCustomScript();
216
+		}
217
+	}
218
+
219
+	/**
220
+	 *
221
+	 */
222
+	public function getCustomScript()
223
+	{
224
+		// Flexslider options
225
+		$sync = ($this->owner->ThumbnailNav == true) ? "sync: '.fs-carousel:eq('+index+')'," : '';
226
+
227
+		$before = $this->owner->hasMethod('flexSliderBeforeAction')
228
+			? $this->owner->flexSliderBeforeAction()
229
+			: 'function(){}';
230
+
231
+		$after = $this->owner->hasMethod('flexSliderAfterAction')
232
+			? $this->owner->flexSliderAfterAction()
233
+			: 'function(){}';
234
+
235
+		$speed = $this->getSlideshowSpeed();
236
+
237
+		Requirements::customScript(
238
+			"(function($) {
239 239
                 $(document).ready(function(){
240 240
                     jQuery('.flexslider').each(function(index){
241 241
 
@@ -281,39 +281,39 @@  discard block
 block discarded – undo
281 281
                     })
282 282
                 });
283 283
             }(jQuery));'
284
-        );
285
-    }
286
-
287
-    /**
288
-     * @return int
289
-     */
290
-    public function getSlideshowSpeed()
291
-    {
292
-        $speed = $this->owner->FlexSliderSpeed > 0
293
-            ? $this->owner->FlexSliderSpeed
294
-            : $this->getDefaultSpeed();
295
-
296
-        return $speed * 1000;
297
-    }
298
-
299
-    /**
300
-     * @return mixed
301
-     */
302
-    protected function getDefaultSpeed()
303
-    {
304
-        return $this->owner->config()->get('flex_slider_speed')
305
-            ?: Config::inst()->get(FlexSlider::class, 'flex_slider_speed');
306
-    }
307
-
308
-    /**
309
-     *
310
-     */
311
-    public function onBeforeWrite()
312
-    {
313
-        parent::onBeforeWrite();
314
-
315
-        if (!$this->owner->CarouselThumbnailCt) {
316
-            $this->owner->CarouselThumbnailCt = 6;
317
-        }
318
-    }
284
+		);
285
+	}
286
+
287
+	/**
288
+	 * @return int
289
+	 */
290
+	public function getSlideshowSpeed()
291
+	{
292
+		$speed = $this->owner->FlexSliderSpeed > 0
293
+			? $this->owner->FlexSliderSpeed
294
+			: $this->getDefaultSpeed();
295
+
296
+		return $speed * 1000;
297
+	}
298
+
299
+	/**
300
+	 * @return mixed
301
+	 */
302
+	protected function getDefaultSpeed()
303
+	{
304
+		return $this->owner->config()->get('flex_slider_speed')
305
+			?: Config::inst()->get(FlexSlider::class, 'flex_slider_speed');
306
+	}
307
+
308
+	/**
309
+	 *
310
+	 */
311
+	public function onBeforeWrite()
312
+	{
313
+		parent::onBeforeWrite();
314
+
315
+		if (!$this->owner->CarouselThumbnailCt) {
316
+			$this->owner->CarouselThumbnailCt = 6;
317
+		}
318
+	}
319 319
 }
Please login to merge, or discard this patch.