示例#1
0
 function editContext($args)
 {
     RTAdminHandler::validate();
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $journal = Request::getJournal();
     $versionId = isset($args[0]) ? $args[0] : 0;
     $version =& $rtDao->getVersion($versionId, $journal->getJournalId());
     $contextId = isset($args[1]) ? $args[1] : 0;
     $context =& $rtDao->getContext($contextId);
     if (isset($version) && isset($context) && $context->getVersionId() == $version->getVersionId()) {
         import('rt.ojs.form.ContextForm');
         RTAdminHandler::setupTemplate(true, $version, $context);
         $contextForm =& new ContextForm($contextId, $versionId);
         $contextForm->initData();
         $contextForm->display();
     } else {
         Request::redirect(null, null, 'contexts', $versionId);
     }
 }
 function settings()
 {
     RTAdminHandler::validate();
     $journal = Request::getJournal();
     if ($journal) {
         RTAdminHandler::setupTemplate(true);
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign_by_ref('journals', $journals);
         $rtDao =& DAORegistry::getDAO('RTDAO');
         $rt = $rtDao->getJournalRTByJournal($journal);
         $versionOptions = array();
         $versions = $rtDao->getVersions($journal->getJournalId());
         foreach ($versions->toArray() as $version) {
             $versionOptions[$version->getVersionId()] = $version->getTitle();
         }
         $templateMgr->assign('versionOptions', $versionOptions);
         $templateMgr->assign_by_ref('version', $rt->getVersion());
         $templateMgr->assign('enabled', $rt->getEnabled());
         $templateMgr->assign('abstract', $rt->getAbstract());
         $templateMgr->assign('captureCite', $rt->getCaptureCite());
         $templateMgr->assign('viewMetadata', $rt->getViewMetadata());
         $templateMgr->assign('supplementaryFiles', $rt->getSupplementaryFiles());
         $templateMgr->assign('printerFriendly', $rt->getPrinterFriendly());
         $templateMgr->assign('authorBio', $rt->getAuthorBio());
         $templateMgr->assign('defineTerms', $rt->getDefineTerms());
         $templateMgr->assign('emailAuthor', $rt->getEmailAuthor());
         $templateMgr->assign('emailOthers', $rt->getEmailOthers());
         $templateMgr->assign('findingReferences', $rt->getFindingReferences());
         // Bring in the comments constants.
         $commentDao =& DAORegistry::getDao('CommentDAO');
         $templateMgr->assign('commentsOptions', array('COMMENTS_DISABLED' => COMMENTS_DISABLED, 'COMMENTS_AUTHENTICATED' => COMMENTS_AUTHENTICATED, 'COMMENTS_ANONYMOUS' => COMMENTS_ANONYMOUS, 'COMMENTS_UNAUTHENTICATED' => COMMENTS_UNAUTHENTICATED));
         $templateMgr->assign('enableComments', $journal->getSetting('enableComments'));
         $templateMgr->assign('helpTopicId', 'journal.managementPages.readingTools.settings');
         $templateMgr->display('rtadmin/settings.tpl');
     } else {
         Request::redirect(null, Request::getRequestedPage());
     }
 }
 function validateUrls($args)
 {
     RTAdminHandler::validate();
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $journal = Request::getJournal();
     if (!$journal) {
         Request::redirect(null, Request::getRequestedPage());
         return;
     }
     $versionId = isset($args[0]) ? $args[0] : 0;
     $journalId = $journal->getJournalId();
     $version = $rtDao->getVersion($versionId, $journalId);
     if ($version) {
         // Validate the URLs for a single version
         $versions = array(&$version);
         $versions =& new ArrayItemIterator($versions, 1, 1);
     } else {
         // Validate all URLs for this journal
         $versions = $rtDao->getVersions($journalId);
     }
     RTAdminHandler::setupTemplate(true, $version);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->register_modifier('validate_url', 'smarty_rtadmin_validate_url');
     $templateMgr->assign_by_ref('versions', $versions);
     $templateMgr->assign('helpTopicId', 'journal.managementPages.readingTools');
     $templateMgr->display('rtadmin/validate.tpl');
 }
 function editVersion($args)
 {
     RTAdminHandler::validate();
     $rtDao =& DAORegistry::getDAO('RTDAO');
     $journal = Request::getJournal();
     $versionId = isset($args[0]) ? $args[0] : 0;
     $version =& $rtDao->getVersion($versionId, $journal->getJournalId());
     if (isset($version)) {
         import('rt.ojs.form.VersionForm');
         RTAdminHandler::setupTemplate(true, $version);
         $versionForm =& new VersionForm($versionId, $journal->getJournalId());
         $versionForm->initData();
         $versionForm->display();
     } else {
         Request::redirect(null, null, 'versions');
     }
 }