LeKoala\CmsActions\ActionsGridFieldItemRequest
Decorates GridDetailForm_ItemRequest to use new form actions and buttons.
This is also applied to LeftAndMain to allow actions on pages
Warning: LeftAndMain doesn't call updateItemEditForm
This is a lightweight version of BetterButtons that use default getCMSActions functionnality
on DataObjects
Synopsis
class ActionsGridFieldItemRequest
extends DataExtension
{
- // members
- private static boolean $enable_save_prev_next = true;
- private static boolean $enable_save_close = true;
- private static boolean $enable_delete_right = true;
- private static boolean $enable_utils_prev_next = false;
- private static array $allowed_actions = ;
- // methods
- protected array getAvailableActions()
- public void updateItemEditForm()
- protected void processDropUpMenu()
- protected Tab createDropUpContainer()
- public void moveCancelAndDelete()
- public int getCustomPreviousRecordID()
- public int getCustomNextRecordID()
- public void addSaveNextAndPrevious()
- public void addSaveAndClose()
- protected string getBtnClassForRecord()
- protected HTTPResponse|DBHTMLText|string forwardActionToRecord()
- public HTTPResponse|DBHTMLText|string doCustomLink()
- public HTTPResponse|DBHTMLText|string doCustomAction()
- public void doSaveAndClose()
- public void doSaveAndNext()
- public void doSaveAndPrev()
- protected Controller getToplevelController()
- public string getBackLink()
- protected HTTPResponse|DBHTMLText|string redirectAfterAction()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Uses
- SilverStripe\Core\Config\Configurable
Tasks
Line | Task |
---|---|
308 | check why with paginator, after the first page, getPreviousRecordID/getNextRecordID tend to not work properly |
641+ | This had to be directly copied from {@link GridFieldDetailForm_ItemRequest} because it is a protected method and not visible to a decorator! |
663+ | This had to be directly copied from {@link GridFieldDetailForm_ItemRequest} because it is a protected method and not visible to a decorator! |
665 | Coupling with CMS |
691+ | This had to be directly copied from {@link GridFieldDetailForm_ItemRequest} because it is a protected method and not visible to a decorator! |
Members
private
- $allowed_actions — array
- $enable_delete_right — boolean
- $enable_save_close — boolean
- $enable_save_prev_next — boolean
- $enable_utils_prev_next — boolean
Methods
protected
- createDropUpContainer() — Prepares a Drop-Up menu
- forwardActionToRecord() — Forward a given action to a DataObject
- getAvailableActions()
- getBtnClassForRecord() — New and existing records have different classes
- getToplevelController() — Gets the top level controller.
- processDropUpMenu() — Collect all Drop-Up actions into a menu.
- redirectAfterAction() — Response object for this request after a successful save
public
- addSaveAndClose()
- addSaveNextAndPrevious()
- doCustomAction() — Handles custom actions
- doCustomLink() — Handles custom links
- doSaveAndClose() — Saves the form and goes back to list view
- doSaveAndNext() — Saves the form and goes back to the next item
- doSaveAndPrev() — Saves the form and goes to the previous item
- getBackLink() — Gets the back link
- getCustomNextRecordID()
- getCustomPreviousRecordID()
- moveCancelAndDelete()
- updateItemEditForm() — Updates the detail form to include new form actions and buttons