Version: current

     1 <?php
     2
     3 class AssetManagerFolder extends DataObjectDecorator {
     4     static $permissions = array('add','edit','upload','delete','import');
     5
     6     public function updateCMSFields(Fieldset $fields) {
     7         $fields->removeFieldFromTab("Root.Files","Files");
     8         $fields->removeFieldFromTab("Root.Files","deletemarked");
     9         $fields->removeByName("Upload");
    10         $fields->addFieldToTab("Root.Files", $a = new AssetManager($this->owner,"Files"));
    11         $a->setUploadFolder($this->owner->Filename);
    12         $a->setColumnWidths(array(
    13                 'Title' => 30,
    14                 'Filename' => 70
    15         ));
    16         $a->setSourceFilter("Classname != 'Folder' AND ParentID = ".$this->owner->ID);
    17         $a->setParentClass("Folder");
    18         $a->setPermissions(self::$permissions);
    19         $a->setAddTitle(_t('AssetManager.FILES','files'));
    20         return $fields;
    21     }
    22 }
    23
    24 ?>

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