mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
elofgren: Add extraClass parameter to InlineFormAction? so that 'Delete Selected Files' button can have the 'delete' class assigned to it so it turns red on hover.
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41833 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
e25d8bab65
commit
fc26c64f63
@ -6,6 +6,17 @@
|
||||
class InlineFormAction extends FormField {
|
||||
|
||||
protected $includeDefaultJS = true;
|
||||
|
||||
/**
|
||||
* Create a new action button.
|
||||
* @param action The method to call when the button is clicked
|
||||
* @param title The label on the button
|
||||
* @param extraClass A CSS class to apply to the button in addition to 'action'
|
||||
*/
|
||||
function __construct($action, $title = "", $extraClass = '') {
|
||||
$this->extraClass = ' '.$extraClass;
|
||||
parent::__construct($action, $title, null, null);
|
||||
}
|
||||
|
||||
function performReadonlyTransformation() {
|
||||
return new InlineFormAction_ReadOnly( $this->name, $this->title );
|
||||
@ -16,7 +27,7 @@ class InlineFormAction extends FormField {
|
||||
Requirements::javascriptTemplate('sapphire/javascript/InlineFormAction.js',array('ID'=>$this->id()));
|
||||
}
|
||||
|
||||
return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\" class=\"action$extraClass\" />";
|
||||
return "<input type=\"submit\" name=\"action_{$this->name}\" value=\"{$this->title}\" id=\"{$this->id()}\" class=\"action{$this->extraClass}\" />";
|
||||
}
|
||||
|
||||
function Title() {
|
||||
|
Loading…
Reference in New Issue
Block a user