2015-04-21 06:47:46 +02:00
|
|
|
<?php
|
|
|
|
|
2016-12-15 04:41:49 +01:00
|
|
|
namespace SilverStripe\Blog\Admin;
|
|
|
|
|
2016-12-16 05:10:38 +01:00
|
|
|
use SilverStripe\Forms\GridField\GridField_FormAction;
|
2016-12-15 04:41:49 +01:00
|
|
|
|
2015-11-21 07:17:29 +01:00
|
|
|
class GridFieldFormAction extends GridField_FormAction
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var array
|
|
|
|
*/
|
2017-09-14 00:59:01 +02:00
|
|
|
protected $extraAttributes = [];
|
2015-04-21 06:47:46 +02:00
|
|
|
|
2015-11-21 07:17:29 +01:00
|
|
|
/**
|
|
|
|
* @param array $attributes
|
|
|
|
*/
|
|
|
|
public function setExtraAttributes(array $attributes)
|
|
|
|
{
|
|
|
|
$this->extraAttributes = $attributes;
|
|
|
|
}
|
2015-04-21 06:47:46 +02:00
|
|
|
|
2015-11-21 07:17:29 +01:00
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getAttributes()
|
|
|
|
{
|
|
|
|
$attributes = parent::getAttributes();
|
2015-04-21 06:47:46 +02:00
|
|
|
|
2015-11-21 07:17:29 +01:00
|
|
|
return array_merge(
|
|
|
|
$attributes,
|
|
|
|
$this->extraAttributes
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|