UncleCheese\BetterButtons\Extensions\GridFieldBetterButtonsItemRequest
Decorates {@link GridDetailForm_ItemRequest} to use new form actions and buttons.
- Author: Uncle Cheese <unclecheese@leftandmain.com>
Synopsis
class GridFieldBetterButtonsItemRequest
extends DataExtension
{
- // members
- private static array $allowed_actions = ;
- // methods
- public BetterButtonsCustomActionRequest customaction()
- public BetterButtonsNestedFormRequest nestedform()
- public void addnew()
- public void updateItemEditForm()
- protected FieldList filterFieldList()
- public void doSaveAndAdd()
- public void doSaveAndQuit()
- public HTTPResponse doPublishAndAdd()
- public HTTPResponse doPublishAndClose()
- public void cancel()
- public HTTPResponse doSaveAndNext()
- public HTTPResponse doSaveAndPrev()
- public string getEditLink()
- public HTTPResponse doNew()
- public HTTPResponse save()
- public HTMLText|HTTPResponse|ViewableData_Customised publish()
- public HTMLText|ViewableData_Customised unPublish()
- public HTMLText|ViewableData_Customised rollback()
- protected Controller getToplevelController()
- public string getBackLink()
- protected void saveAndRedirect()
- public int getPreviousRecordID()
- public int getNextRecordID()
- public boolean recordIsPublished()
- public boolean recordIsDeletedFromStage()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Tasks
Line | Task |
---|---|
349 | Save this item into the given relationship |
431+ | This had to be directly copied from {@link GridFieldDetailForm_ItemRequest} because it is a protected method and not visible to a decorator! |
447+ | This had to be directly copied from {@link GridFieldDetailForm_ItemRequest} because it is a protected method and not visible to a decorator! |
449 | Coupling with CMS |
477+ | GridFieldDetailForm_ItemRequest::doSave is too monolithic, making overloading impossible. Most of this code is a direct copy. |
525+ | This method is very inefficient. |
540+ | This method is very inefficient. |
544 | Search in the paginated list only somehow (grab the limit + offset and search from there?) |
Members
private
- $allowed_actions — array
Methods
protected
- filterFieldList() — Given a list of actions, remove anything that doesn't belong.
- getToplevelController() — Gets the top level controller.
- saveAndRedirect() — Oh, the horror! DRY police be advised. This function is a serious offender.
public
- addnew() — Redirecting to the current URL doesn't do anything, so this is just a dummy action that gives the request somewhere to go in order to force a reload, and then just redirects back to the original link.
- cancel() — Goes back to list view
- customaction() — Handles all custom action from DataObjects and hands them off to a sub-controller.
- doNew() — Creates a new record. If you're already creating a new record, this forces the URL to change. Hacky UI workaround.
- doPublishAndAdd() — Publishes the record and goes to make a new record
- doPublishAndClose() — Publishes the record and closes the detail form
- doSaveAndAdd() — Saves the form and forwards to a blank form to continue creating
- doSaveAndNext() — Saves the record and goes to the next one
- doSaveAndPrev() — Saves the record and goes to the previous one
- doSaveAndQuit() — Saves the form and goes back to list view
- getBackLink() — Gets the back link
- getEditLink() — Gets the edit link for a record
- getNextRecordID() — Gets the ID of the next record in the list.
- getPreviousRecordID() — Gets the ID of the previous record in the list.
- nestedform() — Handles all custom action from DataObjects and hands them off to a sub-controller.
- publish()
- recordIsDeletedFromStage() — Determines if the current record is deleted from stage
- recordIsPublished() — Determines if the current record is published
- rollback()
- save() — Allows us to have our own configurable save button
- unPublish() — Unpublishes the record
- updateItemEditForm() — Updates the detail form to include new form actions and buttons