Passed
Pull Request — 4 (#200)
by
unknown
02:50
created
src/ORM/FlexSlider.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -108,63 +108,63 @@  discard block
 block discarded – undo
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),
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         }
212 212
 
213 213
         // Flexslider options
214
-        $sync = ($this->owner->ThumbnailNav == true) ? "sync: '.fs-carousel:eq('+index+')'," : '';
214
+        $sync = ($this->owner->ThumbnailNav==true) ? "sync: '.fs-carousel:eq('+index+')'," : '';
215 215
 
216 216
         $before = $this->owner->hasMethod('flexSliderBeforeAction')
217 217
             ? $this->owner->flexSliderBeforeAction()
@@ -230,18 +230,18 @@  discard block
 block discarded – undo
230 230
 
231 231
                          if(jQuery('.fs-carousel').eq(index).length) {
232 232
                              jQuery('.fs-carousel').eq(index).flexslider({
233
-                                slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean() . ",
233
+                                slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean().",
234 234
                                 animation: 'slide',
235
-                                animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean() . ",
236
-                                controlNav: " . $this->owner->obj('CarouselControlNav')->NiceAsBoolean() . ",
237
-                                directionNav: " . $this->owner->obj('CarouselDirectionNav')->NiceAsBoolean() . ",
235
+                                animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean().",
236
+                                controlNav: " . $this->owner->obj('CarouselControlNav')->NiceAsBoolean().",
237
+                                directionNav: " . $this->owner->obj('CarouselDirectionNav')->NiceAsBoolean().",
238 238
                                 prevText: '',
239 239
                                 nextText: '',
240 240
                                 pausePlay: false,
241 241
                                 asNavFor: '.flexslider:eq('+index+')',
242
-                                minItems: " . $this->owner->obj('CarouselThumbnailCt') . ",
243
-                                maxItems: " . $this->owner->obj('CarouselThumbnailCt') . ",
244
-                                move: " . $this->owner->obj('CarouselThumbnailCt') . ",
242
+                                minItems: " . $this->owner->obj('CarouselThumbnailCt').",
243
+                                maxItems: " . $this->owner->obj('CarouselThumbnailCt').",
244
+                                move: " . $this->owner->obj('CarouselThumbnailCt').",
245 245
                                 itemWidth: 100,
246 246
                                 itemMargin: 10
247 247
                               });
@@ -249,22 +249,22 @@  discard block
 block discarded – undo
249 249
 
250 250
                         if(jQuery('.flexslider').eq(index).length){
251 251
                             jQuery('.flexslider').eq(index).flexslider({
252
-                                slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean() . ",
253
-                                animation: '" . $this->owner->Animation . "',
254
-                                animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean() . ",
255
-                                controlNav: " . $this->owner->obj('SliderControlNav')->NiceAsBoolean() . ",
256
-                                directionNav: " . $this->owner->obj('SliderDirectionNav')->NiceAsBoolean() . ",
252
+                                slideshow: " . $this->owner->obj('Animate')->NiceAsBoolean().",
253
+                                animation: '" . $this->owner->Animation."',
254
+                                animationLoop: " . $this->owner->obj('Loop')->NiceAsBoolean().",
255
+                                controlNav: " . $this->owner->obj('SliderControlNav')->NiceAsBoolean().",
256
+                                directionNav: " . $this->owner->obj('SliderDirectionNav')->NiceAsBoolean().",
257 257
                                 prevText: '',
258 258
                                 nextText: '',
259 259
                                 pauseOnAction: true,
260 260
                                 pauseOnHover: true,
261
-                                " . $sync . "
261
+                                " . $sync."
262 262
                                 start: function(slider){
263 263
                                   $('body').removeClass('loading');
264 264
                                 },
265
-                                before: " . $before . ',
266
-                                after: ' . $after . ',
267
-                                slideshowSpeed: ' . $speed . '
265
+                                before: " . $before.',
266
+                                after: ' . $after.',
267
+                                slideshowSpeed: ' . $speed.'
268 268
                             });
269 269
                         }
270 270
                     })
