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


PHP IContextSource::getSkin方法代码示例

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


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

示例1: addNavigationLinks

 public static function addNavigationLinks(IContextSource $context, $pageType)
 {
     $linkDefs = array('home' => 'Special:AbuseFilter', 'recentchanges' => 'Special:AbuseFilter/history', 'test' => 'Special:AbuseFilter/test', 'examine' => 'Special:AbuseFilter/examine', 'log' => 'Special:AbuseLog');
     if ($context->getUser()->isAllowed('abusefilter-modify')) {
         $linkDefs = array_merge($linkDefs, array('tools' => 'Special:AbuseFilter/tools', 'import' => 'Special:AbuseFilter/import'));
     }
     // Save some translator work
     $msgOverrides = array('recentchanges' => 'abusefilter-filter-log');
     $links = array();
     foreach ($linkDefs as $name => $page) {
         // Give grep a chance to find the usages:
         // abusefilter-topnav-home, abusefilter-topnav-test, abusefilter-topnav-examine
         // abusefilter-topnav-log, abusefilter-topnav-tools, abusefilter-topnav-import
         $msgName = "abusefilter-topnav-{$name}";
         if (isset($msgOverrides[$name])) {
             $msgName = $msgOverrides[$name];
         }
         $msg = wfMsgExt($msgName, 'parseinline');
         $title = Title::newFromText($page);
         if ($name == $pageType) {
             $links[] = Xml::tags('strong', null, $msg);
         } else {
             $links[] = $context->getSkin()->link($title, $msg);
         }
     }
     $linkStr = wfMsg('parentheses', $context->getLanguage()->pipeList($links));
     $linkStr = wfMsgExt('abusefilter-topnav', 'parseinline') . " {$linkStr}";
     $linkStr = Xml::tags('div', array('class' => 'mw-abusefilter-navigation'), $linkStr);
     $context->getOutput()->setSubtitle($linkStr);
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:30,代码来源:AbuseFilter.class.php

示例2: newFromContext

	/**
	 * Fetch an appropriate changes list class for the specified context
	 * Some users might want to use an enhanced list format, for instance
	 *
	 * @param $context IContextSource to use
	 * @return ChangesList|EnhancedChangesList|OldChangesList derivative
	 */
	public static function newFromContext( IContextSource $context ) {
		$user = $context->getUser();
		$sk = $context->getSkin();
		$list = null;
		if ( wfRunHooks( 'FetchChangesList', array( $user, &$sk, &$list ) ) ) {
			$new = $context->getRequest()->getBool( 'enhanced', $user->getOption( 'usenewrc' ) );
			return $new ? new EnhancedChangesList( $context ) : new OldChangesList( $context );
		} else {
			return $list;
		}
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:18,代码来源:ChangesList.php

示例3: trim

 function __construct(IContextSource $context, $templatetext, $argv, $parser)
 {
     global $wgContLang;
     $this->title = $context->getTitle();
     $this->skin = $context->getSkin();
     $this->parser = $parser;
     $this->templatetext = $templatetext;
     if (!is_null($this->templatetext)) {
         $this->templatetext = trim($this->templatetext);
         if ($this->templatetext == '') {
             $this->templatetext = null;
         }
     }
     $this->usetemplate = !is_null($this->templatetext);
     $this->templateparser = null;
     $this->templateoptions = null;
     #$template = @$argv['template'];
     #if ( $this->usetemplate ) {
     #print "<pre>$templatetitle</pre>";
     $this->templateparser = $parser;
     #$this->templateparser = clone $parser;
     #$this->templateparser->setOutputType( Parser::OT_HTML );
     $this->templateoptions = new ParserOptions();
     $this->templateoptions->setEditSection(false);
     $this->templateoptions->setNumberHeadings(false);
     $this->templateoptions->setRemoveComments(true);
     //$this->templateoptions->setUseDynamicDates( false ); // removed in mw 1.21
     $this->templateoptions->setInterwikiMagic(true);
     //strip interlanguage-links
     $this->templateoptions->setAllowSpecialInclusion(false);
     #$this->templatetitle = Title::newFromText( $template, NS_TEMPLATE );
     #$templatetext = $templateparser->fetchTemplate( $templatetitle );
     #print "<pre>$templatetext</pre>";
     #$templateoptions->setRemoveComments( true );
     #$templateoptions->setMaxIncludeSize( self::MAX_INCLUDE_SIZE );
     #}
     if (!$this->usetemplate) {
         $this->changelist = new OldChangesList($this->skin);
     }
     #$this->feedId = @$argv['id'];
     $this->prefix = @$argv['prefix'];
     $this->postfix = @$argv['postfix'];
     $this->limit = @$argv['limit'];
     if (!$this->limit) {
         $this->limit = 10;
     } elseif ($this->limit > 100) {
         $this->limit = 100;
     }
     $this->unique = @$argv['unique'];
     if ($this->unique === 'false' || $this->unique === 'no' || $this->unique === '0') {
         $this->unique = false;
     }
     $this->namespaces = @$argv['namespaces'];
     if (!is_null($this->namespaces)) {
         $this->namespaces = preg_split('!\\s*(\\|\\s*)+!', trim($this->namespaces));
         foreach ($this->namespaces as $i => $ns) {
             $ns = $wgContLang->lc($ns);
             if ($ns === '-' || $ns === '0' || $ns === 'main' || $ns === 'article') {
                 $this->namespaces[$i] = 0;
             } else {
                 $this->namespaces[$i] = MWNamespace::getCanonicalIndex($ns);
                 if ($this->namespaces[$i] === false || $this->namespaces[$i] === null) {
                     $this->namespaces[$i] = $wgContLang->getNsIndex($ns);
                 }
             }
             if ($this->namespaces[$i] === false || $this->namespaces[$i] === null) {
                 unset($this->namespaces[$i]);
             }
         }
     }
     $this->categories = @$argv['categories'];
     if (!is_null($this->categories)) {
         $this->categories = preg_split('!\\s*(\\|\\s*)+!', trim($this->categories));
         foreach ($this->categories as $i => $n) {
             $t = Title::makeTitleSafe(NS_CATEGORY, $n);
             $n = $t->getDBkey();
             $this->categories[$i] = $n;
         }
     }
     $this->pubtrigger = @$argv['trigger'];
     if ($this->pubtrigger) {
         $this->publication = true;
     } else {
         $this->publication = false;
     }
     $this->permalinks = @$argv['permalinks'];
     if ($this->permalinks === 'false' || $this->permalinks === 'no' || $this->permalinks === '0') {
         $this->permalinks = false;
     }
     $this->nominor = @$argv['nominor'];
     if ($this->nominor === 'false' || $this->nominor === 'no' || $this->nominor === '0') {
         $this->nominor = false;
     }
     $this->nobot = @$argv['nobot'];
     if ($this->nobot === 'false' || $this->nobot === 'no' || $this->nobot === '0') {
         $this->nobot = false;
     }
     $this->noanon = @$argv['noanon'];
     if ($this->noanon === 'false' || $this->noanon === 'no' || $this->noanon === '0') {
         $this->noanon = false;
//.........这里部分代码省略.........
开发者ID:andreascian,项目名称:News,代码行数:101,代码来源:NewsRenderer.php


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