當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。