1 <?php
2
3
4 class extends SidebarWidget {
5 static $db = array(
6 'MenuSettings' => 'Varchar',
7 );
8
9
10 static $has_one = array(
11 'RootPage' => 'SiteTree',
12 );
13
14 static = array(
15 '1expanded',
16 '12expanded',
17 );
18
19 static function ($settings) {
20 self::$menu_settings = $settings;
21 }
22
23 function getCMSFields() {
24 $fields = parent::getCMSFields();
25 $fields->replaceField('MenuSettings', new DropdownField('MenuSettings', $this->fieldLabel('MenuSettings'), WebylonWidget::get_array_localization($this->class, 'MenuSettings', self::$menu_settings)));
26 $parentIDField = new TreeDropdownField('RootPageID', $this->fieldLabel('RootPage'), 'SiteTree');
27 $fields->replaceField('RootPageID', $parentIDField);
28 return $fields;
29 }
30
31 function hasContent() {
32 if ($this->RootPageID && ($rootPage = $this->RootPage()) && $rootPage->ID) {
33 return true;
34 }
35 return false;
36 }
37
38 }
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-