Please login to merge, or discard this patch.
Indentation   +199 added lines, -199 removed lines patch added patch discarded remove patch
@@ -37,194 +37,194 @@  discard block
 block discarded – undo
37 37
  */
38 38
 class FlexSlider extends DataExtension
39 39
 {
40
-    use Configurable;
40
+	use Configurable;
41 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
-    ];
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 57
 
58
-    /**
59
-     * @var array
60
-     */
61
-    private static $has_many = [
62
-        'Slides' => SlideImage::class,
63
-    ];
58
+	/**
59
+	 * @var array
60
+	 */
61
+	private static $has_many = [
62
+		'Slides' => SlideImage::class,
63
+	];
64 64
 
65
-    /**
66
-     *
67
-     */
68
-    public function populateDefaults()
69
-    {
70
-        $this->owner->Loop = 1;
71
-        $this->owner->Animate = 1;
72
-        $this->owner->SliderControlNav = 0;
73
-        $this->owner->SliderDirectionNav = 1;
74
-        $this->owner->CarouselControlNav = 0;
75
-        $this->owner->CarouselDirectionNav = 1;
76
-        $this->owner->CarouselThumbnailCt = 6;
77
-        $this->owner->FlexSliderSpeed = $this->getDefaultSpeed();
65
+	/**
66
+	 *
67
+	 */
68
+	public function populateDefaults()
69
+	{
70
+		$this->owner->Loop = 1;
71
+		$this->owner->Animate = 1;
72
+		$this->owner->SliderControlNav = 0;
73
+		$this->owner->SliderDirectionNav = 1;
74
+		$this->owner->CarouselControlNav = 0;
75
+		$this->owner->CarouselDirectionNav = 1;
76
+		$this->owner->CarouselThumbnailCt = 6;
77
+		$this->owner->FlexSliderSpeed = $this->getDefaultSpeed();
78 78
 
79
-        return parent::populateDefaults();
80
-    }
79
+		return parent::populateDefaults();
80
+	}
81 81
 
