Merged revisions 48401 via svnmerge from

svn://svn.silverstripe.com/silverstripe/modules/cms/branches/2.1.0-rc3oriwave2

........
  r48401 | sminnee | 2008-01-22 14:27:13 +1300 (Tue, 22 Jan 2008) | 2 lines
  
  Updated core to allow for subsites restriction of filesystem: Folder::getCMSFields() is now responsible for generating the folder form.
  Folder::syncChildren() now exclusively uses DB::query() calls instead of DataObject::get().
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@49770 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-02-19 00:23:57 +00:00
parent 0c2a44d15c
commit 29d9896dcf

View File

@ -71,15 +71,6 @@ class AssetAdmin extends LeftAndMain {
Requirements::css("cms/css/AssetAdmin.css"); Requirements::css("cms/css/AssetAdmin.css");
} }
/**
* Display the upload form. Returns an iframe tag that will show admin/assets/uploadiframe.
*/
function getUploadIframe() {
return <<<HTML
<iframe name="AssetAdmin_upload" src="admin/assets/uploadiframe/{$this->urlParams['ID']}" id="AssetAdmin_upload" border="0" style="border-style: none; width: 100%; height: 200px">
</iframe>
HTML;
}
function index() { function index() {
File::sync(); File::sync();
@ -253,63 +244,8 @@ HTML;
$record = singleton("Folder"); $record = singleton("Folder");
} }
$fileList = new AssetTableField( if($record) {
$this, $fields = $record->getCMSFields();
"Files",
"File",
array("Title" => _t('AssetAdmin.TITLE', "Title"), "LinkedURL" => _t('AssetAdmin.FILENAME', "Filename")),
""
);
$fileList->setFolder($record);
$fileList->setPopupCaption(_t('AssetAdmin.VIEWEDITASSET', "View/Edit Asset"));
if($record) {
$nameField = ($id != "root") ? new TextField("Name", "Folder Name") : new HiddenField("Name");
if( $record->userCanEdit() ) {
$deleteButton = new InlineFormAction('deletemarked',_t('AssetAdmin.DELSELECTED','Delete selected files'), 'delete');
$deleteButton->includeDefaultJS(false);
} else {
$deleteButton = new HiddenField('deletemarked');
}
$fields = new FieldSet(
new HiddenField("Title"),
new TabSet("Root",
new Tab(_t('AssetAdmin.FILESTAB', "Files"),
$nameField,
$fileList,
$deleteButton,
new HiddenField("FileIDs"),
new HiddenField("DestFolderID")
),
new Tab(_t('AssetAdmin.DETAILSTAB', "Details"),
new ReadonlyField("URL", _t('AssetAdmin.URL', 'URL')),
new ReadonlyField("ClassName", _t('AssetAdmin.TYPE','Type')),
new ReadonlyField("Created", _t('AssetAdmin.CREATED','First Uploaded')),
new ReadonlyField("LastEdited", _t('AssetAdmin.LASTEDITED','Last Updated'))
),
new Tab(_t('AssetAdmin.UPLOADTAB', "Upload"),
new LiteralField("UploadIframe",
$this->getUploadIframe()
)
)/* This has been disabled for now because of it's mass memory consumption
,
new Tab(_t('AssetAdmin.UNUSEDFILESTAB', "Unused files"),
new LiteralField("UnusedAssets",
"<div id=\"UnusedAssets\"><h2>"._t('AssetAdmin.UNUSEDFILESTITLE', 'Unused files')."</h2>"
),
$this->getAssetList(),
new LiteralField("UnusedThumbnails",
"</div>
<div id=\"UnusedThumbnails\">
<h2>"._t('AssetAdmin.UNUSEDTHUMBNAILSTITLE', 'Unused thumbnails')."</h2>
<button class=\"action\">"._t('AssetAdmin.DELETEUNUSEDTHUMBNAILS', 'Delete unused thumbnails')."</button>
</div>"
)
)*/
),
new HiddenField("ID")
);
$actions = new FieldSet(); $actions = new FieldSet();
@ -470,8 +406,7 @@ JS;
/** /**
* Return the entire site tree as a nested set of ULs * Return the entire site tree as a nested set of ULs
*/
*/
public function SiteTreeAsUL() { public function SiteTreeAsUL() {
$obj = singleton('Folder'); $obj = singleton('Folder');
$obj->setMarkingFilter("ClassName", "Folder"); $obj->setMarkingFilter("ClassName", "Folder");