@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | protected $controller; |
127 | 127 | |
128 | 128 | /** |
129 | - * @return mixed |
|
129 | + * @return string |
|
130 | 130 | */ |
131 | 131 | public function getTypeForGridfield() |
132 | 132 | { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * looks for templates that match BlockClassName_AreaName |
238 | 238 | * falls back to BlockClassName. |
239 | 239 | * |
240 | - * @return string |
|
240 | + * @return DBHTMLText |
|
241 | 241 | **/ |
242 | 242 | public function forTemplate() |
243 | 243 | { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | /** |
256 | - * @return string |
|
256 | + * @return DBHTMLText |
|
257 | 257 | */ |
258 | 258 | public function BlockHTML() |
259 | 259 | { |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | /** |
429 | 429 | * Check if this block has been published. |
430 | 430 | * |
431 | - * @return bool True if this page has been published. |
|
431 | + * @return string True if this page has been published. |
|
432 | 432 | */ |
433 | 433 | public function isPublishedNice() |
434 | 434 | { |
@@ -34,7 +34,7 @@ |
||
34 | 34 | class Block extends DataObject implements PermissionProvider |
35 | 35 | { |
36 | 36 | |
37 | - private static $table_name = 'Block'; |
|
37 | + private static $table_name = 'Block'; |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * @var array |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | public function fieldLabels($includerelations = true) |
76 | 76 | { |
77 | - $labels = parent::fieldLabels($includerelations); |
|
77 | + $labels = parent::fieldLabels($includerelations); |
|
78 | 78 | |
79 | 79 | $labels = array_merge($labels, [ |
80 | 80 | 'singular_name' => _t('Block.BlockType', 'Block Type'), |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $self = $this; |
139 | 139 | $this->beforeUpdateCMSFields(function($fields) use($self) { |
140 | 140 | /** @var FieldList $fields */ |
141 | - Requirements::add_i18n_javascript(BLOCKS_DIR . '/javascript/lang'); |
|
141 | + Requirements::add_i18n_javascript(BLOCKS_DIR.'/javascript/lang'); |
|
142 | 142 | |
143 | 143 | // this line is a temporary patch until I can work out why this dependency isn't being |
144 | 144 | // loaded in some cases... |
@@ -445,9 +445,9 @@ discard block |
||
445 | 445 | { |
446 | 446 | $obj = DBHTMLText::create(); |
447 | 447 | if ($this->isPublished()) { |
448 | - $obj->setValue('<img src="' . FRAMEWORK_ADMIN_DIR . '/images/alert-good.gif" />'); |
|
448 | + $obj->setValue('<img src="'.FRAMEWORK_ADMIN_DIR.'/images/alert-good.gif" />'); |
|
449 | 449 | } else { |
450 | - $obj->setValue('<img src="' . FRAMEWORK_ADMIN_DIR . '/images/alert-bad.gif" />'); |
|
450 | + $obj->setValue('<img src="'.FRAMEWORK_ADMIN_DIR.'/images/alert-bad.gif" />'); |
|
451 | 451 | } |
452 | 452 | return $obj; |
453 | 453 | } |
@@ -126,7 +126,7 @@ |
||
126 | 126 | /** |
127 | 127 | * Returns a list of pages this BlockSet features on. |
128 | 128 | * |
129 | - * @return DataList |
|
129 | + * @return \SilverStripe\ORM\DataList |
|
130 | 130 | */ |
131 | 131 | public function Pages() |
132 | 132 | { |
@@ -2,13 +2,11 @@ |
||
2 | 2 | |
3 | 3 | namespace SheaDawson\Blocks\Model; |
4 | 4 | |
5 | -use SheaDawson\Blocks\Forms\GridFieldConfigBlockManager; |
|
6 | 5 | use SilverStripe\ORM\DataObject; |
7 | 6 | use SilverStripe\ORM\ArrayLib; |
8 | 7 | use SilverStripe\CMS\Model\SiteTree; |
9 | 8 | use SilverStripe\Security\PermissionProvider; |
10 | 9 | use SilverStripe\Security\Permission; |
11 | -use SilverStripe\Security\Group; |
|
12 | 10 | use SilverStripe\Forms\TreeMultiselectField; |
13 | 11 | use SilverStripe\Forms\CheckboxField; |
14 | 12 | use SilverStripe\Forms\HeaderField; |
@@ -89,8 +89,8 @@ |
||
89 | 89 | $fields->removeFieldFromTab('Root', 'Blocks'); |
90 | 90 | |
91 | 91 | /** |
92 | - * @todo - change relation editor back to the custom block manager config and fix issues when 'creating' Blocks from a BlockSet. |
|
93 | - */ |
|
92 | + * @todo - change relation editor back to the custom block manager config and fix issues when 'creating' Blocks from a BlockSet. |
|
93 | + */ |
|
94 | 94 | $gridConfig = GridFieldConfig_RelationEditor::create(); |
95 | 95 | $gridConfig->addComponent(new GridFieldOrderableRows('Sort')); |
96 | 96 | $gridConfig->addComponent(new GridFieldDeleteAction()); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $fields->addFieldToTab('Root.Main', MultiValueCheckboxField::create('PageTypes', _t('BlockSet.OnlyApplyToThesePageTypes', 'Only apply to these Page Types:'), $this->pageTypeOptions()) |
79 | 79 | ->setDescription(_t('BlockSet.OnlyApplyToThesePageTypesDescription', 'Selected Page Types will inherit this Block Set automatically. Leave all unchecked to apply to all page types.'))); |
80 | 80 | $fields->addFieldToTab('Root.Main', TreeMultiselectField::create('PageParents', _t('BlockSet.OnlyApplyToChildrenOfThesePages', 'Only apply to children of these Pages:'), 'SilverStripe\\CMS\\Model\\SiteTree')); |
81 | - $fields->addFieldToTab('Root.Main', CheckboxField::create('IncludePageParent', _t('BlockSet.ApplyBlockSetToSelectedPageParentsAsWellAsChildren','Apply block set to selected page parents as well as children'))); |
|
81 | + $fields->addFieldToTab('Root.Main', CheckboxField::create('IncludePageParent', _t('BlockSet.ApplyBlockSetToSelectedPageParentsAsWellAsChildren', 'Apply block set to selected page parents as well as children'))); |
|
82 | 82 | |
83 | 83 | if (!$this->ID) { |
84 | 84 | $fields->addFieldToTab('Root.Main', LiteralField::create('NotSaved', "<p class='message warning'>"._t('BlockSet.YouCanAddBlocksToThisSetOnceYouHaveSavedIt', 'You can add Blocks to this set once you have saved it for the first time').'</p>')); |
@@ -168,15 +168,15 @@ discard block |
||
168 | 168 | { |
169 | 169 | return [ |
170 | 170 | 'BLOCKSET_EDIT' => [ |
171 | - 'name' => _t('BlockSet.EditBlockSet','Edit a Block Set'), |
|
171 | + 'name' => _t('BlockSet.EditBlockSet', 'Edit a Block Set'), |
|
172 | 172 | 'category' => _t('Block.PermissionCategory', 'Blocks'), |
173 | 173 | ], |
174 | 174 | 'BLOCKSET_DELETE' => [ |
175 | - 'name' => _t('BlockSet.DeleteBlockSet','Delete a Block Set'), |
|
175 | + 'name' => _t('BlockSet.DeleteBlockSet', 'Delete a Block Set'), |
|
176 | 176 | 'category' => _t('Block.PermissionCategory', 'Blocks'), |
177 | 177 | ], |
178 | 178 | 'BLOCKSET_CREATE' => [ |
179 | - 'name' => _t('BlockSet.CreateBlockSet','Create a Block Set'), |
|
179 | + 'name' => _t('BlockSet.CreateBlockSet', 'Create a Block Set'), |
|
180 | 180 | 'category' => _t('Block.PermissionCategory', 'Blocks'), |
181 | 181 | ], |
182 | 182 | ]; |
@@ -80,15 +80,15 @@ |
||
80 | 80 | $object = singleton(BlockSet::class); |
81 | 81 | $expected = [ |
82 | 82 | 'BLOCKSET_EDIT' => [ |
83 | - 'name' => _t('BlockSet.EditBlockSet','Edit a Block Set'), |
|
83 | + 'name' => _t('BlockSet.EditBlockSet', 'Edit a Block Set'), |
|
84 | 84 | 'category' => _t('Block.PermissionCategory', 'Blocks'), |
85 | 85 | ], |
86 | 86 | 'BLOCKSET_DELETE' => [ |
87 | - 'name' => _t('BlockSet.DeleteBlockSet','Delete a Block Set'), |
|
87 | + 'name' => _t('BlockSet.DeleteBlockSet', 'Delete a Block Set'), |
|
88 | 88 | 'category' => _t('Block.PermissionCategory', 'Blocks'), |
89 | 89 | ], |
90 | 90 | 'BLOCKSET_CREATE' => [ |
91 | - 'name' => _t('BlockSet.CreateBlockSet','Create a Block Set'), |
|
91 | + 'name' => _t('BlockSet.CreateBlockSet', 'Create a Block Set'), |
|
92 | 92 | 'category' => _t('Block.PermissionCategory', 'Blocks'), |
93 | 93 | ], |
94 | 94 | ]; |