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


PHP Title::getSubjectPage方法代码示例

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


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

示例1: getVariableValue


//.........这里部分代码省略.........
             break;
         case 'subpagenamee':
             $value = wfEscapeWikiText($this->mTitle->getSubpageUrlForm());
             break;
         case 'rootpagename':
             $value = wfEscapeWikiText($this->mTitle->getRootText());
             break;
         case 'rootpagenamee':
             $value = wfEscapeWikiText(wfUrlEncode(str_replace(' ', '_', $this->mTitle->getRootText())));
             break;
         case 'basepagename':
             $value = wfEscapeWikiText($this->mTitle->getBaseText());
             break;
         case 'basepagenamee':
             $value = wfEscapeWikiText(wfUrlEncode(str_replace(' ', '_', $this->mTitle->getBaseText())));
             break;
         case 'talkpagename':
             if ($this->mTitle->canTalk()) {
                 $talkPage = $this->mTitle->getTalkPage();
                 $value = wfEscapeWikiText($talkPage->getPrefixedText());
             } else {
                 $value = '';
             }
             break;
         case 'talkpagenamee':
             if ($this->mTitle->canTalk()) {
                 $talkPage = $this->mTitle->getTalkPage();
                 $value = wfEscapeWikiText($talkPage->getPrefixedURL());
             } else {
                 $value = '';
             }
             break;
         case 'subjectpagename':
             $subjPage = $this->mTitle->getSubjectPage();
             $value = wfEscapeWikiText($subjPage->getPrefixedText());
             break;
         case 'subjectpagenamee':
             $subjPage = $this->mTitle->getSubjectPage();
             $value = wfEscapeWikiText($subjPage->getPrefixedURL());
             break;
         case 'pageid':
             // requested in bug 23427
             $pageid = $this->getTitle()->getArticleID();
             if ($pageid == 0) {
                 # 0 means the page doesn't exist in the database,
                 # which means the user is previewing a new page.
                 # The vary-revision flag must be set, because the magic word
                 # will have a different value once the page is saved.
                 $this->mOutput->setFlag('vary-revision');
                 wfDebug(__METHOD__ . ": {{PAGEID}} used in a new page, setting vary-revision...\n");
             }
             $value = $pageid ? $pageid : null;
             break;
         case 'revisionid':
             # Let the edit saving system know we should parse the page
             # *after* a revision ID has been assigned.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONID}} used, setting vary-revision...\n");
             $value = $this->mRevisionId;
             break;
         case 'revisionday':
             # Let the edit saving system know we should parse the page
             # *after* a revision ID has been assigned. This is for null edits.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONDAY}} used, setting vary-revision...\n");
             $value = intval(substr($this->getRevisionTimestamp(), 6, 2));
开发者ID:Tarendai,项目名称:spring-website,代码行数:67,代码来源:Parser.php

