/**
* Display the tabs index page.
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function fetch($args, $request)
{
parent::fetch($args, $request);
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('selectedFormatId', $this->getSelectedFormatId());
$submission = $this->getSubmission();
// load in any publication formats assigned to this published monograph
$publicationFormatDao = DAORegistry::getDAO('PublicationFormatDAO');
$formats = $publicationFormatDao->getBySubmissionId($submission->getId());
$publicationFormats = array();
while ($publicationFormat = $formats->next()) {
$publicationFormats[] = $publicationFormat;
}
$templateMgr->assign_by_ref('publicationFormats', $publicationFormats);
$application = Application::getApplication();
$request = $application->getRequest();
$router = $request->getRouter();
$dispatcher = $router->getDispatcher();
// These two URLs are catalog/monograph specific.
$tabsUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'modals.submissionMetadata.CatalogEntryHandler', 'fetchFormatInfo', null, array('submissionId' => $submission->getId(), 'stageId' => $this->getStageId()));
$templateMgr->assign('tabsUrl', $tabsUrl);
$tabContentUrl = $dispatcher->url($request, ROUTE_COMPONENT, null, 'tab.catalogEntry.CatalogEntryTabHandler', 'publicationMetadata', null, array('submissionId' => $submission->getId(), 'stageId' => $this->getStageId()));
$templateMgr->assign('tabContentUrl', $tabContentUrl);
return $templateMgr->fetchJson('controllers/modals/submissionMetadata/catalogEntryTabs.tpl');
}