@@ -1,7 +1,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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><All></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 |
||
| 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><not assigned></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><not assigned></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 |
||
| 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 |
||
| 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 <section /> as block wrapper') |
| 158 | 158 | )); |
| 159 | 159 | |