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


PHP WikiPage::doViewUpdates方法代碼示例

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


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

示例1: showDiffPage

 /**
  * Show a diff page according to current request variables. For use within
  * Article::view() only, other callers should use the DifferenceEngine class.
  *
  * @todo: make protected
  */
 public function showDiffPage()
 {
     $request = $this->getContext()->getRequest();
     $user = $this->getContext()->getUser();
     $diff = $request->getVal('diff');
     $rcid = $request->getVal('rcid');
     $diffOnly = $request->getBool('diffonly', $user->getOption('diffonly'));
     $purge = $request->getVal('action') == 'purge';
     $unhide = $request->getInt('unhide') == 1;
     $oldid = $this->getOldID();
     $rev = $this->getRevisionFetched();
     if (!$rev) {
         $this->getContext()->getOutput()->setPageTitle(wfMessage('errorpagetitle'));
         $this->getContext()->getOutput()->addWikiMsg('difference-missing-revision', $oldid, 1);
         return;
     }
     $contentHandler = $rev->getContentHandler();
     $de = $contentHandler->createDifferenceEngine($this->getContext(), $oldid, $diff, $rcid, $purge, $unhide);
     // DifferenceEngine directly fetched the revision:
     $this->mRevIdFetched = $de->mNewid;
     $de->showDiffPage($diffOnly);
     if ($diff == 0 || $diff == $this->mPage->getLatest()) {
         # Run view updates for current revision only
         $this->mPage->doViewUpdates($user);
     }
 }
開發者ID:nischayn22,項目名稱:mediawiki-core,代碼行數:32,代碼來源:Article.php

示例2: showDiffPage

 /**
  * Show a diff page according to current request variables. For use within
  * Article::view() only, other callers should use the DifferenceEngine class.
  *
  * @todo Make protected
  */
 public function showDiffPage()
 {
     $request = $this->getContext()->getRequest();
     $user = $this->getContext()->getUser();
     $diff = $request->getVal('diff');
     $rcid = $request->getVal('rcid');
     $diffOnly = $request->getBool('diffonly', $user->getOption('diffonly'));
     $purge = $request->getVal('action') == 'purge';
     $unhide = $request->getInt('unhide') == 1;
     $oldid = $this->getOldID();
     $rev = $this->getRevisionFetched();
     if (!$rev) {
         $this->getContext()->getOutput()->setPageTitle(wfMessage('errorpagetitle'));
         $this->getContext()->getOutput()->addWikiMsg('difference-missing-revision', $oldid, 1);
         return;
     }
     $contentHandler = $rev->getContentHandler();
     $de = $contentHandler->createDifferenceEngine($this->getContext(), $oldid, $diff, $rcid, $purge, $unhide);
     // DifferenceEngine directly fetched the revision:
     $this->mRevIdFetched = $de->mNewid;
     $de->showDiffPage($diffOnly);
     // Run view updates for the newer revision being diffed (and shown
     // below the diff if not $diffOnly).
     list($old, $new) = $de->mapDiffPrevNext($oldid, $diff);
     // New can be false, convert it to 0 - this conveniently means the latest revision
     $this->mPage->doViewUpdates($user, (int) $new);
 }
開發者ID:spring,項目名稱:spring-website,代碼行數:33,代碼來源:Article.php

示例3: showDiffPage

 /**
  * Show a diff page according to current request variables. For use within
  * Article::view() only, other callers should use the DifferenceEngine class.
  */
 public function showDiffPage()
 {
     global $wgRequest, $wgUser;
     $diff = $wgRequest->getVal('diff');
     $rcid = $wgRequest->getVal('rcid');
     $diffOnly = $wgRequest->getBool('diffonly', $wgUser->getGlobalPreference('diffonly'));
     $purge = $wgRequest->getVal('action') == 'purge';
     $unhide = $wgRequest->getInt('unhide') == 1;
     $oldid = $this->getOldID();
     $de = new DifferenceEngine($this->getContext(), $oldid, $diff, $rcid, $purge, $unhide);
     // DifferenceEngine directly fetched the revision:
     $this->mRevIdFetched = $de->mNewid;
     $de->showDiffPage($diffOnly);
     if ($diff == 0 || $diff == $this->mPage->getLatest()) {
         # Run view updates for current revision only
         $this->mPage->doViewUpdates($wgUser);
     }
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:22,代碼來源:Article.php


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