Source of file GridFieldAddNewMetadataFieldButton.php
Size: 0,842 Bytes - Last Modified: 2021-12-23T10:25:41+00:00
/var/www/docs.ssmods.com/process/src/code/formfields/GridFieldAddNewMetadataFieldButton.php
123456789101112131415161718192021222324252627 | <?php /** * This component provides a button for opening the add new form provided by {@link GridFieldDetailForm}. * * @package metadata */ class GridFieldAddNewMetadataFieldButton extends GridFieldAddNewButton { public function getHTMLFragments($gridField) { if (!$this->buttonName) { // provide a default button name, can be changed by calling {@link setButtonName()} on this component $this->buttonName = _t('GridField.Add', 'Add {name}', array('name' => singleton($gridField->getModelClass())->singular_name())); } $data = new ArrayData(array( 'NewLink' => $gridField->Link('add'), 'ButtonName' => $this->buttonName, )); return array( $this->targetFragment => $data->renderWith('GridFieldAddNewbutton'), ); } } |