2018-05-29 06:10:52 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace SilverStripe\Forms\GridField;
|
|
|
|
|
|
|
|
use SilverStripe\ORM\DataObject;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GridField action menu item interface, this provides data so the action
|
|
|
|
* will be included if there is a {@see GridField_ActionMenu}
|
|
|
|
*/
|
|
|
|
interface GridField_ActionMenuItem extends GridFieldComponent
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Default group name
|
|
|
|
*/
|
|
|
|
const DEFAULT_GROUP = 'Default';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the title for this menu item
|
|
|
|
*
|
|
|
|
* @see {@link GridField_ActionMenu->getColumnContent()}
|
|
|
|
*
|
|
|
|
* @param GridField $gridField
|
|
|
|
* @param DataObject $record
|
|
|
|
*
|
|
|
|
* @return string $title
|
|
|
|
*/
|
|
|
|
public function getTitle($gridField, $record, $columnName);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets any extra data that could go in to the schema that the menu generates
|
|
|
|
*
|
|
|
|
* @see {@link GridField_ActionMenu->getColumnContent()}
|
|
|
|
*
|
|
|
|
* @param GridField $gridField
|
|
|
|
* @param DataObject $record
|
|
|
|
*
|
|
|
|
* @return array $data
|
|
|
|
*/
|
|
|
|
public function getExtraData($gridField, $record, $columnName);
|
|
|
|
|
|
|
|
/**
|
2018-06-06 11:14:29 +02:00
|
|
|
* Gets the group this menu item will belong to. A null value should indicate
|
|
|
|
* the button should not display.
|
2018-05-29 06:10:52 +02:00
|
|
|
*
|
|
|
|
* @see {@link GridField_ActionMenu->getColumnContent()}
|
|
|
|
*
|
|
|
|
* @param GridField $gridField
|
|
|
|
* @param DataObject $record
|
|
|
|
*
|
2018-06-06 11:14:29 +02:00
|
|
|
* @return string|null $group
|
2018-05-29 06:10:52 +02:00
|
|
|
*/
|
|
|
|
public function getGroup($gridField, $record, $columnName);
|
|
|
|
}
|