silverstripe-framework/forms/gridfield/GridFieldComponent.php
Stig Lindqvist 3c516b7b97 API CHANGE: Refactored GridField modifiers into GridField_ColumnProvider, GridField_HTMLProvider, GridField_ActionProvider, and GridField_DataModifier interfaces, all added as components in the config.
API CHANGE: Simplified state handling so that it's just a key store. Affectors are replaced with GridField_ActionProviders. API CHANGE: Removed GridField state manipulation actions instead opting for GridField_ActionProvider actions.
API CHANGE: Removed support for modifiers that add "body" rows, instead having core support for generating the body rows hardcoded into the GridField.
API CHANGE: Allow modification of columns across the whole GridField with the GridField_ColumnProvider interface.
API CHANGE: Renamed GridField_AlterAction to GridField_Action, and added actionName/args parameters, since it can be used for all actions (including batch actions and row actions)
API CHANGE: Removed GridFieldRow class.
2012-01-09 13:30:34 +13:00

44 lines
1.4 KiB
PHP

<?php
/**
* Base interface for all components that can be added to GridField.
*/
interface GridFieldComponent {
}
/**
* A GridField manipulator that provides HTML for the header/footer rows, or for before/after the template
*/
interface GridField_HTMLProvider extends GridFieldComponent {
/**
* Returns a map with 4 keys 'header', 'fooer', 'before', 'after'. Each of these can contain an
* HTML fragment and each of these are optional.
*/
function getHTMLFragments($gridField);
}
interface GridField_ColumnProvider extends GridFieldComponent {
function augmentColumns($gridField, &$columns);
function getColumnsHandled($gridField);
function getColumnContent($gridField, $record, $columnName);
function getColumnAttributes($gridField, $record, $columnName);
function getColumnMetadata($gridField, $columnName);
}
interface GridField_ActionProvider extends GridFieldComponent {
/**
* Return a list of the actions handled by this action provider
*/
function getActions($gridField);
/**
* Handle an action on the given gridField.
*/
function handleAction(GridField $gridField, $actionName, $arguments, $data);
}
interface GridField_DataManipulator extends GridFieldComponent {
/**
* Manipulate the datalist as needed by this grid modifier.
* Return the new DataList.
*/
function getManipulatedData(GridField $gridField, SS_List $dataList);
}