コード例 #1
0
 public function __construct($controller, $name, $sourceClass = "Image", $headings = null)
 {
     if ($headings === null) {
         $headings = array('Title' => 'Title', 'Filename' => 'Filename');
     }
     $fields = singleton($sourceClass)->getCMSFields();
     $fields->removeByName("OwnerID");
     $fields->removeByName("Parent");
     $fields->removeByName("Filename");
     $fields->removeByName("SortOrder");
     $fields->removeByName("Sort");
     $fields->push(new ReadonlyField('Filename'));
     $fields->push(new SimpleTreeDropdownField('ParentID', 'Folder', "Folder"));
     $fields->push(new HiddenField('ID', '', $controller->ID));
     parent::__construct($controller, $name, $sourceClass, null, $headings, $fields, "Classname != 'Folder'");
 }
 public function __construct($controller, $name, $sourceClass, $fileFieldName, $fieldList = null, $detailFormFields = null, $sourceFilter = "", $sourceSort = "", $sourceJoin = "")
 {
     parent::__construct($controller, $name, $sourceClass, $fileFieldName, $fieldList, $detailFormFields, $sourceFilter, $sourceSort, $sourceJoin);
     if (!class_exists("ImageDataObjectManager")) {
         die("<strong>Error</strong>: PhotoAlbumPage requires the DataObjectManager module.");
     }
     $this->setGridLabelField('Caption');
     $this->setAddTitle('Photos');
     // We have to specify this here or when you subclass the PhotoAlbumPage the manager can't work out the parent relationship.
     // I.E. it looks for PhotoAlbumPage_Photo -- has_one -- SubClass, rather than the correct relation of PhotoAlbumPage_Photo -- has_one -- PhotoAlbumPage.
     $this->setParentClass('PhotoAlbumPage');
 }
コード例 #3
0
 public function UploadLink()
 {
     return parent::UploadLink() . "?album=" . $this->getSelectedAlbumID();
 }