Source of file GridFieldSiteTreeEditButton.php
Size: 0,849 Bytes - Last Modified: 2021-12-23T10:04:28+00:00
/var/www/docs.ssmods.com/process/src/code/forms/gridfield/GridFieldSiteTreeEditButton.php
123456789101112131415161718192021222324252627282930313233 | <?php /** * Swaps the GridField Link out for the SiteTree edit link using {@link SiteTree::CMSEditLink()}. * * Bypasses GridFieldDetailForm * * @package silverstripe * @subpackage lumberjack * * @author Michael Strong <mstrong@silverstripe.org> **/ 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) { // No permission checks - handled through GridFieldDetailForm // which can make the form readonly if no edit permissions are available. $data = new ArrayData(array( 'Link' => $record->CMSEditLink() )); return $data->renderWith('GridFieldEditButton'); } } |