function getContent($def_text = '')
 {
     $t = parent::getContent($def_text);
     if (!$this->isConflict) {
         return $t;
     }
     $options = new CKeditorParserOptions();
     $options->setTidy(true);
     $parser = new CKeditorParser();
     $parser->setOutputType(OT_HTML);
     $pa = $parser->parse($t, $this->mTitle, $options);
     return $pa->mText;
 }
Beispiel #2
0
 /**
  * Perform "reverse" parsing of HTML to wikitext when saving / doing preview from wysiwyg mode
  *
  * @param EditPage $form
  */
 public static function reverse($form, $out = null)
 {
     global $wgRequest;
     wfProfileIn(__METHOD__);
     if ($wgRequest->wasPosted()) {
         if ($wgRequest->getVal('RTEMode') == 'wysiwyg') {
             RTE::log('performing reverse parsing back to wikitext');
             if ($out == null) {
                 $wikitext = RTE::HtmlToWikitext($wgRequest->getText('wpTextbox1'));
                 $wgRequest->setVal('wpTextbox1', $wikitext);
             } else {
                 $form->textbox1 = $form->getContent();
             }
         }
     }
     wfProfileOut(__METHOD__);
     return true;
 }
 /**
  * Add items to loaded content
  */
 function getContent($def_text = '')
 {
     $content = parent::getContent();
     $addFile = $this->app->getGlobal('wgRequest')->getVal('addFile');
     if ($addFile) {
         $file = wfFindFile($addFile);
         if ($file) {
             $title = $file->getTitle()->getText();
             $content = "[[File:" . $title . "|right|thumb|335px]] " . $content;
             $type = WikiaFileHelper::isFileTypeVideo($file) ? 'video' : 'photo';
             $this->helper->addJsVariable('wgEditPageAddFileType', $type);
         }
     }
     return $content;
 }