getSubmission(); // load in any galley formats assigned to this published article $galleyDao = DAORegistry::getDAO('ArticleGalleyDAO'); $articleGalleys = $galleyDao->getBySubmissionId($submission->getId()); $templateMgr->assign('galleys', $articleGalleys->toArray()); $application = Application::getApplication(); $request = $application->getRequest(); $router = $request->getRouter(); $dispatcher = $router->getDispatcher(); $tabsUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'modals.submissionMetadata.IssueEntryHandler', 'fetchFormatInfo', null, array('submissionId' => $submission->getId(), 'stageId' => $this->getStageId())); $templateMgr->assign('tabsUrl', $tabsUrl); $tabContentUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'tab.issueEntry.IssueEntryTabHandler', 'galleyMetadata', null, array('submissionId' => $submission->getId(), 'stageId' => $this->getStageId())); $templateMgr->assign('tabContentUrl', $tabContentUrl); return $templateMgr->fetchJson('controllers/modals/submissionMetadata/issueEntryTabs.tpl'); } /** * Returns a JSON response containing information regarding the galley formats enabled * for this submission. * @param $args array * @param $request Request * @return JSONMessage JSON object */ function fetchFormatInfo($args, $request) { $submission = $this->getSubmission(); $galleyDao = DAORegistry::getDAO('ArticleGalleyDAO'); $galleys = $galleyDao->getBySubmissionId($submission->getId()); $formats = array(); while ($galley = $galleys->next()) { $formats[$galley->getId()] = $galley->getLocalizedName(); } $json = new JSONMessage(true, true); $json->setAdditionalAttributes(array('formats' => $formats)); return $json; } } ?>