UncleCheese\BetterButtons\Actions\BetterButtonCustomAction
Defines an arbitrary action that can be taken from a grid field detail form
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class BetterButtonCustomAction
extends BetterButtonAction
{
- // constants
- const GOBACK = 1;
- const REFRESH = 2;
- // members
- protected $actionName;
- protected $redirectType;
- protected $redirectURL;
- // Inherited members from BetterButtonAction
- protected Form $form;
- protected $buttonText;
- protected $buttonName;
- protected GridFieldDetailForm_ItemRequest $gridFieldRequest;
- // methods
- public void __construct()
- public string getButtonName()
- public void setRedirectType()
- public int getRedirectType()
- public void setRedirectURL()
- public string getRedirectURL()
- public string getButtonLink()
- // Inherited methods from BetterButtonAction
- public void __construct()
- public void bindGridField()
- public string getButtonName()
- public string getButtonLink()
- public bool shouldDisplay()
- public string getButtonHTML()
- public string getButtonText()
- public BetterButtonAction setConfirmation()
- public SSViewer FieldHolder()
Hierarchy
Constants
Name | Value |
---|---|
GOBACK | 1 |
A symbol representing the "go back" behaviour | |
REFRESH | 2 |
A symbol representing the "refresh" behaviour |
Members
protected
- $actionName
—
string
The name of the action (e.g. a method) to take on the model - $form
—
SilverStripe\Forms\Form
The form that this action is associated with - $gridFieldRequest
—
SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest
The request that is associated with the gridfield - $redirectType
—
int
The type of redirect, see GOBACK and REFRESH constants - $redirectURL
—
string
The redirect URL. Overrides $redirectType
Methods
public
- __construct() — Builds the button
- getButtonLink() — Gets the link for the button
- getButtonName() — Button name in this case has to be predictable so we can find it in a set to call a custom action
- getRedirectType() — Gets the redirect type
- getRedirectURL() — Gets the redirect URL
- setRedirectType() — Sets the behaviour on completion of the action, either refresh or go back to list.
- setRedirectURL() — Sets the redirect URL. Overrides $redirectType;
Inherited from UncleCheese\BetterButtons\Actions\BetterButtonAction
public
- FieldHolder() — Generates the button. Updates the literal field with the correct HTML based on any post-contruct updates
- bindGridField() — Bind the button to the GridField request
- getButtonHTML() — Gets the HTML representing the button
- getButtonLink() — A noop that gets the link for the button
- getButtonName() — Get the name of the button. Arbitrary.
- getButtonText() — Gets the text for the button
- setConfirmation() — Sets the confirm text
- shouldDisplay() — Determines if the button should display