setupTemplate() public method

Setup common template variables.
public setupTemplate ( $request )
$request PKPRequest
コード例 #1
0
ファイル: SearchHandler.inc.php プロジェクト: alenoosh/ojs
 /**
  * Show advanced search results.
  */
 function advancedResults()
 {
     parent::validate();
     SearchHandler::setupTemplate(true);
     $rangeInfo = Handler::getRangeInfo('search');
     $searchJournalId = Request::getUserVar('searchJournal');
     if (!empty($searchJournalId)) {
         $journalDao =& DAORegistry::getDAO('JournalDAO');
         $journal =& $journalDao->getJournal($searchJournalId);
     } else {
         $journal =& Request::getJournal();
     }
     // Load the keywords array with submitted values
     $keywords = array(null => ArticleSearch::parseQuery(Request::getUserVar('query')));
     $keywords[ARTICLE_SEARCH_AUTHOR] = ArticleSearch::parseQuery(Request::getUserVar('author'));
     $keywords[ARTICLE_SEARCH_TITLE] = ArticleSearch::parseQuery(Request::getUserVar('title'));
     $keywords[ARTICLE_SEARCH_DISCIPLINE] = ArticleSearch::parseQuery(Request::getUserVar('discipline'));
     $keywords[ARTICLE_SEARCH_SUBJECT] = ArticleSearch::parseQuery(Request::getUserVar('subject'));
     $keywords[ARTICLE_SEARCH_TYPE] = ArticleSearch::parseQuery(Request::getUserVar('type'));
     $keywords[ARTICLE_SEARCH_COVERAGE] = ArticleSearch::parseQuery(Request::getUserVar('coverage'));
     $keywords[ARTICLE_SEARCH_GALLEY_FILE] = ArticleSearch::parseQuery(Request::getUserVar('fullText'));
     $keywords[ARTICLE_SEARCH_SUPPLEMENTARY_FILE] = ArticleSearch::parseQuery(Request::getUserVar('supplementaryFiles'));
     $fromDate = Request::getUserDateVar('dateFrom', 1, 1);
     if ($fromDate !== null) {
         $fromDate = date('Y-m-d H:i:s', $fromDate);
     }
     $toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);
     if ($toDate !== null) {
         $toDate = date('Y-m-d H:i:s', $toDate);
     }
     $results =& ArticleSearch::retrieveResults($journal, $keywords, $fromDate, $toDate, $rangeInfo);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('results', $results);
     SearchHandler::assignAdvancedSearchParameters($templateMgr);
     $templateMgr->display('search/searchResults.tpl');
 }
コード例 #2
0
ファイル: SearchHandler.inc.php プロジェクト: ramonsodoma/ocs
 /**
  * Show advanced search results.
  */
 function advancedResults()
 {
     parent::validate();
     SearchHandler::setupTemplate(true);
     $rangeInfo = Handler::getRangeInfo('search');
     $publishedPaperDao =& DAORegistry::getDAO('PublishedPaperDAO');
     $searchConferenceId = Request::getUserVar('searchConference');
     if (!empty($searchConferenceId)) {
         $conferenceDao =& DAORegistry::getDAO('ConferenceDAO');
         $conference =& $conferenceDao->getConference($searchConferenceId);
         $yearRange = $publishedPaperDao->getPaperYearRange($conference->getId());
     } else {
         $conference =& Request::getConference();
         $yearRange = $publishedPaperDao->getPaperYearRange(null);
     }
     // Load the keywords array with submitted values
     $keywords = array(null => PaperSearch::parseQuery(Request::getUserVar('query')));
     $keywords[PAPER_SEARCH_AUTHOR] = PaperSearch::parseQuery(Request::getUserVar('author'));
     $keywords[PAPER_SEARCH_TITLE] = PaperSearch::parseQuery(Request::getUserVar('title'));
     $keywords[PAPER_SEARCH_DISCIPLINE] = PaperSearch::parseQuery(Request::getUserVar('discipline'));
     $keywords[PAPER_SEARCH_SUBJECT] = PaperSearch::parseQuery(Request::getUserVar('subject'));
     $keywords[PAPER_SEARCH_TYPE] = PaperSearch::parseQuery(Request::getUserVar('type'));
     $keywords[PAPER_SEARCH_COVERAGE] = PaperSearch::parseQuery(Request::getUserVar('coverage'));
     $keywords[PAPER_SEARCH_GALLEY_FILE] = PaperSearch::parseQuery(Request::getUserVar('fullText'));
     $keywords[PAPER_SEARCH_SUPPLEMENTARY_FILE] = PaperSearch::parseQuery(Request::getUserVar('supplementaryFiles'));
     $fromDate = Request::getUserDateVar('dateFrom', 1, 1);
     if ($fromDate !== null) {
         $fromDate = date('Y-m-d H:i:s', $fromDate);
     }
     $toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);
     if ($toDate !== null) {
         $toDate = date('Y-m-d H:i:s', $toDate);
     }
     $results =& PaperSearch::retrieveResults($conference, $keywords, $fromDate, $toDate, $rangeInfo);
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->setCacheability(CACHEABILITY_NO_STORE);
     $templateMgr->assign_by_ref('results', $results);
     SearchHandler::_assignAdvancedSearchParameters($templateMgr, $yearRange);
     $templateMgr->display('search/searchResults.tpl');
 }