| | 48 | function getContent( $def_text = '' ) { |
| | 49 | $t = parent::getContent( $def_text ); |
| | 50 | if(!$this->isConflict) return $t; |
| | 51 | $options = new FCKeditorParserOptions(); |
| | 52 | $options->setTidy(true); |
| | 53 | $parser = new FCKeditorParser(); |
| | 54 | $parser->setOutputType(OT_HTML); |
| | 55 | $pa = $parser->parse($t, $this->mTitle, $options); |
| | 56 | return $pa->mText; |
| | 57 | |
| | 58 | } |
| | 59 | function getWikiContent(){ |
| | 60 | return $this->mArticle->getContent(); |
| | 61 | } |
| | 62 | function showDiff(){ |
| | 63 | global $wgRequest; |
| | 64 | |
| | 65 | $oldtext = $this->mArticle->fetchContent(); |
| | 66 | $newtext = $wgRequest->getVal( 'wpTextbox1' ); |
| | 67 | |
| | 68 | if($newtext == null) { |
| | 69 | $rev_id = $wgRequest->getVal( 'undoafter' ); |
| | 70 | if($rev_id != null){ |
| | 71 | $revision = Revision::newFromId( $rev_id ); |
| | 72 | $newtext = $revision->getText(); |
| | 73 | } |
| | 74 | else { |
| | 75 | return parent::showDiff(); |
| | 76 | } |
| | 77 | |
| | 78 | } |
| | 79 | $oldtitle = wfMsgExt( 'currentrev', array('parseinline') ); |
| | 80 | $newtitle = wfMsgExt( 'yourtext', array('parseinline') ); |
| | 81 | |
| | 82 | if ( $oldtext !== false || $newtext != '' ) { |
| | 83 | $de = new DifferenceEngine( $this->mTitle ); |
| | 84 | $de->setText( $oldtext, $newtext ); |
| | 85 | $difftext = $de->getDiff( $oldtitle, $newtitle ); |
| | 86 | $de->showDiffStyle(); |
| | 87 | } else { |
| | 88 | $difftext = ''; |
| | 89 | } |
| | 90 | |
| | 91 | global $wgOut; |
| | 92 | $wgOut->addHtml( '<div id="wikiDiff">' . $difftext . '</div>' ); |
| | 93 | } |