Version: current

     1 <?php
     2
     3 class ImageAssetManager extends ImageDataObjectManager {
     4
     5
     6     public function __construct($controller, $name, $sourceClass = "Image", $headings = null) {
     7         if($headings === null) {
     8             $headings = array(
     9                     'Title' => 'Title',
    10                     'Filename' => 'Filename'
    11             );
    12         }
    13
    14         $fields = singleton($sourceClass)->getCMSFields();
    15         $fields->removeByName("OwnerID");
    16         $fields->removeByName("Parent");
    17         $fields->removeByName("Filename");
    18         $fields->removeByName("SortOrder");
    19         $fields->removeByName("Sort");
    20         $fields->push(new ReadonlyField('Filename'));
    21         $fields->push(new SimpleTreeDropdownField('ParentID','Folder',"Folder"));
    22         $fields->push(new HiddenField('ID','',$controller->ID));
    23
    24         parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "Classname != 'Folder'");
    25     }
    26
    27 }

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