ilateral\SilverStripe\ModelAdminPlus\ModelAdminPlus
Custom version of model admin that adds extra features (such as submitting search results via a POST, saving the query as a session and automatic Bulk Editing support)
- Author: ilateral
Synopsis
class ModelAdminPlus
extends ModelAdmin
{
- // constants
- const EXPORT_FIELDS = "export_fields";
- const ACTION_SUGGEST = 'suggest';
- // members
- private static boolean $auto_convert_dates = true;
- private static boolean $convert_to_autocomplete = true;
- private static array $allowed_actions = ;
- private static array $registered_snippets = ;
- // methods
- public void getSnippets()
- protected void createSnippetObject()
- public void init()
- public array getExportFields()
- public string getSearchSessionName()
- public Session clearSearchSession()
- public Session getSearchSession()
- public ModelAdminPlus setSearchSession()
- public array getSearchData()
- protected void getGridField()
- protected void getGridFieldConfig()
- public HTTPResponse suggest()
Hierarchy
Extends
- SilverStripe\Admin\ModelAdmin
Constants
Name | Value |
---|---|
EXPORT_FIELDS | "export_fields" |
ACTION_SUGGEST | 'suggest' |
Members
private
- $allowed_actions
- $auto_convert_dates
—
boolean
Automatically convert date fields on gridfields to use `Date.Nice`. - $convert_to_autocomplete
—
boolean
Automatically convert DB text fields to AutoComplete fields - $registered_snippets
—
array
List of currently registered ModelAdminSnippets, that is represented as a list of classnames.
Methods
protected
public
- clearSearchSession() — Empty the current search session
- getExportFields() — Get the default export fields for the current model.
- getSearchData() — Get the current search results, combined with any saved search results and resturn (as an array).
- getSearchSession() — Get the current search session
- getSearchSessionName() — Get the name of the session to be useed by this model admin's search form.
- getSnippets() — Setup snippets for current screen
- init()
- setSearchSession() — Set some data to a search session. This needs to be an array of data (like the data submitted by a form).
- suggest() — Find and return the recommended suggestion for an autocomplete field