Show
Ignore:
Timestamp:
2008-04-16 09:25:55 (5 months ago)
Author:
wwalc
Message:

Fix for #1385 and #1174 - HTML/WikiText mess on conflict/preview

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • MediaWiki/trunk/FCKeditorEditPage.body.php

    r1666 r1929  
    2929                } 
    3030        } 
    31          
     31 
    3232        function getPreviewText() { 
    3333                if (!$this->isCssJsSubpage) { 
     
    4141                return $result; 
    4242        } 
     43 
     44        function getContent( $def_text = '' ) { 
     45                $t = parent::getContent( $def_text ); 
     46                if(!$this->isConflict) { 
     47                        return $t; 
     48                } 
     49                $options = new FCKeditorParserOptions(); 
     50                $options->setTidy(true); 
     51                $parser = new FCKeditorParser(); 
     52                $parser->setOutputType(OT_HTML); 
     53                $pa = $parser->parse($t, $this->mTitle, $options); 
     54                return $pa->mText; 
     55 
     56        } 
     57 
     58        function getWikiContent(){ 
     59                return $this->mArticle->getContent(); 
     60        } 
     61 
     62        /** 
     63         * This is a hack to fix 
     64         * http://dev.fckeditor.net/ticket/1174 
     65         * If RTE is enabled, diff must be performed on WikiText, not on HTML 
     66         */ 
     67        function showDiff() { 
     68                global $wgFCKWikiTextBeforeParse; 
     69                if (isset($wgFCKWikiTextBeforeParse)) { 
     70                        $_textbox1 = $this->textbox1; 
     71                        $this->textbox1 = $wgFCKWikiTextBeforeParse; 
     72                } 
     73                        $result = parent::showDiff(); 
     74                if (isset($wgFCKWikiTextBeforeParse)) { 
     75                        $this->textbox1 = $_textbox1; 
     76                } 
     77        } 
    4378}