Example #1
0
 function importFormData(&$request)
 {
     # These fields need to be checked for encoding.
     # Also remove trailing whitespace, but don't remove _initial_
     # whitespace from the text boxes. This may be significant formatting.
     EditPage::importFormData($request);
     // create the wikiHow wrapper object
     if ($request->wasPosted()) {
         $whow = WikihowArticleEditor::newFromRequest($request);
         $whow->mIsNew = false;
         $this->whow = $whow;
         $this->textbox1 = $this->whow->formatWikiText();
     }
 }
 function execute($par)
 {
     global $wgRequest, $wgOut;
     $wgOut->disable();
     $whow = WikihowArticleEditor::newFromRequest($wgRequest);
     if ($wgRequest->getVal('parse') == '1') {
         $body = $wgOut->parse($whow->formatWikiText());
         $magic = WikihowArticleHTML::grabTheMagic($whow->formatWikiText());
         echo WikihowArticleHTML::processArticleHTML($body, array('magic-word' => $magic));
     } else {
         echo $whow->formatWikiText();
     }
     return;
 }
 function importContentFormData($request)
 {
     if ($request->wasPosted() && !$request->getVal('wpTextbox1')) {
         $whow = WikihowArticleEditor::newFromRequest($request);
         $whow->mIsNew = false;
         $this->whow = $whow;
         $content = $this->whow->formatWikiText();
         return $content;
     } else {
         return parent::importContentFormData($request);
     }
 }