本文整理汇总了PHP中SearchHandler::assignAdvancedSearchParameters方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchHandler::assignAdvancedSearchParameters方法的具体用法?PHP SearchHandler::assignAdvancedSearchParameters怎么用?PHP SearchHandler::assignAdvancedSearchParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchHandler
的用法示例。
在下文中一共展示了SearchHandler::assignAdvancedSearchParameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: advancedResults
/**
* 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: advancedResults
/**
* 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');
}