Source of file DMSUploadField_ItemHandler.php
Size: 1,064 Bytes - Last Modified: 2021-12-23T10:39:26+00:00
/var/www/docs.ssmods.com/process/src/_dev/Cms/DMSUploadField_ItemHandler.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | <?php namespace Sunnysideup\DMS\Cms; // todo: UPGRADE: we need to replace this ... // use UploadField_ItemHandler; use Sunnysideup\DMS\Model\DMSDocument; use SilverStripe\Forms\Form; class DMSUploadField_ItemHandler { private static $allowed_actions = array( 'delete', 'edit', 'EditForm', ); /** * Gets a DMS document by its ID * * @return DMSDocument */ public function getItem() { return DMSDocument::get()->byId($this->itemID); } /** * @return Form */ public function EditForm() { $file = $this->getItem(); // Get form components $fields = $this->parent->getDMSFileEditFields($file); $actions = $this->parent->getDMSFileEditActions($file); $validator = $this->parent->getDMSFileEditValidator($file); $form = new Form( $this, __FUNCTION__, $fields, $actions, $validator ); $form->loadDataFrom($file); return $form; } } |