Source of file GridFieldFileRestoreAction.php
Size: 0,644 Bytes - Last Modified: 2021-12-23T10:36:08+00:00
/var/www/docs.ssmods.com/process/src/src/Forms/GridField/GridFieldFileRestoreAction.php
12345678910111213141516171819202122232425 | <?php namespace SilverStripe\VersionedAdmin\Forms\GridField; use SilverStripe\Assets\File; use SilverStripe\Versioned\GridFieldRestoreAction; /** * Extension of GridFieldRestoreAction to only show action if there is a valid file */ class GridFieldFileRestoreAction extends GridFieldRestoreAction { /** * @inheritdoc */ public function getRestoreAction($gridField, $record, $columnName) { // Only show the action if the file exists if ($record instanceof File && $record->exists()) { return parent::getRestoreAction($gridField, $record, $columnName); } return null; } } |