View | Details | Raw Unified | Return to bug 4934 | Differences between
and this patch

Collapse All | Expand All

(-)pages/index/IndexHandler.inc.php (-6 / +9 lines)
 Lines 28-45    Link Here 
28
	/**
28
	/**
29
	 * If no journal is selected, display list of journals.
29
	 * If no journal is selected, display list of journals.
30
	 * Otherwise, display the index page for the selected journal.
30
	 * Otherwise, display the index page for the selected journal.
31
	 * @param $args array
32
	 * @param $request Request
31
	 */
33
	 */
32
	function index($args) {
34
	function index($args, &$request) {
33
		$this->validate();
35
		$this->validate();
34
		$this->setupTemplate();
36
		$this->setupTemplate();
35
37
38
		$router =& $request->getRouter();
36
		$templateMgr =& TemplateManager::getManager();
39
		$templateMgr =& TemplateManager::getManager();
37
		$journalDao =& DAORegistry::getDAO('JournalDAO');
40
		$journalDao =& DAORegistry::getDAO('JournalDAO');
38
		$journalPath = Request::getRequestedJournalPath();
41
		$journalPath = $router->getRequestedContextPath($request, CONTEXT_JOURNAL, false);
39
		$templateMgr->assign('helpTopicId', 'user.home');
42
		$templateMgr->assign('helpTopicId', 'user.home');
40
43
41
		if ($journalPath != 'index' && $journalDao->journalExistsByPath($journalPath)) {
44
		if ($journalPath != 'index' && $journalDao->journalExistsByPath($journalPath)) {
42
			$journal =& Request::getJournal();
45
			$journal =& $router->getContext($request, CONTEXT_JOURNAL);
43
46
44
			// Assign header and content for home page
47
			// Assign header and content for home page
45
			$templateMgr->assign('displayPageHeaderTitle', $journal->getLocalizedPageHeaderTitle(true));
48
			$templateMgr->assign('displayPageHeaderTitle', $journal->getLocalizedPageHeaderTitle(true));
 Lines 73-90    Link Here 
73
					$templateMgr->assign('announcements', $announcements);
76
					$templateMgr->assign('announcements', $announcements);
74
					$templateMgr->assign('enableAnnouncementsHomepage', $enableAnnouncementsHomepage);
77
					$templateMgr->assign('enableAnnouncementsHomepage', $enableAnnouncementsHomepage);
75
				}
78
				}
76
			} 
79
			}
77
			$templateMgr->display('index/journal.tpl');
80
			$templateMgr->display('index/journal.tpl');
78
		} else {
81
		} else {
79
			$siteDao =& DAORegistry::getDAO('SiteDAO');
82
			$siteDao =& DAORegistry::getDAO('SiteDAO');
80
			$site =& $siteDao->getSite();
83
			$site =& $siteDao->getSite();
81
84
82
			if ($site->getRedirect() && ($journal = $journalDao->getJournal($site->getRedirect())) != null) {
85
			if ($site->getRedirect() && ($journal = $journalDao->getJournal($site->getRedirect())) != null) {
83
				Request::redirect($journal->getPath());
86
				$request->redirect($journal->getPath());
84
			}
87
			}
85
88
86
			$templateMgr->assign('intro', $site->getLocalizedIntro());
89
			$templateMgr->assign('intro', $site->getLocalizedIntro());
87
			$templateMgr->assign('journalFilesPath', Request::getBaseUrl() . '/' . Config::getVar('files', 'public_files_dir') . '/journals/');
90
			$templateMgr->assign('journalFilesPath', $request->getBaseUrl() . '/' . Config::getVar('files', 'public_files_dir') . '/journals/');
88
			$journals =& $journalDao->getEnabledJournals();
91
			$journals =& $journalDao->getEnabledJournals();
89
			$templateMgr->assign_by_ref('journals', $journals);
92
			$templateMgr->assign_by_ref('journals', $journals);
90
			$templateMgr->setCacheability(CACHEABILITY_PUBLIC);
93
			$templateMgr->setCacheability(CACHEABILITY_PUBLIC);

Return to bug 4934