public function onBeforeRender(FileAttachmentField $field) { if ($field->getSetting('sortable') && $this->owner->isCMS()) { $field->setSetting('sortable-action', $field->Link('sort')); $field->setSetting('sort-column', $this->getSortableColumn()); $field->addExtraClass('is-sortable'); Requirements::javascript(DROPZONE_SORTABLE_DIR . '/javascript/dropzone-sortable.js'); Requirements::css(DROPZONE_SORTABLE_DIR . '/css/dropzone-sortable.css'); } }
public function Link($action = null) { if ($this->multiRecordAction) { return $this->form->FormAction() . '/field/' . $this->multiRecordAction . '/' . $action; } return parent::Link($action); }