_submission = $submission; } // // Template methods from GridCellProvider // /** * @copydoc GridCellProvider::getTemplateVarsFromRowColumn() */ function getTemplateVarsFromRowColumn($row, $column) { $element = $row->getData(); $columnId = $column->getId(); assert(is_a($element, 'DataObject') && !empty($columnId)); switch ($columnId) { case 'label': return array( 'label' => ($element->getRemoteUrl()=='' && $element->getFileId())?'':$element->getLabel() ); break; default: assert(false); } return parent::getTemplateVarsFromRowColumn($row, $column); } /** * Get request arguments. * @param $row GridRow * @return array */ function getRequestArgs($row) { return array( 'submissionId' => $this->_submission->getId(), ); } /** * @copydoc GridCellProvider::getCellActions() */ function getCellActions($request, $row, $column) { switch ($column->getId()) { case 'label': $element = $row->getData(); if ($element->getRemoteUrl() != '' || !$element->getFileId()) break; $submissionFileDao = DAORegistry::getDAO('SubmissionFileDAO'); import('lib.pkp.classes.submission.SubmissionFile'); $submissionFile = $submissionFileDao->getLatestRevision( $element->getFileId(), null, $element->getSubmissionId() ); import('lib.pkp.controllers.api.file.linkAction.DownloadFileLinkAction'); return array(new DownloadFileLinkAction($request, $submissionFile, WORKFLOW_STAGE_ID_PRODUCTION, $element->getLabel())); } return parent::getCellActions($request, $row, $column); } } ?>