Completed
Push — master ( 2ad7fe...4fb981 )
by Leo
03:07
created
code/Block.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 class Block extends DataObject {
4
-	protected static $db = array (
4
+	protected static $db = array(
5 5
 		'SortOrder'			=>	'Int',
6 6
 		'Title'				=>	'Varchar(64)',
7 7
 		'TitleWrapper'		=>	'Enum("h2,h3,h4,h5,h6")',
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		'SectionWrapper'	=>	'Boolean'
20 20
 	);
21 21
 	
22
-	protected static $many_many = array (
22
+	protected static $many_many = array(
23 23
 		'Pages'				=>	'Page'
24 24
 	);
25 25
 		
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		'MySQLDatabase'		=> 'ENGINE=MyISAM'
28 28
     );
29 29
 	
30
-	protected static $extensions = array (
30
+	protected static $extensions = array(
31 31
 		'StandardPermissions'
32 32
 	);
33 33
 	
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
 	
48 48
 	public function VisibleTo() {
49 49
 		if (strlen(trim($this->MemberVisibility)) > 0) {
50
-			$lists = 'Group: ' . str_replace(',','<br />Group: ', $this->MemberVisibility);
51
-		}else{
50
+			$lists = 'Group: '.str_replace(',', '<br />Group: ', $this->MemberVisibility);
51
+		} else {
52 52
 			$lists = '<em>&lt;All&gt;</em>';
53 53
 		}
54 54
 		
55
-		return new LiteralField('VisibleTo',$lists);
55
+		return new LiteralField('VisibleTo', $lists);
56 56
 	}
57 57
 	
58 58
 	public function BlockType() {
@@ -62,18 +62,18 @@  discard block
 block discarded – undo
62 62
 	public function shownOn() {
63 63
 		if ($this->showBlockbyClass) {
64 64
 			if (strlen(trim($this->shownInClass)) > 0) {
65
-				$lists = 'Type: ' . str_replace(',','<br />Type: ', $this->shownInClass);
66
-			}else{
65
+				$lists = 'Type: '.str_replace(',', '<br />Type: ', $this->shownInClass);
66
+			} else {
67 67
 				$lists = '<em>&lt;not assigned&gt;</em>';
68 68
 			}
69
-		}else{
69
+		} else {
70 70
 			if ($this->Pages()->count() > 0) {
71
-				$lists = 'Page: ' . implode('<br />Page: ', $this->Pages()->column('Title'));
72
-			}else{
71
+				$lists = 'Page: '.implode('<br />Page: ', $this->Pages()->column('Title'));
72
+			} else {
73 73
 				$lists = '<em>&lt;not assigned&gt;</em>';
74 74
 			}
75 75
 		}
76
-		return new LiteralField('shownOn',$lists);
76
+		return new LiteralField('shownOn', $lists);
77 77
 	}
78 78
 	
79 79
 	public function getCMSFields() {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		$pageSelector = new CheckboxSetField(
128 128
 			$name = "Pages",
129 129
 			$title = "Show on Page(s)",
130
-			$availablePages->map('ID','Title')
130
+			$availablePages->map('ID', 'Title')
131 131
 		);
132 132
 		
133 133
 		
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
 		$fields->addFieldsToTab('Options', array(
151 151
 			TextField::create('WrapperClasses', 'Additional block wrapper Class'),
152 152
 			TextField::create('HeadingClasses', 'Additional block title Class'),
153
-			CheckboxField::create('addMarginTop','Add Margin to top'),
154
-			CheckboxField::create('addMarginBottom','Add Margin to bottom'),
155
-			CheckboxField::create('addPaddingTop','Add Padding to top'),
156
-			CheckboxField::create('addPaddingBottom','Add Padding to bottom'),
153
+			CheckboxField::create('addMarginTop', 'Add Margin to top'),
154
+			CheckboxField::create('addMarginBottom', 'Add Margin to bottom'),
155
+			CheckboxField::create('addPaddingTop', 'Add Padding to top'),
156
+			CheckboxField::create('addPaddingBottom', 'Add Padding to bottom'),
157 157
 			CheckboxField::create('SectionWrapper', 'Use &lt;section /&gt; as block wrapper')
158 158
 		));
159 159
 
Please login to merge, or discard this patch.