public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->removeByName('Name');
     $fields->removeByName('OwnerID');
     $fields->removeByName('ParentID');
     $fields->addFieldToTab('Root.Main', new TextField('SortOrder'));
     $fields->addFieldToTab('Root.Main', new TextField('Group'));
     return $fields;
 }
Example #2
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $urlLink = "<div class='field readonly'>";
     $urlLink .= "<label class='left'>" . _t('AssetTableField.URL', 'URL') . "</label>";
     $urlLink .= "<span class='readonly'><a href='{$this->Link()}'>{$this->RelativeLink()}</a></span>";
     $urlLink .= "</div>";
     //attach the addition file information for an image to the existing FieldGroup create in the parent class
     $fileAttributes = $fields->fieldByName('Root.Main.FilePreview')->fieldByName('FilePreviewData');
     $fileAttributes->push(new ReadonlyField("Dimensions", _t('AssetTableField.DIM', 'Dimensions') . ':'));
     return $fields;
 }
Example #3
0
 /**
  * FieldList $fields for the EditForm
  * @example 'getCMSFields'
  * 
  * @param File $file File context to generate fields for
  * @return FieldList List of form fields
  */
 public function getFileEditFields(File $file)
 {
     // Empty actions, generate default
     if (empty($this->fileEditFields)) {
         $fields = $file->getCMSFields();
         // Only display main tab, to avoid overly complex interface
         if ($fields->hasTabSet() && ($mainTab = $fields->findOrMakeTab('Root.Main'))) {
             $fields = $mainTab->Fields();
         }
         return $fields;
     }
     // Fields instance
     if ($this->fileEditFields instanceof FieldList) {
         return $this->fileEditFields;
     }
     // Method to call on the given file
     if ($file->hasMethod($this->fileEditFields)) {
         return $file->{$this->fileEditFields}();
     }
     user_error("Invalid value for UploadField::fileEditFields", E_USER_ERROR);
 }
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     $fields->insertAfter('LastEdited', new ReadonlyField("Dimensions", _t('AssetTableField.DIM', 'Dimensions') . ':'));
     return $fields;
 }
    public function getCMSFields()
    {
        $fields = parent::getCMSFields();
        $fields->addFieldsToTab('Root.FileInformation', array(new TextField('Title', 'Title of File', $this->Title), new TextField('CallToActionText', 'Call To Action Text (placed on button or link selected)', $this->CallToActionText), new TreeDropdownField("InternalLinkID", "Internal page link", "SiteTree"), new TextField('ExternalURL', 'External link (e.g http://example.com/landing/page) - will override Internal Page Link', $this->ExternalURL), new TextField('Caption', 'File Caption', $this->Caption), new TextareaField('Description', 'File Description', 5, NULL, $this->Description)));
        $meta = $this->GetMeta();
        $fields->addFieldsToTab('Root.FilePreview', array(new LiteralField('FileMetaData', <<<HTML
<table class="uploadanythingfile_meta">
\t<tbody>
\t\t<tr><th>Size</th><td>{$meta['size']}</td></tr>
\t\t<tr><th>Width</th><td>{$meta['width']}</td></tr>
\t\t<tr><th>Height</th><td>{$meta['height']}</td></tr>
\t\t<tr><th>Type</th><td>{$meta['mimetype']}</td></tr>
\t</tbody>
</table>
HTML
), new LiteralField('FilePreviewLiteral', $this->Thumbnail('SetWidth', 400))));
        $fields->addFieldsToTab('Root.Ownership', array(new DropDownField('OwnerID', 'File Owner', DataObject::get('Member')->map('ID', 'Name'), $this->OwnerID)));
        $fields->removeByName('Filename');
        $fields->removeByName('Name');
        $fields->removeByName('Content');
        $fields->removeByName('Sort');
        $fields->removeByName('Parent');
        $fields->removeByName('ShowInSearch');
        $fields->removeByName('Main');
        $fields->removeByName('BackLinkTracking');
        //gallery - unsure what to do with these just yet
        $fields->removeByName('GalleryID');
        $fields->removeByName('GalleryClassName');
        return $fields;
    }