本文整理汇总了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);
}
}
示例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);
}
示例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);
}
}