示例2: moveSubpages

 /**
  * Move this page's subpages to be subpages of $nt
  *
  * @param Title $nt Move target
  * @param bool $auth Whether $wgUser's permissions should be checked
  * @param string $reason The reason for the move
  * @param bool $createRedirect Whether to create redirects from the old subpages to
  *     the new ones Ignored if the user doesn't have the 'suppressredirect' right
  * @return array Array with old page titles as keys, and strings (new page titles) or
  *     arrays (errors) as values, or an error array with numeric indices if no pages
  *     were moved
  */
 public function moveSubpages($nt, $auth = true, $reason = '', $createRedirect = true)
 {
     global $wgMaximumMovedPages;
     // Check permissions
     if (!$this->userCan('move-subpages')) {
         return array('cant-move-subpages');
     }
     // Do the source and target namespaces support subpages?
     if (!MWNamespace::hasSubpages($this->getNamespace())) {
         return array('namespace-nosubpages', MWNamespace::getCanonicalName($this->getNamespace()));
     }
     if (!MWNamespace::hasSubpages($nt->getNamespace())) {
         return array('namespace-nosubpages', MWNamespace::getCanonicalName($nt->getNamespace()));
     }
     $subpages = $this->getSubpages($wgMaximumMovedPages + 1);
     $retval = array();
     $count = 0;
     foreach ($subpages as $oldSubpage) {
         $count++;
         if ($count > $wgMaximumMovedPages) {
             $retval[$oldSubpage->getPrefixedText()] = array('movepage-max-pages', $wgMaximumMovedPages);
             break;
         }
         // We don't know whether this function was called before
         // or after moving the root page, so check both
         // $this and $nt
         if ($oldSubpage->getArticleID() == $this->getArticleID() || $oldSubpage->getArticleID() == $nt->getArticleID()) {
             // When moving a page to a subpage of itself,
             // don't move it twice
             continue;
         }
         $newPageName = preg_replace('#^' . preg_quote($this->getDBkey(), '#') . '#', StringUtils::escapeRegexReplacement($nt->getDBkey()), $oldSubpage->getDBkey());
         if ($oldSubpage->isTalkPage()) {
             $newNs = $nt->getTalkPage()->getNamespace();
         } else {
             $newNs = $nt->getSubjectPage()->getNamespace();
         }
         # Bug 14385: we need makeTitleSafe because the new page names may
         # be longer than 255 characters.
         $newSubpage = Title::makeTitleSafe($newNs, $newPageName);
         $success = $oldSubpage->moveTo($newSubpage, $auth, $reason, $createRedirect);
         if ($success === true) {
             $retval[$oldSubpage->getPrefixedText()] = $newSubpage->getPrefixedText();
         } else {
             $retval[$oldSubpage->getPrefixedText()] = $success;
         }
     }
     return $retval;
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:61,代码来源:Title.php

示例3: getVariableValue


//.........这里部分代码省略.........
             break;
         case 'fullpagenamee':
             $value = wfEscapeWikiText($this->mTitle->getPrefixedURL());
             break;
         case 'subpagename':
             $value = wfEscapeWikiText($this->mTitle->getSubpageText());
             break;
         case 'subpagenamee':
             $value = wfEscapeWikiText($this->mTitle->getSubpageUrlForm());
             break;
         case 'basepagename':
             $value = wfEscapeWikiText($this->mTitle->getBaseText());
             break;
         case 'basepagenamee':
             $value = wfEscapeWikiText(wfUrlEncode(str_replace(' ', '_', $this->mTitle->getBaseText())));
             break;
         case 'talkpagename':
             if ($this->mTitle->canTalk()) {
                 $talkPage = $this->mTitle->getTalkPage();
                 $value = wfEscapeWikiText($talkPage->getPrefixedText());
             } else {
                 $value = '';
             }
             break;
         case 'talkpagenamee':
             if ($this->mTitle->canTalk()) {
                 $talkPage = $this->mTitle->getTalkPage();
                 $value = wfEscapeWikiText($talkPage->getPrefixedUrl());
             } else {
                 $value = '';
             }
             break;
         case 'subjectpagename':
             $subjPage = $this->mTitle->getSubjectPage();
             $value = wfEscapeWikiText($subjPage->getPrefixedText());
             break;
         case 'subjectpagenamee':
             $subjPage = $this->mTitle->getSubjectPage();
             $value = wfEscapeWikiText($subjPage->getPrefixedUrl());
             break;
         case 'revisionid':
             # Let the edit saving system know we should parse the page
             # *after* a revision ID has been assigned.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONID}} used, setting vary-revision...\n");
             $value = $this->mRevisionId;
             break;
         case 'revisionday':
             # Let the edit saving system know we should parse the page
             # *after* a revision ID has been assigned. This is for null edits.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONDAY}} used, setting vary-revision...\n");
             $value = intval(substr($this->getRevisionTimestamp(), 6, 2));
             break;
         case 'revisionday2':
             # Let the edit saving system know we should parse the page
             # *after* a revision ID has been assigned. This is for null edits.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONDAY2}} used, setting vary-revision...\n");
             $value = substr($this->getRevisionTimestamp(), 6, 2);
             break;
         case 'revisionmonth':
             # Let the edit saving system know we should parse the page
             # *after* a revision ID has been assigned. This is for null edits.
             $this->mOutput->setFlag('vary-revision');
             wfDebug(__METHOD__ . ": {{REVISIONMONTH}} used, setting vary-revision...\n");
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:67,代码来源:Parser.php

示例4: duplicateEntries

 /**
  * Check if the given title already is watched by the user, and if so
  * add watches on a new title. To be used for page renames and such.
  *
  * @param Title $ot Page title to duplicate entries from, if present
  * @param Title $nt Page title to add watches on
  */
 public static function duplicateEntries($ot, $nt)
 {
     WatchedItem::doDuplicateEntries($ot->getSubjectPage(), $nt->getSubjectPage());
     WatchedItem::doDuplicateEntries($ot->getTalkPage(), $nt->getTalkPage());
 }
开发者ID:Acidburn0zzz,项目名称:mediawiki,代码行数:12,代码来源:WatchedItem.php

示例5: onArticleDelete

 /**
  * Clears caches when article is deleted
  *
  * @param Title $title
  */
 public static function onArticleDelete($title)
 {
     // Update existence markers on article/talk tabs...
     if ($title->isTalkPage()) {
         $other = $title->getSubjectPage();
     } else {
         $other = $title->getTalkPage();
     }
     $other->invalidateCache();
     $other->purgeSquid();
     $title->touchLinks();
     $title->purgeSquid();
     // File cache
     HTMLFileCache::clearFileCache($title);
     InfoAction::invalidateCache($title);
     // Messages
     if ($title->getNamespace() == NS_MEDIAWIKI) {
         MessageCache::singleton()->replace($title->getDBkey(), false);
     }
     // Images
     if ($title->getNamespace() == NS_FILE) {
         $update = new HTMLCacheUpdate($title, 'imagelinks');
         $update->doUpdate();
     }
     // User talk pages
     if ($title->getNamespace() == NS_USER_TALK) {
         $user = User::newFromName($title->getText(), false);
         if ($user) {
             $user->setNewtalk(false);
         }
     }
     // Image redirects
     RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect($title);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:39,代码来源:WikiPage.php

示例6: duplicateEntries

 /**
  * Check if the given title already is watched by the user, and if so
  * add watches on a new title. To be used for page renames and such.
  *
  * @param Title $ot Page title to duplicate entries from, if present
  * @param Title $nt Page title to add watches on
  * @static
  */
 function duplicateEntries($ot, $nt, $summary = null)
 {
     //WERELATE - add optional $summary parameter
     WatchedItem::doDuplicateEntries($ot->getSubjectPage(), $nt->getSubjectPage(), $summary);
     WatchedItem::doDuplicateEntries($ot->getTalkPage(), $nt->getTalkPage());
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:14,代码来源:WatchedItem.php

示例7: removeWatch

 /**
  * Stop watching an article.
  * @since 1.22 $checkRights parameter added
  * @param Title $title Title of the article to look at
  * @param bool $checkRights Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
  *     Pass User::CHECK_USER_RIGHTS or User::IGNORE_USER_RIGHTS.
  */
 public function removeWatch($title, $checkRights = self::CHECK_USER_RIGHTS)
 {
     if (!$checkRights || $this->isAllowed('editmywatchlist')) {
         $store = MediaWikiServices::getInstance()->getWatchedItemStore();
         $store->removeWatch($this, $title->getSubjectPage());
         $store->removeWatch($this, $title->getTalkPage());
     }
     $this->invalidateCache();
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:16,代码来源:User.php


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