+
+ /**
+ * Get a diff between the current contents of the edit box and the
+ * version of the page we're editing from.
+ *
+ * If this is a section edit, we'll replace the section as for final
+ * save and then make a comparison.
+ *
+ * @return string HTML
+ */
+ function getDiff() {
+ require_once( 'DifferenceEngine.php' );
+ $oldtext = $this->mArticle->fetchContent();
+ $newtext = $this->mArticle->getTextOfLastEditWithSectionReplacedOrAdded(
+ $this->section, $this->textbox1, $this->summary, $this->edittime );
+ $oldtitle = wfMsg( 'currentrev' );
+ $newtitle = wfMsg( 'yourtext' );
+ if ( $oldtext != wfMsg( 'noarticletext' ) || $newtext != '' ) {
+ $difftext = DifferenceEngine::getDiff( $oldtext, $newtext, $oldtitle, $newtitle );
+ }
+
+ return '<div id="wikiDiff">' . $difftext . '</div>';
+ }
+