82
-    /**
83
-     * @param FieldList $fields
84
-     */
85
-    public function updateCMSFields(FieldList $fields)
86
-    {
87
-        $fields->removeByName([
88
-            'Animation',
89
-            'Loop',
90
-            'Animate',
91
-            'ThumbnailNav',
92
-            'SliderControlNav',
93
-            'SliderDirectionNav',
94
-            'CarouselControlNav',
95
-            'CarouselDirectionNav',
96
-            'CarouselThumbnailCt',
97
-            'FlexSliderSpeed',
98
-            'Slides',
99
-        ]);
82
+	/**
83
+	 * @param FieldList $fields
84
+	 */
85
+	public function updateCMSFields(FieldList $fields)
86
+	{
87
+		$fields->removeByName([
88
+			'Animation',
89
+			'Loop',
90
+			'Animate',
91
+			'ThumbnailNav',
92
+			'SliderControlNav',
93
+			'SliderDirectionNav',
94
+			'CarouselControlNav',
95
+			'CarouselDirectionNav',
96
+			'CarouselThumbnailCt',
97
+			'FlexSliderSpeed',
98
+			'Slides',
99
+		]);
100 100
 
101
-        // Slides
102
-        if ($this->owner->ID) {
103
-            $config = GridFieldConfig_RecordEditor::create();
104
-            $config->addComponent(new GridFieldOrderableRows('SortOrder'));
105
-            $config->removeComponentsByType([
106
-                GridFieldAddExistingAutocompleter::class,
107
-                GridFieldDeleteAction::class,
108
-            ]);
109
-            $SlidesField = GridField::create(
110
-                'Slides',
111
-                _t(__CLASS__ . '.SLIDES', 'Slides'),
112
-                $this->owner->Slides()->sort('SortOrder'),
113
-                $config
114
-            );
101
+		// Slides
102
+		if ($this->owner->ID) {
103
+			$config = GridFieldConfig_RecordEditor::create();
104
+			$config->addComponent(new GridFieldOrderableRows('SortOrder'));
105
+			$config->removeComponentsByType([
106
+				GridFieldAddExistingAutocompleter::class,
107
+				GridFieldDeleteAction::class,
108
+			]);
109
+			$SlidesField = GridField::create(
110
+				'Slides',
111
+				_t(__CLASS__ . '.SLIDES', 'Slides'),
112
+				$this->owner->Slides()->sort('SortOrder'),
113
+				$config
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
-            $animations = [];
119
-            $animationOptions = $this->owner->dbObject('Animation')->getEnum();
120
-            foreach ($animationOptions as $value) {
121
-                $animations[$value] = _t(__CLASS__ . ".$value", $value);
122
-            }
118
+			$animations = [];
119
+			$animationOptions = $this->owner->dbObject('Animation')->getEnum();
120
+			foreach ($animationOptions as $value) {
121
+				$animations[$value] = _t(__CLASS__ . ".$value", $value);
122
+			}
123 123
 
124
-            $fields->addFieldsToTab("Root.{$slideTitle}", [
125
-                $SlidesField,
126
-                ToggleCompositeField::create('ConfigHD', _t(__CLASS__ . '.SettingsLabel', 'Slider Settings'), [
127
-                    DropdownField::create(
128
-                        'Animation',
129
-                        _t(__CLASS__ . '.ANIMATION_OPTION', 'Animation option'),
130
-                        $animations
131
-                    ),
132
-                    CheckboxField::create(
133
-                        'Animate',
134
-                        _t(__CLASS__ . '.ANIMATE', 'Animate automatically')
135
-                    ),
136
-                    CheckboxField::create(
137
-                        'Loop',
138
-                        _t(__CLASS__ . '.LOOP', 'Loop the carousel')
139
-                    ),
140
-                    CheckboxField::create(
141
-                        'SliderControlNav',
142
-                        _t(__CLASS__ . '.CONTROL_NAV', 'Show ControlNav')
143
-                    ),
144
-                    CheckboxField::create(
145
-                        'SliderDirectionNav',
146
-                        _t(__CLASS__ . '.DIRECTION_NAV', 'Show DirectionNav')
147
-                    ),
148
-                    CheckboxField::create(
149
-                        'ThumbnailNav',
150
-                        _t(__CLASS__ . '.THUMBNAIL_NAV', 'Thumbnail Navigation')
151
-                    ),
152
-                    //DisplayLogicWrapper::create(
153
-                    CheckboxField::create(
154
-                        'CarouselControlNav',
155
-                        _t(__CLASS__ . '.CAROUSEL_CONTROL_NAV', 'Show Carousel ControlNav')
156
-                    ),
157
-                    CheckboxField::create(
158
-                        'CarouselDirectionNav',
159
-                        _t(__CLASS__ . '.CAROUSEL_DIRECTION_NAV', 'Show Carousel DirectionNav')
160
-                    ),
161
-                    NumericField::create(
162
-                        'CarouselThumbnailCt',
163
-                        _t(__CLASS__ . '.CAROUSEL_THUMBNAIL_COUNT', 'Number of thumbnails')
164
-                    ),
165
-                    NumericField::create(
166
-                        'FlexSliderSpeed',
167
-                        _t(__CLASS__ . '.SLIDER_SPEED', 'Slider Speed')
168
-                    )
169
-                        ->setDescription('In Seconds')
170
-                        ->setScale(2),
171
-                ]),
172
-            ]);
173
-        }
174
-    }
124
+			$fields->addFieldsToTab("Root.{$slideTitle}", [
125
+				$SlidesField,
126
+				ToggleCompositeField::create('ConfigHD', _t(__CLASS__ . '.SettingsLabel', 'Slider Settings'), [
127
+					DropdownField::create(
128
+						'Animation',
129
+						_t(__CLASS__ . '.ANIMATION_OPTION', 'Animation option'),
130
+						$animations
131
+					),
132
+					CheckboxField::create(
133
+						'Animate',
134
+						_t(__CLASS__ . '.ANIMATE', 'Animate automatically')
135
+					),
136
+					CheckboxField::create(
137
+						'Loop',
138
+						_t(__CLASS__ . '.LOOP', 'Loop the carousel')
139
+					),
140
+					CheckboxField::create(
141
+						'SliderControlNav',
142
+						_t(__CLASS__ . '.CONTROL_NAV', 'Show ControlNav')
143
+					),
144
+					CheckboxField::create(
145
+						'SliderDirectionNav',
146
+						_t(__CLASS__ . '.DIRECTION_NAV', 'Show DirectionNav')
147
+					),
148
+					CheckboxField::create(
149
+						'ThumbnailNav',
150
+						_t(__CLASS__ . '.THUMBNAIL_NAV', 'Thumbnail Navigation')
151
+					),
152
+					//DisplayLogicWrapper::create(
153
+					CheckboxField::create(
154
+						'CarouselControlNav',
155
+						_t(__CLASS__ . '.CAROUSEL_CONTROL_NAV', 'Show Carousel ControlNav')
156
+					),
157
+					CheckboxField::create(
158
+						'CarouselDirectionNav',
159
+						_t(__CLASS__ . '.CAROUSEL_DIRECTION_NAV', 'Show Carousel DirectionNav')
160
+					),
161
+					NumericField::create(
162
+						'CarouselThumbnailCt',
163
+						_t(__CLASS__ . '.CAROUSEL_THUMBNAIL_COUNT', 'Number of thumbnails')
164
+					),
165
+					NumericField::create(
166
+						'FlexSliderSpeed',
167
+						_t(__CLASS__ . '.SLIDER_SPEED', 'Slider Speed')
168
+					)
169
+						->setDescription('In Seconds')
170
+						->setScale(2),
171
+				]),
172
+			]);
173
+		}
174
+	}
175 175
 
176
-    /**
177
-     * @return mixed
178
-     */
179
-    public function getSlideShow()
180
-    {
181
-        $owner = $this->owner;
176
+	/**
177
+	 * @return mixed
178
+	 */
179
+	public function getSlideShow()
180
+	{
181
+		$owner = $this->owner;
182 182
 
183
-        if (!($owner instanceof SiteTree)) {
184
-            $this->getCustomScript();
185
-        }
183
+		if (!($owner instanceof SiteTree)) {
184
+			$this->getCustomScript();
185
+		}
186 186
 
187
-        return $this->owner->Slides()->sort('SortOrder');
188
-    }
187
+		return $this->owner->Slides()->sort('SortOrder');
188
+	}
189 189
 
190
-    /**
191
-     * add requirements to PageController init()
192
-     */
193
-    public function contentcontrollerInit()
194
-    {
195
-        // only call custom script if page has Slides and DataExtension
196
-        if (DataObject::has_extension($this->owner->Classname, FlexSlider::class)) {
197
-            if ($this->owner->getSlideShow()->exists()) {
198
-                $this->getCustomScript();
199
-            }
200
-        }
201
-    }
190
+	/**
191
+	 * add requirements to PageController init()
192
+	 */
193
+	public function contentcontrollerInit()
194
+	{
195
+		// only call custom script if page has Slides and DataExtension
196
+		if (DataObject::has_extension($this->owner->Classname, FlexSlider::class)) {
197
+			if ($this->owner->getSlideShow()->exists()) {
198
+				$this->getCustomScript();
199
+			}
200
+		}
201
+	}
202 202
 
203
-    /**
204
-     *
205
-     */
206
-    public function getCustomScript()
207
-    {
203
+	/**
204
+	 *
205
+	 */
206
+	public function getCustomScript()
207
+	{
208 208
 
209
-        if ($this->owner()->config('clear_requirements')) {
210
-            return;
211
-        }
209
+		if ($this->owner()->config('clear_requirements')) {
210
+			return;
211
+		}
212 212
 
213
-        // Flexslider options
214
-        $sync = ($this->owner->ThumbnailNav == true) ? "sync: '.fs-carousel:eq('+index+')'," : '';
213
+		// Flexslider options
214
+		$sync = ($this->owner->ThumbnailNav == true) ? "sync: '.fs-carousel:eq('+index+')'," : '';
215 215
 
216
-        $before = $this->owner->hasMethod('flexSliderBeforeAction')
217
-            ? $this->owner->flexSliderBeforeAction()
218
-            : 'function(){}';
216
+		$before = $this->owner->hasMethod('flexSliderBeforeAction')
217
+			? $this->owner->flexSliderBeforeAction()
218
+			: 'function(){}';
219 219
 
220
-        $after = $this->owner->hasMethod('flexSliderAfterAction')
221
-            ? $this->owner->flexSliderAfterAction()
222
-            : 'function(){}';
220
+		$after = $this->owner->hasMethod('flexSliderAfterAction')
221
+			? $this->owner->flexSliderAfterAction()
222
+			: 'function(){}';
223 223
 
224
-        $speed = $this->getSlideshowSpeed();
224
+		$speed = $this->getSlideshowSpeed();
225 225
 
226
-        Requirements::customScript(
227
-            "(function($) {
226
+		Requirements::customScript(
227
+			"(function($) {
228 228
                 $(document).ready(function(){
229 229
                     jQuery('.flexslider').each(function(index){
230 230
 
@@ -270,40 +270,40 @@  discard block
 block discarded – undo
270 270
                     })
271 271
                 });
272 272
             }(jQuery));',
273
-            'flexsliderjquery'
274
-        );
275
-    }
273
+			'flexsliderjquery'
274
+		);
275
+	}
276 276
 
