当前位置: 首页>>代码示例>>PHP>>正文


PHP SearchForm::readQueryParms方法代码示例

本文整理汇总了PHP中SearchForm::readQueryParms方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchForm::readQueryParms方法的具体用法?PHP SearchForm::readQueryParms怎么用?PHP SearchForm::readQueryParms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SearchForm的用法示例。


在下文中一共展示了SearchForm::readQueryParms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: wfSpecialSearch

/**
 * Called to display the Special:Search page
 *
 * @param unknown_type $par
 * @param unknown_type $specialPage
 */
function wfSpecialSearch($par = NULL, $specialPage)
{
    global $wgOut, $wgRequest, $wgScriptPath, $wrSidebarHtml;
    $searchForm = new SearchForm();
    // read query parameters into variables
    $searchForm->readQueryParms($par);
    // check if we should redirect to a specific page
    $redirTitle = $searchForm->getRedirTitle();
    if ($redirTitle) {
        $wgOut->redirect($redirTitle->getFullURL());
        return;
    }
    $wgOut->setPageTitle($searchForm->target ? 'Search for possible matches' : 'Search WeRelate');
    $wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgScriptPath}/search.31.js\"></script>");
    $wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgScriptPath}/autocomplete.10.js\"></script>");
    // construct query to send to server
    $errMsg = $searchForm->validateQuery();
    $searchServerQuery = '';
    if (!$errMsg) {
        $searchServerQuery = $searchForm->getSearchServerQuery($par);
    }
    $formHtml = $searchForm->getFormHtml();
    if ($searchServerQuery || $errMsg) {
        if ($errMsg) {
            $sideText = '';
            $errMsg = htmlspecialchars($errMsg);
            $results = "<p><font color=\"red\">{$errMsg}</font></p>";
        } else {
            list($sideText, $results) = $searchForm->getSearchResultsHtml($searchServerQuery);
        }
        $wrSidebarHtml = "<div id=\"wr-search-sidebar\">{$sideText}</div>";
        $wgOut->addHTML(<<<END
<p>{$formHtml}</p>
{$results}
END
);
    } else {
        $sideText = $searchForm->getStatsHtml();
        $endText = wfMsgWikiHtml('searchend');
        $wrSidebarHtml = "<div id=\"wr-search-sidebar\">{$sideText}</div>";
        $wgOut->addHTML(<<<END
<p>{$formHtml}</p><p> </p>
{$endText}
END
);
    }
}
开发者ID:k-hasan-19,项目名称:wiki,代码行数:53,代码来源:SpecialSearch.php


注:本文中的SearchForm::readQueryParms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。