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
This commit is contained in:
Hamish Friedlander 2009-04-07 02:44:45 +00:00 committed by Sam Minnee
parent e799219724
commit 8a38580159
2 changed files with 12 additions and 14 deletions

View File

@ -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",
"<div id=\"UnusedAssets\"><h2>"._t('Folder.UNUSEDFILESTITLE', 'Unused files')."</h2>"
),
$this->getAssetList(),
new LiteralField("UnusedThumbnails",
"</div>
<div id=\"UnusedThumbnails\">
<h2>"._t('Folder.UNUSEDTHUMBNAILSTITLE', 'Unused thumbnails')."</h2>
<button class=\"action\">"._t('Folder.DELETEUNUSEDTHUMBNAILS', 'Delete unused thumbnails')."</button>
</div>"
)
)
),
new LiteralField( "UnusedAssets", "<h2>"._t('Folder.UNUSEDFILESTITLE', 'Unused files')."</h2>" ),
$this->getAssetList(),
new FieldGroup(
new LiteralField( "UnusedThumbnails", "<h2>"._t('Folder.UNUSEDTHUMBNAILSTITLE', 'Unused thumbnails')."</h2>"),
$inlineFormAction
)
)
),
new HiddenField("ID")
);

View File

@ -57,7 +57,7 @@ class InlineFormAction_ReadOnly extends FormField {
protected $readonly = true;
function Field() {
return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\" disabled=\"disabled\" class=\"action$this->extraClass\" />";
return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\" disabled=\"disabled\" class=\"action disabled$this->extraClass\" />";
}
function Title() {