/** * Renders and adds the editing form to the parser output. */ protected function showContentForm() { if ($this->contentFormat !== CollaborationHubContentHandler::FORMAT_WIKI) { return parent::showContentForm(); } $parts = explode(CollaborationHubContent::HUMAN_DESC_SPLIT, $this->textbox1, 6); if (count($parts) !== 6) { return parent::showContentForm(); } $out = RequestContext::getMain()->getOutput(); $pageLang = $this->getTitle()->getPageLanguage(); $formFields = $this->getFormFields($parts); $htmlForm = new OOUI\FieldsetLayout(['items' => $formFields]); $out->enableOOUI(); $out->addHtml($htmlForm); }
protected function showContentForm() { if ($this->contentFormat !== CollaborationListContentHandler::FORMAT_WIKI) { return parent::showContentForm(); } $parts = explode(CollaborationListContent::HUMAN_DESC_SPLIT, $this->textbox1, 3); if (count($parts) !== 3) { return parent::showContentForm(); } $pageLang = $this->getTitle()->getPageLanguage(); $attribs = ['id' => 'wpCollabDescTextbox', 'lang' => $pageLang->getHtmlCode(), 'dir' => $pageLang->getDir()]; $descTitle = wfMessage('collaborationkit-listedit-description')->text(); $listTitle = wfMessage('collaborationkit-listedit-list')->text(); $out = RequestContext::getMain()->getOutput(); $out->addHtml(Html::element('h2', ["id" => 'mw-collabkit-desc'], $descTitle) . Html::textarea('wpCollabDescTextbox', $parts[0], $attribs) . Html::element('h2', ["id" => 'mw-collabkit-list'], $listTitle)); $out->addHtml(Html::Hidden('wpCollaborationKitOptions', $parts[1])); $this->showTextbox1(null, trim($parts[2])); }
function showContentForm() { global $wgOut; # Should be redundant, but check just in case if ($this->diff || wfReadOnly()) { $this->noVisualEditor = true; } # Also apply htmlspecialchars? See $encodedtext $html_text = $this->safeUnicodeOutput($this->textbox1); if (!($this->noVisualEditor || $this->userWantsTraditionalEditor)) { $this->noVisualEditor = self::wiki2html($this->mArticle, $wgUser, &$this, &$html_text); } if (!$this->noVisualEditor && !$this->userWantsTraditionalEditor) { # TODO: Now that MediaWiki has showContentForm, there is no need for a separate hook $this->noVisualEditor = self::showBox(&$this, $html_text, $rows, $cols, $ew); } if (!$this->noVisualEditor && !$this->userWantsTraditionalEditor) { $wgOut->addHTML("<input type='hidden' value=\"0\" name=\"wpNoVisualEditor\" />\n"); } else { $wgOut->addHTML("<input type='hidden' value=\"1\" name=\"wpNoVisualEditor\" />\n"); parent::showContentForm(); } }