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


PHP EditPage::showDiff方法代码示例

本文整理汇总了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;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:25,代码来源:EditPageService.class.php

示例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;
     }
 }
开发者ID:AbedSHP,项目名称:WYSIWYG-CKeditor,代码行数:17,代码来源:CKeditorEditPage.body.php

示例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;
 }
开发者ID:yusufchang,项目名称:app,代码行数:24,代码来源:EditPageService.class.php


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