mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 17:05:54 +02:00
Update WidgetPageExtension.php
Changing statics to private to be 3.1 compatible. I’m not sure, but would 'SideBarView' need to be defined as an allowed_action too?
This commit is contained in:
parent
69b53aefd1
commit
1a1920a004
@ -10,19 +10,19 @@
|
|||||||
*/
|
*/
|
||||||
class WidgetPageExtension extends DataExtension {
|
class WidgetPageExtension extends DataExtension {
|
||||||
|
|
||||||
static $db = array(
|
private static $db = array(
|
||||||
'InheritSideBar' => 'Boolean',
|
'InheritSideBar' => 'Boolean',
|
||||||
);
|
);
|
||||||
|
|
||||||
static $defaults = array(
|
private static $defaults = array(
|
||||||
'InheritSideBar' => true
|
'InheritSideBar' => true
|
||||||
);
|
);
|
||||||
|
|
||||||
static $has_one = array(
|
private static $has_one = array(
|
||||||
'SideBar' => 'WidgetArea'
|
'SideBar' => 'WidgetArea'
|
||||||
);
|
);
|
||||||
|
|
||||||
function updateCMSFields(FieldList $fields) {
|
public function updateCMSFields(FieldList $fields) {
|
||||||
$fields->addFieldToTab(
|
$fields->addFieldToTab(
|
||||||
"Root.Widgets",
|
"Root.Widgets",
|
||||||
new CheckboxField("InheritSideBar", 'Inherit Sidebar From Parent')
|
new CheckboxField("InheritSideBar", 'Inherit Sidebar From Parent')
|
||||||
@ -36,7 +36,7 @@ class WidgetPageExtension extends DataExtension {
|
|||||||
/**
|
/**
|
||||||
* @return WidgetArea
|
* @return WidgetArea
|
||||||
*/
|
*/
|
||||||
function SideBarView() {
|
public function SideBarView() {
|
||||||
if(
|
if(
|
||||||
$this->owner->InheritSideBar
|
$this->owner->InheritSideBar
|
||||||
&& $this->owner->getParent()
|
&& $this->owner->getParent()
|
||||||
@ -48,4 +48,4 @@ class WidgetPageExtension extends DataExtension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user