mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
31ad3cdaab
* Allow buttons to opt out of display * Linting * Remove redundant function call * Add test for group delete action * Add menu group check and test for delete action * Fix linting
23 lines
610 B
PHP
23 lines
610 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Forms\Tests\GridField\GridFieldConfigTest;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\Forms\GridField\GridField_ActionMenuItem;
|
|
use SilverStripe\Forms\GridField\GridFieldEditButton;
|
|
|
|
class MyActionMenuItemComponent extends GridFieldEditButton implements TestOnly
|
|
{
|
|
protected $shouldDisplay;
|
|
|
|
public function __construct($shouldDisplay = true)
|
|
{
|
|
$this->shouldDisplay = $shouldDisplay;
|
|
}
|
|
|
|
public function getGroup($gridField, $record, $columnName)
|
|
{
|
|
return $this->shouldDisplay ? GridField_ActionMenuItem::DEFAULT_GROUP : null;
|
|
}
|
|
}
|