當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WikiFactory::getFlags方法代碼示例

本文整理匯總了PHP中WikiFactory::getFlags方法的典型用法代碼示例。如果您正苦於以下問題:PHP WikiFactory::getFlags方法的具體用法?PHP WikiFactory::getFlags怎麽用?PHP WikiFactory::getFlags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WikiFactory的用法示例。


在下文中一共展示了WikiFactory::getFlags方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isFlagSet

 protected static function isFlagSet($wikiId = null, $flag = null)
 {
     if ($wikiId && $flag) {
         $flags = WikiFactory::getFlags($wikiId);
         if ($flags & $flag) {
             return true;
         }
     }
     return false;
 }
開發者ID:schwarer2006,項目名稱:wikia,代碼行數:10,代碼來源:AutomaticWikiAdoptionGatherData.php

示例2: doWikiForm


//.........這裏部分代碼省略.........
                         if ($wgRequest->getVal('wt-verify-site')) {
                             $this->doVerifyWithWebmasterTools();
                         } else {
                             if ($wgRequest->getVal('wt-add-verify-site')) {
                                 if ($this->doAddToWebmasterTools()) {
                                     $this->doVerifyWithWebmasterTools();
                                 }
                             }
                         }
                     }
                 }
                 break;
         }
         wfRunHooks('WikiFactory::onPostChangesApplied', array($this->mWiki->city_id));
     } else {
         /**
          * maybe some other action but with GET not POST
          */
         switch ($this->mTab) {
             case "tags":
                 $tag_id = $wgRequest->getVal("wpTagId", false);
                 if ($tag_id) {
                     $info = $this->doUpdateTags($wgRequest, $tag_id);
                 }
                 break;
             case "findtags":
                 if (!empty($this->mSearchTag)) {
                     $info = $this->doSearchTags($this->mSearchTag);
                 }
                 break;
         }
     }
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $vars = array("tab" => $this->mTab, "hub" => WikiFactoryHub::getInstance(), "wiki" => $this->mWiki, "tags" => $this->mTags->getTags(), "info" => $info, "title" => $this->mTitle, "groups" => WikiFactory::getGroups(), "cluster" => WikiFactory::getVarValueByName("wgDBcluster", $this->mWiki->city_id), "domains" => WikiFactory::getDomains($this->mWiki->city_id), "protected" => WikiFactory::getFlags($this->mWiki->city_id) & WikiFactory::FLAG_PROTECTED, "statuses" => $this->mStatuses, "variables" => WikiFactory::getVariables(), "variableName" => $this->mVariableName, "isDevel" => $wgDevelEnvironment, 'wikiFactoryUrl' => Title::makeTitle(NS_SPECIAL, 'WikiFactory')->getFullUrl(), 'wgStylePath' => $wgStylePath);
     if ($this->mTab === 'info') {
         $vars['founder_id'] = $this->mWiki->city_founding_user;
         #this is the static stored email
         $vars['founder_email'] = $this->mWiki->city_founding_email;
         if (!empty($this->mWiki->city_founding_user)) {
             #if we knew who they were, get their current info
             $fu = User::newFromId($this->mWiki->city_founding_user);
             $vars['founder_username'] = $fu->getName();
             $vars['founder_usermail'] = $fu->getEmail();
             $vars['founder_metrics_url'] = $vars['wikiFactoryUrl'] . "/Metrics?founder=" . rawurlencode($fu->getName());
             $vars['founder_usermail_metrics_url'] = $vars['wikiFactoryUrl'] . "/Metrics?email=" . urlencode($vars['founder_usermail']);
             $vars['founder_email_metrics_url'] = $vars['wikiFactoryUrl'] . "/Metrics?email=" . urlencode($vars['founder_email']);
         } else {
             #dont know who made the wiki, so dont try to do lookups
             $vars['founder_username'] = null;
             $vars['founder_usermail'] = null;
         }
         if ($wgUser->isAllowed('lookupuser')) {
             $vars['lookupuser_by_founder_email_url'] = Title::newFromText("LookupUser", NS_SPECIAL)->getFullURL(array("target" => $vars['founder_email']));
             if (!empty($vars['founder_username'])) {
                 $vars['lookupuser_by_founder_username_url'] = Title::newFromText("LookupUser", NS_SPECIAL)->getFullURL(array("target" => $vars['founder_username']));
             }
             if (!empty($vars['founder_usermail'])) {
                 $vars['lookupuser_by_founder_usermail_url'] = Title::newFromText("LookupUser", NS_SPECIAL)->getFullURL(array("target" => $vars['founder_usermail']));
             }
         }
     }
     if ($this->mTab === "tags" || $this->mTab === "findtags") {
         $vars['searchTag'] = $this->mSearchTag;
         $vars['searchTagWikiIds'] = $this->mTagWikiIds;
     }
     if ($this->mTab === "hubs") {
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:67,代碼來源:SpecialWikiFactory_body.php


注:本文中的WikiFactory::getFlags方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。