Version: current

     1 <?php
     2
     3 /**
     4  * Виджет Дополнительное меню
     5  *
     6  * @package widgets
     7  * @author  menedem
     8  */
     9 class AdditionalMenuWidget extends SidebarWidget {
    10
    11     static $has_many = array(
    12         'Items' => 'AdditionalMenuWidget_Item'
    13     );
    14
    15     function getCMSFields() {
    16         $fields = parent::getCMSFields();
    17         $dom = new DataObjectManager(
    18             $this,
    19             'Items',
    20             'AdditionalMenuWidget_Item',
    21             null,
    22             null,
    23             'WidgetID = ' . $this->ID
    24         );
    25         $dom->setRelationAutoSetting(true);
    26         $fields->replaceField('Items', $dom);
    27         return $fields;
    28     }
    29
    30     function ActiveItems() {
    31         return $this->Items('Active = 1');
    32     }
    33 }
    34
    35 class AdditionalMenuWidget_Item extends WebylonWidget_Item {
    36 }
    37

[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. -