Version: current

     1 <?php
     2
     3 class PhotoAlbumWidgetLinkDecorator extends DataObjectDecorator {
     4     function extraStatics() {
     5         return array(
     6             'belongs_many_many' => array(
     7                 'Widgets' => 'PhotoAlbumHomepageWidget',
     8             ),
     9         );
    10     }
    11
    12     function updateCMSFields(& $fields) {
    13         $tab = $fields->findOrMakeTab('Root.Content.Widgets', _t('PhotoAlbumPage.tab_Widgets', 'Виджеты'));
    14         $ctf = new ManyManyComplexTableField(
    15             $this->owner,
    16             'Widgets',
    17             'PhotoAlbumHomepageWidget',
    18             array('Title' => _t('PhotoAlbumPage.WidgetTitle', 'Виджет'))
    19         );
    20         $ctf->setPermissions(array());
    21         $tab->push($ctf);
    22     }
    23 }

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