From 8a38580159752064b2265293816817f12e2ab580 Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Tue, 7 Apr 2009 02:44:45 +0000 Subject: [PATCH] MINOR: Add disabled class to InlineFormAction, adjust Folder to use InlineFormAction rather than LiteralField for "Delete unused thumbnails" button. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@74168 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/Folder.php | 24 +++++++++++------------- forms/InlineFormAction.php | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/filesystem/Folder.php b/filesystem/Folder.php index 738df906f..aef316402 100755 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -331,6 +331,9 @@ class Folder extends File { $deleteButton = new HiddenField('deletemarked'); } + $inlineFormAction = new InlineFormAction("delete_unused_thumbnails", _t('Folder.DELETEUNUSEDTHUMBNAILS', 'Delete unused thumbnails')); + $inlineFormAction->includeDefaultJS(false) ; + $fields = new FieldSet( new HiddenField("Title"), new TabSet("Root", @@ -353,19 +356,14 @@ class Folder extends File { ) ), new Tab("UnusedFiles", _t('Folder.UNUSEDFILESTAB', "Unused files"), - new LiteralField("UnusedAssets", - "

"._t('Folder.UNUSEDFILESTITLE', 'Unused files')."

" - ), - $this->getAssetList(), - new LiteralField("UnusedThumbnails", - "
-
-

"._t('Folder.UNUSEDTHUMBNAILSTITLE', 'Unused thumbnails')."

- -
" - ) - ) - ), + new LiteralField( "UnusedAssets", "

"._t('Folder.UNUSEDFILESTITLE', 'Unused files')."

" ), + $this->getAssetList(), + new FieldGroup( + new LiteralField( "UnusedThumbnails", "

"._t('Folder.UNUSEDTHUMBNAILSTITLE', 'Unused thumbnails')."

"), + $inlineFormAction + ) + ) + ), new HiddenField("ID") ); diff --git a/forms/InlineFormAction.php b/forms/InlineFormAction.php index 105ec99c7..10f7f3f5b 100755 --- a/forms/InlineFormAction.php +++ b/forms/InlineFormAction.php @@ -57,7 +57,7 @@ class InlineFormAction_ReadOnly extends FormField { protected $readonly = true; function Field() { - return "name}\" value=\"{$this->title}\" id=\"{$this->id()}\" disabled=\"disabled\" class=\"action$this->extraClass\" />"; + return "name}\" value=\"{$this->title}\" id=\"{$this->id()}\" disabled=\"disabled\" class=\"action disabled$this->extraClass\" />"; } function Title() {