277
-    /**
278
-     * @return int
279
-     */
280
-    public function getSlideshowSpeed()
281
-    {
282
-        $speed = $this->owner->FlexSliderSpeed > 0
283
-            ? $this->owner->FlexSliderSpeed
284
-            : $this->getDefaultSpeed();
277
+	/**
278
+	 * @return int
279
+	 */
280
+	public function getSlideshowSpeed()
281
+	{
282
+		$speed = $this->owner->FlexSliderSpeed > 0
283
+			? $this->owner->FlexSliderSpeed
284
+			: $this->getDefaultSpeed();
285 285
 
286
-        return $speed * 1000;
287
-    }
286
+		return $speed * 1000;
287
+	}
288 288
 
289
-    /**
290
-     * @return mixed
291
-     */
292
-    protected function getDefaultSpeed()
293
-    {
294
-        return $this->owner->config()->get('flex_slider_speed')
295
-            ?: Config::inst()->get(FlexSlider::class, 'flex_slider_speed');
296
-    }
289
+	/**
290
+	 * @return mixed
291
+	 */
292
+	protected function getDefaultSpeed()
293
+	{
294
+		return $this->owner->config()->get('flex_slider_speed')
295
+			?: Config::inst()->get(FlexSlider::class, 'flex_slider_speed');
296
+	}
297 297
 
298
-    /**
299
-     *
300
-     */
301
-    public function onBeforeWrite()
302
-    {
303
-        parent::onBeforeWrite();
298
+	/**
299
+	 *
300
+	 */
301
+	public function onBeforeWrite()
302
+	{
303
+		parent::onBeforeWrite();
304 304
 
305
-        if (!$this->owner->CarouselThumbnailCt) {
306
-            $this->owner->CarouselThumbnailCt = 6;
307
-        }
308
-    }
305
+		if (!$this->owner->CarouselThumbnailCt) {
306
+			$this->owner->CarouselThumbnailCt = 6;
307
+		}
308
+	}
309 309
 }
Please login to merge, or discard this patch.