getRouter(); $this->label = $label; $actionArgs = $this->getActionArgs($submissionFile, $stageId); if ($fileId) { $actionArgs['fileId'] = $fileId; } if ($filename) { $actionArgs['filename'] = $filename; } $redirectRequest = new PostAndRedirectAction( $router->url( $request, null, 'api.file.FileApiHandler', 'recordDownload', null, $actionArgs ), $router->url( $request, null, 'api.file.FileApiHandler', 'downloadFile', null, $actionArgs ) ); // Configure the file link action. parent::__construct( 'downloadFile', $redirectRequest, htmlspecialchars($this->getLabel($submissionFile)) ); } /** * Get the label for the file download action. * * @param SubmissionFile $submissionFile * * @return string */ public function getLabel($submissionFile) { if ($this->label !== null) { return $this->label; } return $submissionFile->getLocalizedData('name'); } }