Source of file GridFieldDetailForm_ItemRequest.php
Size: 0,958 Bytes - Last Modified: 2021-12-23T10:04:57+00:00
/var/www/docs.ssmods.com/process/src/code/Alternatives/GridFieldDetailForm_ItemRequest.php
123456789101112131415161718192021222324252627282930313233343536373839 | <?php namespace Milkyway\SS\GridFieldUtils; /** * Milkyway Multimedia * GridFieldDetailForm.php * * @package milkyway-multimedia/ss-gridfield-utils * @author Mellisa Hankins <mell@milkywaymultimedia.com.au> */ use Controller; use SS_HTTPRequest; class GridFieldDetailForm_ItemRequest extends \GridFieldDetailForm_ItemRequest { private static $allowed_actions = [ 'addnew', ]; /* * Override addnew in better buttons so that it uses this link */ public function addnew(SS_HTTPRequest $r) { $currentRecord = $this->record; $this->record = null; $link = $this->Link(); $this->record = $currentRecord; return Controller::curr()->redirect($link); } public function Link($action = null) { return Controller::join_links($this->gridField->Link($this->component->getUriSegment()), $this->record->ID ? $this->record->ID : 'new', $action); } } |