Source of file DMSGridFieldEditButton.php
Size: 0,811 Bytes - Last Modified: 2021-12-23T10:29:25+00:00
/var/www/docs.ssmods.com/process/src/code/cms/DMSGridFieldEditButton.php
123456789101112131415161718192021222324252627 | <?php class DMSGridFieldEditButton extends GridFieldEditButton implements GridField_ColumnProvider { /** * Overriding the parent method to change the template that the DMS edit button will be rendered with based on * whether or not the user has edit permissions. * * @param GridField $gridField * @param DataObject $record * @param string $columnName * * @return string - the HTML for the column */ public function getColumnContent($gridField, $record, $columnName) { $data = new ArrayData(array( 'Link' => Controller::join_links($gridField->Link('item'), $record->ID, 'edit') )); $template = $record->canEdit() ? 'GridFieldEditButton' : 'GridFieldViewButton'; return $data->renderWith($template); } } |