本文整理汇总了PHP中ArticleSearch::getResultSetOrderingOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP ArticleSearch::getResultSetOrderingOptions方法的具体用法?PHP ArticleSearch::getResultSetOrderingOptions怎么用?PHP ArticleSearch::getResultSetOrderingOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArticleSearch
的用法示例。
在下文中一共展示了ArticleSearch::getResultSetOrderingOptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
/**
* Show the search form
* @param $args array
* @param $request PKPRequest
*/
function search($args, $request)
{
$this->validate(null, $request);
// Get and transform active filters.
$articleSearch = new ArticleSearch();
$searchFilters = $articleSearch->getSearchFilters($request);
$keywords = $articleSearch->getKeywordsFromSearchFilters($searchFilters);
// Get the range info.
$rangeInfo = $this->getRangeInfo($request, 'search');
// Retrieve results.
$error = '';
$results = $articleSearch->retrieveResults($request, $searchFilters['searchJournal'], $keywords, $error, $searchFilters['fromDate'], $searchFilters['toDate'], $rangeInfo);
// Prepare and display the search template.
$this->setupTemplate($request);
$templateMgr = TemplateManager::getManager($request);
$templateMgr->setCacheability(CACHEABILITY_NO_STORE);
// Result set ordering options.
$orderByOptions = $articleSearch->getResultSetOrderingOptions($request);
$templateMgr->assign('searchResultOrderOptions', $orderByOptions);
$orderDirOptions = $articleSearch->getResultSetOrderingDirectionOptions();
$templateMgr->assign('searchResultOrderDirOptions', $orderDirOptions);
// Result set ordering selection.
list($orderBy, $orderDir) = $articleSearch->getResultSetOrdering($request);
$templateMgr->assign('orderBy', $orderBy);
$templateMgr->assign('orderDir', $orderDir);
// Similar documents.
$templateMgr->assign('simDocsEnabled', true);
// Result set display.
$templateMgr->assign('jsLocaleKeys', array('search.noKeywordError'));
$this->_assignSearchFilters($request, $templateMgr, $searchFilters);
$templateMgr->assign('results', $results);
$templateMgr->assign('error', $error);
$templateMgr->display('search/search.tpl');
}