2013-07-21 12:23:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Swaps the GridField Link out for the SiteTree edit link using {@link SiteTree::CMSEditLink()}
|
|
|
|
*
|
|
|
|
* @package silverstripe
|
|
|
|
* @subpackage blog
|
|
|
|
*
|
2014-03-24 01:19:27 +01:00
|
|
|
* @author Michael Strong <github@michaelstrong.co.uk>
|
2013-07-21 12:23:35 +02:00
|
|
|
**/
|
|
|
|
class GridFieldSiteTreeEditButton extends GridFieldEditButton {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param GridField $gridField
|
|
|
|
* @param DataObject $record
|
|
|
|
* @param string $columnName
|
|
|
|
*
|
|
|
|
* @return string - the HTML for the column
|
|
|
|
*/
|
|
|
|
public function getColumnContent($gridField, $record, $columnName) {
|
2014-02-16 06:19:26 +01:00
|
|
|
// No permission checks - handled through GridFieldDetailForm
|
2013-07-21 12:23:35 +02:00
|
|
|
// which can make the form readonly if no edit permissions are available.
|
|
|
|
|
|
|
|
$data = new ArrayData(array(
|
|
|
|
'Link' => $record->CMSEditLink()
|
|
|
|
));
|
|
|
|
|
|
|
|
return $data->renderWith('GridFieldEditButton');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|