@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | class CustomBlockPermission extends DataExtension implements PermissionProvider { |
| 4 | 4 | public function canConfigPageAndType($member = false) { |
| 5 | - return Permission::check(get_class($this->owner) . '_config_page_and_type'); |
|
| 5 | + return Permission::check(get_class($this->owner).'_config_page_and_type'); |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | public function canConfigMemberVisibility($member = false) { |
| 9 | - return Permission::check(get_class($this->owner) . '_config_member_visibility'); |
|
| 9 | + return Permission::check(get_class($this->owner).'_config_member_visibility'); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | public function providePermissions() { |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | 'config_page_and_type', |
| 17 | 17 | 'config_member_visibility' |
| 18 | 18 | ) as $name) { |
| 19 | - $permissions[$class . '_' . $name] = $class . '_' . $name; |
|
| 19 | + $permissions[$class.'_'.$name] = $class.'_'.$name; |
|
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | return $permissions; |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | public function getHTMLFragments($grid) { |
| 21 | 21 | $classes = $this->getClasses($grid); |
| 22 | 22 | |
| 23 | - if(!count($classes)) { |
|
| 23 | + if (!count($classes)) { |
|
| 24 | 24 | return array(); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | if ($form instanceof Form) { |
| 21 | 21 | $actions = $form->Actions(); |
| 22 | 22 | $record = $this->record; |
| 23 | - $actions->insertBefore('action_doDelete', $btnPublish = FormAction::create('doPublish','Save & Publish')); |
|
| 23 | + $actions->insertBefore('action_doDelete', $btnPublish = FormAction::create('doPublish', 'Save & Publish')); |
|
| 24 | 24 | $btnPublish->addExtraClass('ss-ui-action-constructive'); |
| 25 | 25 | if (!empty($record->ID)) { |
| 26 | 26 | if ($record->isPublished()) { |
@@ -5,8 +5,8 @@ |
||
| 5 | 5 | $pool = array_values($values); |
| 6 | 6 | sort($pool); |
| 7 | 7 | |
| 8 | - foreach(array_values($order) as $pos => $id) { |
|
| 9 | - if($values[$id] != $pool[$pos]) { |
|
| 8 | + foreach (array_values($order) as $pos => $id) { |
|
| 9 | + if ($values[$id] != $pool[$pos]) { |
|
| 10 | 10 | DB::query(sprintf( |
| 11 | 11 | 'UPDATE "%s" SET "%s" = %d WHERE %s', |
| 12 | 12 | $this->getSortTable($list), |
@@ -1,15 +1,15 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class BlockinPage extends Extension { |
| 4 | - private static $belongs_many_many = array ( |
|
| 4 | + private static $belongs_many_many = array( |
|
| 5 | 5 | 'Blocks' => 'Block' |
| 6 | 6 | ); |
| 7 | 7 | |
| 8 | - public function updateCMSFields( FieldList $fields ) { |
|
| 8 | + public function updateCMSFields(FieldList $fields) { |
|
| 9 | 9 | $ancestry = ClassInfo::ancestry($this->owner->ClassName); |
| 10 | 10 | if (!in_array('RedirectorPage', $ancestry) && !in_array('VirtualPage', $ancestry)) { |
| 11 | 11 | $blocks = $this->owner->Blocks(); |
| 12 | - $blocks_grid = $this->gridBuilder('Blocks', $blocks, '', true,'GridFieldConfig_RelationEditor'); |
|
| 12 | + $blocks_grid = $this->gridBuilder('Blocks', $blocks, '', true, 'GridFieldConfig_RelationEditor'); |
|
| 13 | 13 | $docked_grid = $this->gridBuilder('DockedBlocks', $this->dockedBlocks(), ''); |
| 14 | 14 | |
| 15 | 15 | $fields->addFieldToTab('Root.MyBlocks', $blocks_grid); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $grid = new GridField($name, $label, $source); |
| 29 | 29 | $config = $gridHeaderType::create(); |
| 30 | 30 | $config->removeComponentsByType('GridFieldAddNewButton'); |
| 31 | - if ( $canAdd ) { |
|
| 31 | + if ($canAdd) { |
|
| 32 | 32 | $config |
| 33 | 33 | ->removeComponentsByType('GridFieldPaginator') |
| 34 | 34 | ->removeComponentsByType('GridFieldDetailForm') |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $IDs[] = $BlockID; |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | - $blocks = Block::get()->filter('ID', $IDs)->sort('SortOrder','ASC'); |
|
| 59 | + $blocks = Block::get()->filter('ID', $IDs)->sort('SortOrder', 'ASC'); |
|
| 60 | 60 | return $blocks; |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | \ No newline at end of file |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | class DualColumnBlock extends Block { |
| 4 | 4 | private static $singular_name = 'Dual-column Block'; |
| 5 | - private static $db = array ( |
|
| 5 | + private static $db = array( |
|
| 6 | 6 | 'LeftColumn' => 'HTMLText', |
| 7 | 7 | 'RightColumn' => 'HTMLText' |
| 8 | 8 | ); |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | class SingleColumnBlock extends Block { |
| 4 | 4 | private static $singular_name = 'Single-column Block'; |
| 5 | - private static $db = array ( |
|
| 5 | + private static $db = array( |
|
| 6 | 6 | 'Content' => 'HTMLText' |
| 7 | 7 | ); |
| 8 | 8 | } |
| 9 | 9 | \ No newline at end of file |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | class TriColumnBlock extends Block { |
| 4 | 4 | private static $singular_name = 'Triple-column Block'; |
| 5 | - private static $db = array ( |
|
| 5 | + private static $db = array( |
|
| 6 | 6 | 'LeftColumn' => 'HTMLText', |
| 7 | 7 | 'MiddleColumn' => 'HTMLText', |
| 8 | 8 | 'RightColumn' => 'HTMLText' |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | class Block extends DataObject { |
| 3 | - private static $db = array ( |
|
| 3 | + private static $db = array( |
|
| 4 | 4 | 'SortOrder' => 'Int', |
| 5 | 5 | 'Title' => 'Varchar(64)', |
| 6 | 6 | 'TitleWrapper' => 'Enum("h2,h3,h4,h5,h6")', |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | 'addPaddingBottom' => 'Boolean' |
| 16 | 16 | ); |
| 17 | 17 | |
| 18 | - private static $many_many = array ( |
|
| 18 | + private static $many_many = array( |
|
| 19 | 19 | 'Pages' => 'Page' |
| 20 | 20 | ); |
| 21 | 21 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | 'MySQLDatabase' => 'ENGINE=MyISAM' |
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | - private static $extensions = array ( |
|
| 31 | + private static $extensions = array( |
|
| 32 | 32 | 'StandardPermissions' |
| 33 | 33 | ); |
| 34 | 34 | |
@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function VisibleTo() { |
| 51 | 51 | if (strlen(trim($this->MemberVisibility)) > 0) { |
| 52 | - $lists = 'Group: ' . str_replace(',','<br />Group: ', $this->MemberVisibility); |
|
| 53 | - }else{ |
|
| 52 | + $lists = 'Group: '.str_replace(',', '<br />Group: ', $this->MemberVisibility); |
|
| 53 | + } else { |
|
| 54 | 54 | $lists = '<em><All></em>'; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - return new LiteralField('VisibleTo',$lists); |
|
| 57 | + return new LiteralField('VisibleTo', $lists); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function BlockType() { |
@@ -64,18 +64,18 @@ discard block |
||
| 64 | 64 | public function shownOn() { |
| 65 | 65 | if ($this->showBlockbyClass) { |
| 66 | 66 | if (strlen(trim($this->shownInClass)) > 0) { |
| 67 | - $lists = 'Type: ' . str_replace(',','<br />Type: ', $this->shownInClass); |
|
| 68 | - }else{ |
|
| 67 | + $lists = 'Type: '.str_replace(',', '<br />Type: ', $this->shownInClass); |
|
| 68 | + } else { |
|
| 69 | 69 | $lists = '<em><not assigned></em>'; |
| 70 | 70 | } |
| 71 | - }else{ |
|
| 71 | + } else { |
|
| 72 | 72 | if ($this->Pages()->count() > 0) { |
| 73 | - $lists = 'Page: ' . implode('<br />Page: ', $this->Pages()->column('Title')); |
|
| 74 | - }else{ |
|
| 73 | + $lists = 'Page: '.implode('<br />Page: ', $this->Pages()->column('Title')); |
|
| 74 | + } else { |
|
| 75 | 75 | $lists = '<em><not assigned></em>'; |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | - return new LiteralField('shownOn',$lists); |
|
| 78 | + return new LiteralField('shownOn', $lists); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function getCMSFields() { |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | 'MemberVisibility' |
| 89 | 89 | )); |
| 90 | 90 | |
| 91 | - $fields->addFieldToTab('Root.Main', LiteralField::create('Status', 'Published: ' . $this->Published()), 'Title'); |
|
| 91 | + $fields->addFieldToTab('Root.Main', LiteralField::create('Status', 'Published: '.$this->Published()), 'Title'); |
|
| 92 | 92 | |
| 93 | 93 | $memberGroups = Group::get(); |
| 94 | 94 | $sourcemap = $memberGroups->map('Code', 'Title'); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $pageSelector = new CheckboxSetField( |
| 132 | 132 | $name = "Pages", |
| 133 | 133 | $title = "Show on Page(s)", |
| 134 | - $availablePages->map('ID','Title') |
|
| 134 | + $availablePages->map('ID', 'Title') |
|
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | 137 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | public function onAfterWrite() { |
| 175 | 175 | parent::onAfterWrite(); |
| 176 | 176 | if (isset($this->readmode)) { |
| 177 | - Versioned::set_reading_mode('Stage.' . $this->readmode); |
|
| 177 | + Versioned::set_reading_mode('Stage.'.$this->readmode); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /*if ($this->isPublished()) { |