Colymba\BulkManager\BulkAction\EditHandler
Bulk action handler for editing records.
- Author: colymba
Synopsis
class EditHandler
extends Handler
{
- // members
- private static string $url_segment = 'edit';
- private static array $allowed_actions = ;
- private static array $url_handlers = ;
- protected string $label = 'Edit';
- protected string $icon = '';
- protected string $buttonClasses = 'font-icon-edit';
- protected boolean $xhr = false;
- protected boolean $destructive = false;
- // Inherited members from Handler
- protected GridField $gridField;
- protected GridFieldBulkManager $component;
- protected string $label;
- protected string $icon;
- protected string $buttonClasses;
- protected boolean $xhr;
- protected boolean $destructive;
- // methods
- public array getI18nLabel()
- public string Link()
- public Form bulkEditForm()
- public Form recordEditForm()
- private array getRecordEditingFields()
- private array filterRecordEditingFields()
- protected string escapeFieldName()
- protected array|false unEscapeFieldName()
- public string index()
- public void doSave()
- protected Controller getToplevelController()
- public ArrayData Breadcrumbs()
- // Inherited methods from Handler
- public void __construct()
- public array getConfig()
- public RequestHandler setDestructive()
- public boolean getDestructive()
- public RequestHandler setXhr()
- public boolean getXhr()
- public RequestHandler setButtonClasses()
- public string getButtonClasses()
- public RequestHandler setIcon()
- public string getIcon()
- public RequestHandler setLabel()
- public string getLabel()
- public array getI18nLabel()
- public string Link()
- public array getRecordIDList()
- public DataList getRecords()
Hierarchy
Members
private
- $allowed_actions
—
array
RequestHandler allowed actions. - $url_handlers
—
array
RequestHandler url => action map. - $url_segment
—
string
URL segment used to call this handler If none given, @BulkManager will fallback to the Unqualified class name
protected
- $component
—
Colymba\BulkManager\BulkAction\GridFieldBulkManager
GridFieldBulkManager instance. - $destructive
—
boolean
Set to true is this handler will destroy any data. - $destructive
—
boolean
Set to true is this handler will destroy any data. - $gridField
—
Colymba\BulkManager\BulkAction\GridField
Related GridField instance. - $icon
—
string
Front-end icon path for this handler's action. - $icon
—
string
Front-end icon path for this handler's action. - $label
—
string
Front-end label for this handler's action - $label
—
string
Front-end label for this handler's action - $xhr
—
boolean
Whether this handler should be called via an XHR from the front-end - $xhr
—
boolean
Whether this handler should be called via an XHR from the front-end
Methods
private
- filterRecordEditingFields() — Filters a records editable fields based on component's config and escape each field with unique name.
- getRecordEditingFields() — Returns a record's populated form fields with all filtering done ready to be included in the main form.
protected
- escapeFieldName() — Escape a fieldName with a unique prefix.
- getToplevelController() — Traverse up nested requests until we reach the first that's not a GridFieldDetailForm or GridFieldDetailForm_ItemRequest.
- unEscapeFieldName() — Un-escape a previously escaped field name.
public
- Breadcrumbs() — Edited version of the GridFieldEditForm function adds the 'Bulk Upload' at the end of the crums.
- Link() — Return URL to this RequestHandler.
- bulkEditForm() — Return a form for all the selected DataObjects with their respective editable fields.
- doSave() — Handles bulkEditForm submission and parses and saves each records data.
- getI18nLabel() — Return i18n localized front-end label
- index() — Creates and return the bulk editing interface.
- recordEditForm() — Return's a form with only one record's fields Used for bulkEditForm subForm requests via ajax.
Inherited from Colymba\BulkManager\BulkAction\Handler
public
- Link() — Returns the URL for this RequestHandler.
- getButtonClasses() — Return front-end buttonClasses
- getConfig() — Return front-end configuration
- getDestructive() — True if the hanlder performs destructive actions
- getI18nLabel() — Return i18n localized front-end label
- getIcon() — Return front-end icon
- getLabel() — Return front-end label
- getRecordIDList() — Returns the list of record IDs selected in the front-end.
- getRecords() — Returns a DataList of the records selected in the front-end.
- getXhr() — True if handler is called via XHR
- setButtonClasses() — Set front-end buttonClasses
- setDestructive() — Set if hanlder performs destructive actions
- setIcon() — Set front-end icon
- setLabel() — Set front-end label
- setXhr() — Set if handler is called via XHR