Passed
Branch 0.1 (cf4d48)
by Jason
03:20
created
code/FlexSliderExtension.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 			$speed = 7000;
40 40
 		}
41 41
 
42
-        // only call custom script if page has Slides
43
-        if (Object::has_extension($this->owner->data()->ClassName, 'FlexSlider')) {
44
-            if($this->owner->data()->Slides()->exists()){
45
-                Requirements::customScript("
42
+		// only call custom script if page has Slides
43
+		if (Object::has_extension($this->owner->data()->ClassName, 'FlexSlider')) {
44
+			if($this->owner->data()->Slides()->exists()){
45
+				Requirements::customScript("
46 46
                 (function($) {
47 47
                     $(document).ready(function(){
48 48
                         $('.flexslider').flexslider({
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
                         });
66 66
                     });
67 67
                 }(jQuery));");
68
-            }
69
-        }
68
+			}
69
+		}
70 70
 
71 71
 	}
72 72
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -18,37 +18,37 @@  discard block
 block discarded – undo
18 18
 		} else {
19 19
 			$loop = 'false';
20 20
 		}
21
-		if($this->owner->ThumbnailNav==true){
21
+		if ($this->owner->ThumbnailNav==true) {
22 22
 			$sync = "sync: '#carousel',";
23
-		}else{
23
+		} else {
24 24
 			$sync = "";
25 25
 		}
26
-		if(method_exists($this->owner->ClassName, 'flexSliderBeforeAction')){
26
+		if (method_exists($this->owner->ClassName, 'flexSliderBeforeAction')) {
27 27
 			$before = $this->owner->flexSliderBeforeAction();
28
-		}else{
28
+		} else {
29 29
 			$before = "function(){}";
30 30
 		}
31
-		if(method_exists($this->owner->ClassName, 'flexSliderAfterAction')){
31
+		if (method_exists($this->owner->ClassName, 'flexSliderAfterAction')) {
32 32
 			$after = $this->owner->flexSliderAfterAction();
33
-		}else{
33
+		} else {
34 34
 			$after = "function(){}";
35 35
 		}
36
-		if(method_exists($this->owner->ClassName, 'setFlexSliderSpeed')){
36
+		if (method_exists($this->owner->ClassName, 'setFlexSliderSpeed')) {
37 37
 			$speed = $this->owner->setFlexSliderSpeed();
38
-		}else{
38
+		} else {
39 39
 			$speed = 7000;
40 40
 		}
41 41
 
42 42
         // only call custom script if page has Slides
43 43
         if (Object::has_extension($this->owner->data()->ClassName, 'FlexSlider')) {
44
-            if($this->owner->data()->Slides()->exists()){
44
+            if ($this->owner->data()->Slides()->exists()) {
45 45
                 Requirements::customScript("
46 46
                 (function($) {
47 47
                     $(document).ready(function(){
48 48
                         $('.flexslider').flexslider({
49
-                            slideshow: " . $animate . ",
50
-                            animation: '" . $this->owner->Animation . "',
51
-                            animationLoop: " . $loop . ",
49
+                            slideshow: " . $animate.",
50
+                            animation: '" . $this->owner->Animation."',
51
+                            animationLoop: " . $loop.",
52 52
                             controlNav: true,
53 53
                             directionNav: true,
54 54
                             prevText: '',
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                             },
62 62
                             before: ".$before.",
63 63
                             after: ".$after.",
64
-                            slideshowSpeed: " . $speed . "
64
+                            slideshowSpeed: " . $speed."
65 65
                         });
66 66
                     });
67 67
                 }(jQuery));");
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,22 +20,22 @@
 block discarded – undo
20 20
 		}
21 21
 		if($this->owner->ThumbnailNav==true){
22 22
 			$sync = "sync: '#carousel',";
23
-		}else{
23
+		} else{
24 24
 			$sync = "";
25 25
 		}
26 26
 		if(method_exists($this->owner->ClassName, 'flexSliderBeforeAction')){
27 27
 			$before = $this->owner->flexSliderBeforeAction();
28
-		}else{
28
+		} else{
29 29
 			$before = "function(){}";
30 30
 		}
31 31
 		if(method_exists($this->owner->ClassName, 'flexSliderAfterAction')){
32 32
 			$after = $this->owner->flexSliderAfterAction();
33
-		}else{
33
+		} else{
34 34
 			$after = "function(){}";
35 35
 		}
36 36
 		if(method_exists($this->owner->ClassName, 'setFlexSliderSpeed')){
37 37
 			$speed = $this->owner->setFlexSliderSpeed();
38
-		}else{
38
+		} else{
39 39
 			$speed = 7000;
40 40
 		}
41 41
 
Please login to merge, or discard this patch.
code/FlexSlider.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
 		   new GridFieldDeleteAction(),
45 45
 		   new GridFieldDetailForm()
46 46
 		);
47
-        if (class_exists('GridFieldBulkManager')) {
48
-            $gridFieldConfig->addComponent(new GridFieldBulkManager());
49
-            $gridFieldConfig->addComponent(new GridFieldBulkUpload());
50
-        }
47
+		if (class_exists('GridFieldBulkManager')) {
48
+			$gridFieldConfig->addComponent(new GridFieldBulkManager());
49
+			$gridFieldConfig->addComponent(new GridFieldBulkUpload());
50
+		}
51 51
 		if (class_exists('GridFieldSortableRows')) $gridFieldConfig->addComponent(new GridFieldSortableRows("SortOrder"));
52 52
 
53 53
 		$SlidesField = GridField::create("Slides", "Slides", $this->owner->Slides()->sort('SortOrder'), $gridFieldConfig);
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 		(Permission::check('ADMIN')) ? $width = TextField::create('SliderWidth', 'Image Width') : $width = HiddenField::create('SliderWidth');
56 56
 		(Permission::check('ADMIN')) ? $height = TextField::create('SliderHeight', 'Image Height') : $height = HiddenField::create('SliderHeight');
57 57
 
58
-	    // add FlexSlider, width and height
59
-	    $fields->addFieldsToTab("Root.Slides", array(
60
-	    	$SlidesField,
61
-	    	HeaderField::create('Config', 'Configuration', 3),
62
-	    	CheckboxField::create('Animate', 'Animate automatically'),
63
-	    	DropdownField::create('Animation', 'Animation option', $this->owner->dbObject('Animation')->enumValues()),
64
-	    	CheckboxField::create('Loop', 'Loop the carousel'),
65
-	    	$width,
66
-	    	$height,
67
-	    	CheckboxField::create('ThumbnailNav')->setTitle('Thumbnail Navigation')
68
-	    ));
58
+		// add FlexSlider, width and height
59
+		$fields->addFieldsToTab("Root.Slides", array(
60
+			$SlidesField,
61
+			HeaderField::create('Config', 'Configuration', 3),
62
+			CheckboxField::create('Animate', 'Animate automatically'),
63
+			DropdownField::create('Animation', 'Animation option', $this->owner->dbObject('Animation')->enumValues()),
64
+			CheckboxField::create('Loop', 'Loop the carousel'),
65
+			$width,
66
+			$height,
67
+			CheckboxField::create('ThumbnailNav')->setTitle('Thumbnail Navigation')
68
+		));
69 69
 
70 70
 	}
71 71
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,9 @@
 block discarded – undo
48 48
             $gridFieldConfig->addComponent(new GridFieldBulkManager());
49 49
             $gridFieldConfig->addComponent(new GridFieldBulkUpload());
50 50
         }
51
-		if (class_exists('GridFieldSortableRows')) $gridFieldConfig->addComponent(new GridFieldSortableRows("SortOrder"));
51
+		if (class_exists('GridFieldSortableRows')) {
52
+			$gridFieldConfig->addComponent(new GridFieldSortableRows("SortOrder"));
53
+		}
52 54
 
53 55
 		$SlidesField = GridField::create("Slides", "Slides", $this->owner->Slides()->sort('SortOrder'), $gridFieldConfig);
54 56
 		
Please login to merge, or discard this patch.
code/SlideImage.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 	public function GridThumb() {
11 11
 		$Image = $this->Image();
12
-		if ( $Image )
12
+		if ($Image)
13 13
 			return $Image->CMSThumbnail();
14 14
 		else
15 15
 			return null;
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
22 22
 		$ImageField->setFolderName('Uploads/SlideImages');
23 23
 		$ImageField->setConfig('allowedMaxFileNumber', 1);
24 24
 
25
-	   	$fields->addFieldsToTab('Root.Main',array(
25
+	   	$fields->addFieldsToTab('Root.Main', array(
26 26
 	   		new TextField('Name'),
27 27
 	   		CheckboxField::create('ShowSlide')->setTitle('Show Slide'),
28 28
 			TextareaField::create('Description'),
29 29
 			$ImageField,
30 30
 			new TreeDropdownField("PageLinkID", "Choose a page to link to:", "SiteTree")
31 31
 		));
32
-		$fields->removeFieldsFromTab('Root.Main',array(
32
+		$fields->removeFieldsFromTab('Root.Main', array(
33 33
 			'SortOrder',
34 34
 			'PageID'));
35 35
 		$this->extend('updateCMSFields', $fields);
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 
39 39
 	public function Thumbnail() {
40
-		return $this->Image()->CroppedImage(80,80);
40
+		return $this->Image()->CroppedImage(80, 80);
41 41
 	}
42 42
 
43 43
 	public function Large() {
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
 		return $this->Image()->CroppedImage($width, $height);
71 71
 	}
72 72
 
73
-	function canCreate($member=null) { return true; }
74
-	function canEdit($member=null) { return true; }
75
-	function canDelete($member=null) { return true; }
76
-	function canView($member=null) { return true; }
73
+	function canCreate($member = null) { return true; }
74
+	function canEdit($member = null) { return true; }
75
+	function canDelete($member = null) { return true; }
76
+	function canView($member = null) { return true; }
77 77
 }
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,11 @@
 block discarded – undo
9 9
 
10 10
 	public function GridThumb() {
11 11
 		$Image = $this->Image();
12
-		if ( $Image )
13
-			return $Image->CMSThumbnail();
14
-		else
15
-			return null;
12
+		if ( $Image ) {
13
+					return $Image->CMSThumbnail();
14
+		} else {
15
+					return null;
16
+		}
16 17
 	}
17 18
 
18 19
 	function getCMSFields() {
Please login to merge, or discard this patch.