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


PHP Skin::setContext方法代码示例

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


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

示例1: getSkin

 /**
  * Get the Skin object
  *
  * @return Skin
  */
 public function getSkin()
 {
     if ($this->skin === null) {
         wfProfileIn(__METHOD__ . '-createskin');
         $skin = null;
         wfRunHooks('RequestContextCreateSkin', array($this, &$skin));
         // If the hook worked try to set a skin from it
         if ($skin instanceof Skin) {
             $this->skin = $skin;
         } elseif (is_string($skin)) {
             $this->skin = Skin::newFromKey($skin);
         }
         // If this is still null (the hook didn't run or didn't work)
         // then go through the normal processing to load a skin
         if ($this->skin === null) {
             global $wgHiddenPrefs;
             if (!in_array('skin', $wgHiddenPrefs)) {
                 # get the user skin
                 $userSkin = $this->getUser()->getOption('skin');
                 $userSkin = $this->getRequest()->getVal('useskin', $userSkin);
             } else {
                 # if we're not allowing users to override, then use the default
                 global $wgDefaultSkin;
                 $userSkin = $wgDefaultSkin;
             }
             $this->skin = Skin::newFromKey($userSkin);
         }
         // After all that set a context on whatever skin got created
         $this->skin->setContext($this);
         wfProfileOut(__METHOD__ . '-createskin');
     }
     return $this->skin;
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:38,代码来源:RequestContext.php

示例2: getSkin

 /**
  * Get the Skin object
  *
  * @return Skin
  */
 public function getSkin()
 {
     if ($this->skin === null) {
         wfProfileIn(__METHOD__ . '-createskin');
         $skin = null;
         wfRunHooks('RequestContextCreateSkin', array($this, &$skin));
         $factory = SkinFactory::getDefaultInstance();
         // If the hook worked try to set a skin from it
         if ($skin instanceof Skin) {
             $this->skin = $skin;
         } elseif (is_string($skin)) {
             // Normalize the key, just in case the hook did something weird.
             $normalized = Skin::normalizeKey($skin);
             $this->skin = $factory->makeSkin($normalized);
         }
         // If this is still null (the hook didn't run or didn't work)
         // then go through the normal processing to load a skin
         if ($this->skin === null) {
             if (!in_array('skin', $this->getConfig()->get('HiddenPrefs'))) {
                 # get the user skin
                 $userSkin = $this->getUser()->getOption('skin');
                 $userSkin = $this->getRequest()->getVal('useskin', $userSkin);
             } else {
                 # if we're not allowing users to override, then use the default
                 $userSkin = $this->getConfig()->get('DefaultSkin');
             }
             // Normalize the key in case the user is passing gibberish
             // or has old preferences (bug 69566).
             $normalized = Skin::normalizeKey($userSkin);
             // Skin::normalizeKey will also validate it, so
             // this won't throw an exception
             $this->skin = $factory->makeSkin($normalized);
         }
         // After all that set a context on whatever skin got created
         $this->skin->setContext($this);
         wfProfileOut(__METHOD__ . '-createskin');
     }
     return $this->skin;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:44,代码来源:RequestContext.php

示例3: setSkin

 /**
  * Set the Skin object
  *
  * @param Skin $s
  */
 public function setSkin(Skin $s)
 {
     $this->skin = clone $s;
     $this->skin->setContext($this);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:10,代码来源:DerivativeContext.php

示例4: getSkin

 /**
  * Get the Skin object
  *
  * @return Skin
  */
 public function getSkin()
 {
     if ($this->skin === null) {
         wfProfileIn(__METHOD__ . '-createskin');
         global $wgHiddenPrefs;
         if (!in_array('skin', $wgHiddenPrefs)) {
             # get the user skin
             $userSkin = $this->getUser()->getOption('skin');
             $userSkin = $this->getRequest()->getVal('useskin', $userSkin);
         } else {
             # if we're not allowing users to override, then use the default
             global $wgDefaultSkin;
             $userSkin = $wgDefaultSkin;
         }
         $this->skin = Skin::newFromKey($userSkin);
         $this->skin->setContext($this);
         wfProfileOut(__METHOD__ . '-createskin');
     }
     return $this->skin;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:25,代码来源:RequestContext.php


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