context = $context; $this->submission = $submission; } /** * Compile the props for this file attacher */ public function getState(): array { $props = parent::getState(); $request = Application::get()->getRequest(); $props['libraryApiUrl'] = $request->getDispatcher()->url( $request, Application::ROUTE_API, $this->context->getData('urlPath'), '_library' ); if ($this->submission) { $props['includeSubmissionId'] = $this->submission->getId(); } $props['attachSelectedLabel'] = __('common.attachSelected'); $props['backLabel'] = __('common.back'); $props['downloadLabel'] = __('common.download'); return $props; } }