本文整理汇总了PHP中EditPage::showDiff方法的典型用法代码示例。如果您正苦于以下问题:PHP EditPage::showDiff方法的具体用法?PHP EditPage::showDiff怎么用?PHP EditPage::showDiff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EditPage
的用法示例。
在下文中一共展示了EditPage::showDiff方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDiff
public function getDiff($wikitext, $section = '')
{
wfProfileIn(__METHOD__);
$section = intval($section);
// create "fake" EditPage
if (function_exists('CategorySelectInitializeHooks')) {
CategorySelectInitializeHooks(null, null, $this->mTitle, null, null, null, true);
}
$article = new Article($this->mTitle);
$editPage = new EditPage($article);
$editPage->textbox1 = $wikitext;
$editPage->edittime = null;
$editPage->section = $section > 0 ? $section : '';
// render diff HTML to $wgOut
$out = $this->app->getGlobal('wgOut');
$oldHtml = $out->getHTML();
$out->clearHTML();
$editPage->showDiff();
$diff = $out->getHTML();
// restore state of output
$out->clearHTML();
$out->addHTML($oldHtml);
wfProfileOut(__METHOD__);
return $diff;
}
示例2: showDiff
/**
* This is a hack to fix
* http://dev.fckeditor.net/ticket/1174
* If RTE is enabled, diff must be performed on WikiText, not on HTML
*/
function showDiff()
{
global $wgFCKWikiTextBeforeParse;
if (isset($wgFCKWikiTextBeforeParse)) {
$_textbox1 = $this->textbox1;
$this->textbox1 = $wgFCKWikiTextBeforeParse;
}
$result = parent::showDiff();
if (isset($wgFCKWikiTextBeforeParse)) {
$this->textbox1 = $_textbox1;
}
}
示例3: getDiff
public function getDiff($wikitext, $section = '')
{
wfProfileIn(__METHOD__);
$section = intval($section);
$article = new Article($this->mTitle);
// create "fake" EditPage
$editPage = new EditPage($article);
// rtrim is a fix for https://wikia-inc.atlassian.net/browse/MAIN-152
// To understand better look at "$this->textbox1 = $this->safeUnicodeInput( $request, 'wpTextbox1' );" in EditPage.php
$editPage->textbox1 = rtrim($wikitext);
$editPage->edittime = null;
$editPage->section = $section > 0 ? $section : '';
// render diff HTML to $wgOut
$out = $this->app->getGlobal('wgOut');
$oldHtml = $out->getHTML();
$out->clearHTML();
$editPage->showDiff();
$diff = $out->getHTML();
// restore state of output
$out->clearHTML();
$out->addHTML($oldHtml);
wfProfileOut(__METHOD__);
return $diff;
}