1 <?php
2
3
4 class extends SidebarWidget {
5 static $db = array(
6 'MenuSettings' => 'Varchar',
7 );
8
9 static = array(
10 '23expanded',
11 'current_expanded',
12 );
13
14 static function ($settings) {
15 self::$menu_settings = $settings;
16 }
17
18 function getCMSFields() {
19 $fields = parent::getCMSFields();
20 $fields->replaceField('MenuSettings', new DropdownField('MenuSettings', $this->fieldLabel('MenuSettings'), WebylonWidget::get_array_localization($this->class, 'MenuSettings', self::$menu_settings)));
21 $fields->removeByName('ShowTitle');
22 return $fields;
23 }
24
25 function ($level=1) {
26 $controller = Controller::curr();
27 if ($controller && $controller->hasMethod('getMenu')) {
28 return $controller->getMenu($level);
29 }
30 return false;
31 }
32
33 function () {
34 return $this->MenuSettings == '23expanded';
35 }
36
37 function hasContent() {
38 return true;
39 }
40
41 function onBeforeWrite() {
42 if ($this->ShowTitle) $this->ShowTitle = 0;
43 parent::onBeforeWrite();
44 }
45 }
[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.
-