SilverCart\Admin\Controllers\ModelAdmin
ModelAdmin extension for SilverCart.
Provides some special functions for SilverCarts admin area.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class ModelAdmin
extends ModelAdmin
{
- // members
- private static array $allowed_actions = ;
- private static string $url_segment = 'silvercart';
- private static string $menu_icon = 'silvercart/silvercart:client/img/glyphicons-halflings.png';
- private static string $sortable_field = '';
- private static string $csv_export_delimiter = ',';
- private static string $csv_export_enclosure = '"';
- private static boolean $csv_export_has_header = true;
- protected GridField $gridField = NULL;
- protected GridFieldConfig $gridFieldConfig = NULL;
- protected static bool $search_form_is_collapsed = true;
- // methods
- protected void init()
- protected void beforeUpdateInit()
- protected void beforeUpdateEditForm()
- public string SectionTitle()
- public Form getEditForm()
- public string SearchFormCollapseClass()
- public string handleBatchCallback()
- public GridField getGridFieldFor()
- public GridFieldConfig getGridFieldConfigFor()
- public bool canView()
Hierarchy
Extends
- SilverStripe\Admin\ModelAdmin
Members
private
- $allowed_actions
—
array
Allowed actions. - $csv_export_delimiter
—
string
The default CSV export delimiter character. - $csv_export_enclosure
—
string
The default CSV export enclosure character. - $csv_export_has_header
—
string
Determines whether the CSV export file is generated with a header line. - $sortable_field
—
string
Name of DB field to make records sortable by. - $url_segment
—
string
The URL segment
protected
- $gridField
—
\SilverStripe\Forms\GridField\GridField
GridField of the edit form - $gridFieldConfig
—
SilverStripe\Forms\GridField\GridFieldConfig
GridFieldConfig of the edit form - $search_form_is_collapsed
—
SilverCart\Admin\Controllers\bool
If this is set to true the ModelAdmins SearchForm will be collapsed on load.
Methods
protected
- beforeUpdateEditForm() — Allows user code to hook into ModelAdmin::getEditForm() prior to updateEditForm being called on extensions.
- beforeUpdateInit() — Allows user code to hook into ModelAdmin::init() prior to updateInit being called on extensions.
- init() — Provides hook for decorators, so that they can overwrite css and other definitions.
public
- SearchFormCollapseClass() — Returns the CSS class to use for the SearchForms collapse state.
- SectionTitle() — title in the top bar of the CMS
- canView() — Workaround to hide this class in CMS menu.
- getEditForm() — Builds and returns the edit form.
- getGridFieldConfigFor() — Returns the GridFieldConfig of the given edit form
- getGridFieldFor() — Returns the GridField of the given edit form
- handleBatchCallback() — Handles a batch action