@@ -1,4 +1,4 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -define('BLOCK_DIR',basename(dirname(__FILE__))); |
|
| 4 | -LeftAndMain::require_javascript( BLOCK_DIR. '/js/silverstripe-block.script.js' ); |
|
| 5 | 3 | \ No newline at end of file |
| 4 | +define('BLOCK_DIR', basename(dirname(__FILE__))); |
|
| 5 | +LeftAndMain::require_javascript(BLOCK_DIR . '/js/silverstripe-block.script.js'); |
|
| 6 | 6 | \ No newline at end of file |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class DualColumnBlock extends Block { |
| 4 | - protected static $db = array ( |
|
| 4 | + protected static $db = array( |
|
| 5 | 5 | 'LeftColumn' => 'HTMLText', |
| 6 | 6 | 'RightColumn' => 'HTMLText' |
| 7 | 7 | ); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class SingleColumnBlock extends Block { |
| 4 | - protected static $db = array ( |
|
| 4 | + protected static $db = array( |
|
| 5 | 5 | 'Content' => 'HTMLText' |
| 6 | 6 | ); |
| 7 | 7 | } |
| 8 | 8 | \ No newline at end of file |
@@ -1,19 +1,19 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | class BlockinPage extends Extension {
|
| 3 | 3 | |
| 4 | - protected static $belongs_many_many = array ( |
|
| 4 | + protected 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 | $blocks = $this->owner->Blocks(); |
| 10 | 10 | if ($blocks->count() > 0) {
|
| 11 | 11 | $blocks = Block::get()->filter(array( |
| 12 | 12 | 'ID' => $blocks->column('ID'),
|
| 13 | 13 | 'showBlockbyClass' => false |
| 14 | - ))->sort('SortOrder','ASC');
|
|
| 14 | + ))->sort('SortOrder', 'ASC');
|
|
| 15 | 15 | } |
| 16 | - $blocks_grid = $this->gridBuilder('Blocks', $blocks, '', true,'GridFieldConfig_RelationEditor');
|
|
| 16 | + $blocks_grid = $this->gridBuilder('Blocks', $blocks, '', true, 'GridFieldConfig_RelationEditor');
|
|
| 17 | 17 | $docked_grid = $this->gridBuilder('DockedBlocks', $this->dockedBlocks(), '');
|
| 18 | 18 | |
| 19 | 19 | $fields->addFieldToTab('Root.MyBlocks', $blocks_grid);
|
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $grid = new GridField($name, $label, $source); |
| 32 | 32 | $config = $gridHeaderType::create(); |
| 33 | 33 | $config->removeComponentsByType('GridFieldAddNewButton');
|
| 34 | - if ( $canAdd ) {
|
|
| 34 | + if ($canAdd) {
|
|
| 35 | 35 | $config->addComponents( |
| 36 | 36 | $multiClass = new GridFieldAddNewMultiClass(), |
| 37 | 37 | $sortable = new GridFieldSortableRows('SortOrder')
|
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $IDs[] = $BlockID; |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | - $blocks = Block::get()->filter('ID', $IDs)->sort('SortOrder','ASC');
|
|
| 58 | + $blocks = Block::get()->filter('ID', $IDs)->sort('SortOrder', 'ASC');
|
|
| 59 | 59 | return $blocks; |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | \ No newline at end of file |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class DualColumnBlock extends Block { |
| 4 | - protected static $db = array ( |
|
| 4 | + protected static $db = array( |
|
| 5 | 5 | 'LeftColumn' => 'HTMLText', |
| 6 | 6 | 'RightColumn' => 'HTMLText' |
| 7 | 7 | ); |
@@ -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 | 'hideTitle' => 'Boolean', |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | 'shownInClass' => 'Text' |
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | - protected static $many_many = array ( |
|
| 14 | + protected static $many_many = array( |
|
| 15 | 15 | 'Pages' => 'Page' |
| 16 | 16 | ); |
| 17 | 17 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | 'MySQLDatabase' => 'ENGINE=MyISAM' |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | - protected static $extensions = array ( |
|
| 22 | + protected static $extensions = array( |
|
| 23 | 23 | 'StandardPermissions' |
| 24 | 24 | ); |
| 25 | 25 | |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | $lists = ''; |
| 44 | 44 | if ($this->showBlockbyClass) { |
| 45 | 45 | if (strlen(trim($this->shownInClass)) > 0) { |
| 46 | - $lists = 'Type: ' . str_replace(',','<br />Type: ', $this->shownInClass); |
|
| 47 | - }else{ |
|
| 46 | + $lists = 'Type: ' . str_replace(',', '<br />Type: ', $this->shownInClass); |
|
| 47 | + } else { |
|
| 48 | 48 | $lists = '<em><not assigned></em>'; |
| 49 | 49 | } |
| 50 | - }else{ |
|
| 50 | + } else { |
|
| 51 | 51 | $lists = 'Page: ' . implode('<br />Page: ', $this->Pages()->column('Title')); |
| 52 | 52 | } |
| 53 | - return new LiteralField('shownOn',$lists); |
|
| 53 | + return new LiteralField('shownOn', $lists); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |