sourceSort = "Title"; $this->Markable = true; } function setFolder($folder) { $this->folder = $folder; $this->sourceFilter .= ($this->sourceFilter) ? " AND " : ""; $this->sourceFilter .= " ParentID = '" . $folder->ID . "' AND ClassName <> 'Folder'"; } function Folder() { return $this->folder; } function sourceID() { if($this->folder) return $this->folder->ID; } /** * Get the pop-up fields for the given record. */ function getCustomFieldsFor($childData) { if(!$childData) { user_error("AssetTableField::DetailForm No record found"); return null; } if($childData->ParentID) { $folder = DataObject::get_by_id('File', $childData->ParentID ); } else { $folder = singleton('Folder'); } $urlLink = "
"._t('AssetTableField.EDITIMAGE', 'Edit this image')."
" . '' . '' ) ), 'Main' ); if(class_exists('GalleryFile')) { $detailFormFields->addFieldToTab("BottomRoot", new Tab(_t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'), new TextField( "Content", _t('AssetTableField.CAPTION', 'Caption') ) ) ); } } else if (class_exists('GalleryFile')) { if( $childData->Extension == 'swf' ) { $detailFormFields->addFieldToTab("BottomRoot", new Tab(_t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'), new TextField( "Content", _t('AssetTableField.CAPTION', 'Caption') ), new TextField( 'PopupWidth', _t('AssetTableField.POPUPWIDTH', 'Popup Width') ), new TextField( 'PopupHeight', _t('AssetTableField.POPUPHEIGHT', 'Popup Height') ), new HeaderField( 'SWFFileOptionsHeader', _t('AssetTableField.SWFFILEOPTIONS', 'SWF File Options') ), new CheckboxField( 'Embed', _t('AssetTableField.ISFLASH', 'Is A Flash Document') ), new CheckboxField( 'LimitDimensions', _t('AssetTableField.DIMLIMT', 'Limit The Dimensions In The Popup Window') ) ) ); } else { $detailFormFields->addFieldToTab("BottomRoot", new Tab(_t('AssetTableField.GALLERYOPTIONS', 'Gallery Options'), new TextField( "Content", _t('AssetTableField.CAPTION', 'Caption') ), new TextField( 'PopupWidth', _t('AssetTableField.POPUPWIDTH', 'Popup Width') ), new TextField( 'PopupHeight', _t('AssetTableField.POPUPHEIGHT', 'Popup Height') ) ) ); } } if($childData && $childData->hasMethod('BackLinkTracking')) { $links = $childData->BackLinkTracking(); if($links->exists()) { foreach($links as $link) { $backlinks[] = "". _t('AssetTableField.NOLINKS',"This file hasn't been linked to from any pages.") ."
"; $detailFormFields->addFieldToTab("BottomRoot.Links", new LiteralField("Backlinks", $backlinks)); } // the ID field confuses the Controller-logic in finding the right view for ReferencedField $detailFormFields->removeByName('ID'); return $detailFormFields; } } ?>