当前位置: 首页>>代码示例>>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;未经允许,请勿转载。