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


PHP SearchEngine::projectNamespaces方法代码示例

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


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

示例1: formHeader

 protected function formHeader($term)
 {
     global $wgContLang, $wgCanonicalNamespaceNames;
     $sep = '   ';
     $out = Xml::openElement('div', array('style' => 'padding-bottom:0.5em;'));
     $bareterm = $term;
     if ($this->startsWithImage($term)) {
         $bareterm = substr($term, strpos($term, ':') + 1);
     }
     // delete all/image prefix
     $nsAllSet = array_keys(SearchEngine::searchableNamespaces());
     // search profiles headers
     $m = wfMsg('searchprofile-articles');
     $tt = wfMsg('searchprofile-articles-tooltip', implode(', ', SearchEngine::namespacesAsText(SearchEngine::defaultNamespaces())));
     if ($this->active == 'default') {
         $out .= Xml::element('strong', array('title' => $tt), $m);
     } else {
         $out .= $this->makeSearchLink($bareterm, SearchEngine::defaultNamespaces(), $m, $tt);
     }
     $out .= $sep;
     $m = wfMsg('searchprofile-images');
     $tt = wfMsg('searchprofile-images-tooltip');
     if ($this->active == 'images') {
         $out .= Xml::element('strong', array('title' => $tt), $m);
     } else {
         $imageTextForm = $wgContLang->getFormattedNsText(NS_FILE) . ':' . $bareterm;
         $out .= $this->makeSearchLink($imageTextForm, array(NS_FILE), $m, $tt);
     }
     $out .= $sep;
     /*
     $m = wfMsg( 'searchprofile-articles-and-proj' );
     $tt = wfMsg( 'searchprofile-project-tooltip', 
     	implode( ', ', SearchEngine::namespacesAsText( SearchEngine::defaultAndProjectNamespaces() ) ) );
     if( $this->active == 'withproject' ) {
     	$out .= Xml::element( 'strong', array( 'title'=>$tt ), $m );	
     } else {
     	$out .= $this->makeSearchLink( $bareterm, SearchEngine::defaultAndProjectNamespaces(), $m, $tt );
     }
     $out .= $sep;
     */
     $m = wfMsg('searchprofile-project');
     $tt = wfMsg('searchprofile-project-tooltip', implode(', ', SearchEngine::namespacesAsText(SearchEngine::projectNamespaces())));
     if ($this->active == 'project') {
         $out .= Xml::element('strong', array('title' => $tt), $m);
     } else {
         $out .= $this->makeSearchLink($bareterm, SearchEngine::projectNamespaces(), $m, $tt);
     }
     $out .= $sep;
     $m = wfMsg('searchprofile-everything');
     $tt = wfMsg('searchprofile-everything-tooltip');
     if ($this->active == 'all') {
         $out .= Xml::element('strong', array('title' => $tt), $m);
     } else {
         $out .= $this->makeSearchLink($bareterm, $nsAllSet, $m, $tt);
     }
     $out .= $sep;
     $m = wfMsg('searchprofile-advanced');
     $tt = wfMsg('searchprofile-advanced-tooltip');
     if ($this->active == 'advanced') {
         $out .= Xml::element('strong', array('title' => $tt), $m);
     } else {
         $out .= $this->makeSearchLink($bareterm, $this->namespaces, $m, $tt, array('advanced' => '1'));
     }
     $out .= Xml::closeElement('div');
     return $out;
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:66,代码来源:SpecialSearch.php


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