Skip to content

Commit

Permalink
Merge pull request silverstripe#79 from creative-commoners/pulls/2.0/…
Browse files Browse the repository at this point in the history
…edit-icon

FIX Ensure extra CSS classes are used for GridField edit button
  • Loading branch information
NightJar authored Apr 20, 2018
2 parents fadb5d0 + 536be59 commit f3efb9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/Forms/GridFieldConfig_Lumberjack.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
use SilverStripe\Forms\GridField\GridFieldPaginator;
use SilverStripe\Forms\GridField\GridFieldSortableHeader;
use SilverStripe\Forms\GridField\GridFieldToolbarHeader;
use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeAddNewButton;
use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeEditButton;
use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeState;

/**
* GridField config necessary for managing a SiteTree object.
Expand Down
11 changes: 5 additions & 6 deletions src/Forms/GridFieldSiteTreeEditButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

namespace SilverStripe\Lumberjack\Forms;

use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldEditButton;
use SilverStripe\ORM\DataObject;
use SilverStripe\View\ArrayData;

/**
* Swaps the GridField Link out for the SiteTree edit link using {@link SiteTree::CMSEditLink()}.
*
* Bypasses GridFieldDetailForm
*
* @package silverstripe
* @subpackage lumberjack
*
* @author Michael Strong <[email protected]>
**/
**/
class GridFieldSiteTreeEditButton extends GridFieldEditButton
{
/**
Expand All @@ -29,8 +28,8 @@ public function getColumnContent($gridField, $record, $columnName)
// which can make the form readonly if no edit permissions are available.

$data = ArrayData::create([
'Link' => $record->CMSEditLink(),
'ExtraClass' => $this->getExtraClass()
'Link' => $record->CMSEditLink(),
'ExtraClass' => $this->getExtraClass(),
]);

return $data->renderWith(GridFieldEditButton::class);
Expand Down

0 comments on commit f3efb9a

Please sign in to comment.