public function showForm()
 {
     global $wgScript;
     // Text to explain level select (if there are several levels)
     if (FlaggedRevs::qualityVersions()) {
         $this->getOutput()->addWikiMsg('reviewedpages-list', $this->getLanguage()->formatNum($this->pager->getNumRows()));
     }
     $form = Html::openElement('form', array('name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get'));
     $form .= "<fieldset><legend>" . $this->msg('reviewedpages-leg')->escaped() . "</legend>\n";
     // show/hide links
     $showhide = array($this->msg('show')->escaped(), $this->msg('hide')->escaped());
     $onoff = 1 - $this->hideRedirs;
     $link = Linker::link($this->getPageTitle(), $showhide[$onoff], array(), array('hideredirs' => $onoff, 'namespace' => $this->namespace));
     $showhideredirs = $this->msg('whatlinkshere-hideredirs')->rawParams($link)->escaped();
     $fields = array();
     $namespaces = FlaggedRevs::getReviewNamespaces();
     if (count($namespaces) > 1) {
         $fields[] = FlaggedRevsXML::getNamespaceMenu($this->namespace) . ' ';
     }
     if (FlaggedRevs::qualityVersions()) {
         $fields[] = FlaggedRevsXML::getLevelMenu($this->type) . ' ';
     }
     $form .= implode(' ', $fields) . ' ';
     $form .= $showhideredirs;
     if (count($fields)) {
         $form .= " " . Xml::submitButton($this->msg('go')->text());
     }
     $form .= Html::hidden('title', $this->getPageTitle()->getPrefixedDBKey()) . "\n";
     $form .= "</fieldset>";
     $form .= Html::closeElement('form ') . "\n";
     $this->getOutput()->addHTML($form);
 }
 /**
  * Output a form to allow searching for a user
  */
 function switchForm()
 {
     global $wgScript;
     $this->getOutput()->addModules('ext.centralauth.globaluserautocomplete');
     $this->getOutput()->addModuleStyles('mediawiki.special');
     $this->getOutput()->addHTML(Xml::openElement('form', array('method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1')) . Html::hidden('title', $this->getPageTitle()) . Xml::openElement('fieldset') . Xml::element('legend', array(), $this->msg('userrights-lookup-user')->text()) . Xml::inputLabel($this->msg('userrights-user-editname')->text(), 'user', 'username', 30, $this->mTarget, array('class' => 'mw-autocomplete-global-user')) . ' <br />' . Xml::submitButton($this->msg('editusergroup')->text()) . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
 }
	/**
	 * Returns HTML5 output of the form
	 * GLOBALS: $wgLang, $wgScript
	 * @return string
	 */
	protected function getForm() {
		global $wgLang, $wgScript;

		$form = Xml::tags( 'form',
			array(
				'action' => $wgScript,
				'method' => 'get'
			),

			'<table><tr><td>' .
				wfMsgHtml( 'translate-page-language' ) .
			'</td><td>' .
				TranslateUtils::languageSelector( $wgLang->getCode(), $this->options['language'] ) .
			'</td></tr><tr><td>' .
				wfMsgHtml( 'translate-magic-module' ) .
			'</td><td>' .
				$this->moduleSelector( $this->options['module'] ) .
			'</td></tr><tr><td colspan="2">' .
				Xml::submitButton( wfMsg( 'translate-magic-submit' ) ) . ' ' .
				Xml::submitButton( wfMsg( 'translate-magic-cm-export' ), array( 'name' => 'export' ) ) .
			'</td></tr></table>' .
			Html::hidden( 'title', $this->getTitle()->getPrefixedText() )
		);
		return $form;
	}
	protected function getDeletionButton( $ip ) {
		return Xml::openElement( 'form', array( 'id' => 'prem-wl-delete' . $ip, 'method' => 'post' ) ) .
			Xml::submitButton( wfMsg( 'premoderation-table-list-delete' ) ) .
			'<input type="hidden" name="action" value="delete" />' .
			'<input type="hidden" name="ip" value="' . $ip . '" />' .
			Xml::closeElement( 'form' );
	}
Esempio n. 5
0
 public function execute($subpage)
 {
     global $wgOut, $wgRequest, $wgUser, $wgCacheEpoch, $wgCityId;
     wfProfileIn(__METHOD__);
     $this->setHeaders();
     $this->mTitle = SpecialPage::getTitleFor('UserData');
     if ($this->isRestricted() && !$this->userCanExecute($wgUser)) {
         $this->displayRestrictionError();
         wfProfileOut(__METHOD__);
         return;
     }
     $result = '';
     $userId = $wgRequest->getInt('userId');
     if ($userId) {
         $user = User::newFromId($userId);
         if (!empty($user)) {
             //todo: add nicer result - right now only name and link to user page
             $result = Xml::element('a', array('href' => $user->getUserPage()->getLocalURL()), $user->getName(), false);
         }
     }
     $wgOut->addHTML(Xml::openElement('form', array('action' => $this->mTitle->getFullURL(), 'method' => 'get')));
     $wgOut->addHTML(Xml::inputLabel(wfMsg('userdata-userid-label'), 'userId', 'user-id', false, $userId));
     $wgOut->addHTML('<br>' . Xml::submitButton(wfMsg('userdata-submit')));
     $wgOut->addHTML(Xml::closeElement('form'));
     if ($result) {
         $wgOut->addHTML('<hr>' . $result);
     }
     wfProfileOut(__METHOD__);
 }
 public function showForm()
 {
     global $wgScript;
     # Explanatory text
     $this->getOutput()->addWikiMsg('pendingchanges-list', $this->getLang()->formatNum($this->pager->getNumRows()));
     $form = Html::openElement('form', array('name' => 'pendingchanges', 'action' => $wgScript, 'method' => 'get')) . "\n";
     $form .= "<fieldset><legend>" . wfMsgHtml('pendingchanges-legend') . "</legend>\n";
     $form .= Html::hidden('title', $this->getTitle()->getPrefixedDBKey()) . "\n";
     $items = array();
     if (count(FlaggedRevs::getReviewNamespaces()) > 1) {
         $items[] = "<span style='white-space: nowrap;'>" . FlaggedRevsXML::getNamespaceMenu($this->namespace, '') . '</span>';
     }
     if (FlaggedRevs::qualityVersions()) {
         $items[] = "<span style='white-space: nowrap;'>" . FlaggedRevsXML::getLevelMenu($this->level, 'revreview-filter-stable') . '</span>';
     }
     if (!FlaggedRevs::isStableShownByDefault() && !FlaggedRevs::useOnlyIfProtected()) {
         $items[] = "<span style='white-space: nowrap;'>" . Xml::check('stable', $this->stable, array('id' => 'wpStable')) . Xml::label(wfMsg('pendingchanges-stable'), 'wpStable') . '</span>';
     }
     if ($items) {
         $form .= implode(' ', $items) . '<br />';
     }
     $items = array();
     $items[] = Xml::label(wfMsg("pendingchanges-category"), 'wpCategory') . '&#160;' . Xml::input('category', 30, $this->category, array('id' => 'wpCategory'));
     if ($this->getUser()->getId()) {
         $items[] = Xml::check('watched', $this->watched, array('id' => 'wpWatched')) . Xml::label(wfMsg('pendingchanges-onwatchlist'), 'wpWatched');
     }
     $form .= implode(' ', $items) . '<br />';
     $form .= Xml::label(wfMsg('pendingchanges-size'), 'wpSize') . Xml::input('size', 4, $this->size, array('id' => 'wpSize')) . ' ' . Xml::submitButton(wfMsg('allpagessubmit')) . "\n";
     $form .= "</fieldset>";
     $form .= Html::closeElement('form') . "\n";
     $this->getOutput()->addHTML($form);
 }
 function getButtons()
 {
     $buttons = '';
     if ($this->mShowSubmit) {
         $attribs = array();
         if (isset($this->mSubmitID)) {
             $attribs['id'] = $this->mSubmitID;
         }
         if (isset($this->mSubmitName)) {
             $attribs['name'] = $this->mSubmitName;
         }
         if (isset($this->mSubmitTooltip)) {
             $attribs += Linker::tooltipAndAccesskeyAttribs($this->mSubmitTooltip);
         }
         $attribs['class'] = array('mw-htmlform-submit', 'mw-ui-button mw-ui-big mw-ui-block', $this->mSubmitModifierClass);
         $buttons .= Xml::submitButton($this->getSubmitText(), $attribs) . "\n";
     }
     if ($this->mShowReset) {
         $buttons .= Html::element('input', array('type' => 'reset', 'value' => $this->msg('htmlform-reset')->text(), 'class' => 'mw-ui-button mw-ui-big mw-ui-block')) . "\n";
     }
     foreach ($this->mButtons as $button) {
         $attrs = array('type' => 'submit', 'name' => $button['name'], 'value' => $button['value']);
         if ($button['attribs']) {
             $attrs += $button['attribs'];
         }
         if (isset($button['id'])) {
             $attrs['id'] = $button['id'];
         }
         $attrs['class'] = isset($attrs['class']) ? (array) $attrs['class'] : array();
         $attrs['class'][] = 'mw-ui-button mw-ui-big mw-ui-block';
         $buttons .= Html::element('input', $attrs) . "\n";
     }
     $html = Html::rawElement('div', array('class' => 'mw-htmlform-submit-buttons'), "\n{$buttons}") . "\n";
     return $html;
 }
 function addRequestWikiForm()
 {
     $localpage = $this->getPageTitle()->getLocalUrl();
     $form = Xml::openElement('form', array('action' => $localpage, 'method' => 'post'));
     $form .= '<fieldset><legend>' . $this->msg('requestwiki')->escaped() . '</legend>';
     $form .= Xml::openElement('table');
     $form .= '<tr><td>' . $this->msg('requestwiki-label-siteurl')->escaped() . '</td>';
     $form .= '<td>' . Xml::input('subdomain', 20, '') . '.miraheze.org' . '</td></tr>';
     $form .= '<tr><td>' . $this->msg('requestwiki-label-sitename')->escaped() . '</td>';
     $form .= '<td>' . Xml::input('sitename', 20, '', array('required' => '')) . '</td></tr>';
     $form .= '<tr><td>' . $this->msg('requestwiki-label-customdomain')->escaped() . '</td>';
     $form .= '<td>' . Xml::input('customdomain', 20, '') . '</td></tr>';
     $form .= '<tr><td>' . $this->msg('requestwiki-label-language')->escaped() . '</td>';
     $form .= '<td>' . Xml::languageSelector('en', true, null, array('name' => 'language'))[1] . '</td></tr>';
     $form .= '<tr><td>' . $this->msg('requestwiki-label-private')->escaped() . '</td>';
     $form .= '<td>' . Xml::check('private', false, array('value' => 0)) . '</td></tr>';
     $form .= '<tr><td>' . $this->msg('requestwiki-label-comments')->escaped() . '</td>';
     $form .= '<td>' . Xml::textarea('comments', '', 40, 5, array('required' => '')) . '</td></tr>';
     $form .= '<tr><td>' . Xml::submitButton($this->msg('requestwiki-submit')->plain()) . '</td></tr>';
     $form .= Xml::closeElement('table');
     $form .= '</fieldset>';
     $form .= Html::hidden('token', $this->getUser()->getEditToken());
     $form .= Xml::closeElement('form');
     $this->getOutput()->addHTML($form);
 }
Esempio n. 9
0
 /**
  * Once a set of revisions have been selected,
  * list them and request a reason/comment for confirmation.
  */
 function showForm()
 {
     global $wgOut, $wgUser;
     $special = Title::makeTitle(NS_SPECIAL, 'HideRevision');
     $wgOut->addWikiText(wfMsg('hiderevision-text'));
     $wgOut->addHtml($this->revisionList() . $this->archiveList() . Xml::openElement('form', array('action' => $special->getLocalUrl('action=submit'), 'method' => 'post')) . "<br />" . Xml::inputLabel(wfMsgHTML('hiderevision-reason'), 'wpReason', 'wpReason', 60, $this->mReason) . "<br />" . Xml::submitButton(wfMsgHTML('hiderevision-submit')) . $this->revisionFields() . Html::Hidden('wpEditToken', $wgUser->editToken()) . Xml::closeElement('form'));
 }
 protected function showForm()
 {
     global $wgScript;
     # Explanatory text
     $this->getOutput()->addWikiMsg('configuredpages-list', $this->getLang()->formatNum($this->pager->getNumRows()));
     $fields = array();
     # Namespace selector
     if (count(FlaggedRevs::getReviewNamespaces()) > 1) {
         $fields[] = FlaggedRevsXML::getNamespaceMenu($this->namespace, '');
     }
     # Default version selector
     $fields[] = FlaggedRevsXML::getDefaultFilterMenu($this->override);
     # Restriction level selector
     if (FlaggedRevs::getRestrictionLevels()) {
         $fields[] = FlaggedRevsXML::getRestrictionFilterMenu($this->autoreview);
     }
     $form = Html::openElement('form', array('name' => 'configuredpages', 'action' => $wgScript, 'method' => 'get'));
     $form .= Html::hidden('title', $this->getTitle()->getPrefixedDBKey());
     $form .= "<fieldset><legend>" . wfMsg('configuredpages') . "</legend>\n";
     $form .= implode('&#160;', $fields) . '<br/>';
     $form .= Xml::submitButton(wfMsg('go'));
     $form .= "</fieldset>\n";
     $form .= Html::closeElement('form') . "\n";
     $this->getOutput()->addHTML($form);
 }
Esempio n. 11
0
 /**
  * Show a nice form for the user to request a confirmation mail
  */
 function showRequestForm()
 {
     global $wgOut, $wgUser, $wgLang, $wgRequest;
     if ($wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getText('token'))) {
         $ok = $wgUser->sendConfirmationMail();
         if (WikiError::isError($ok)) {
             $wgOut->addWikiMsg('confirmemail_sendfailed', $ok->toString());
         } else {
             $wgOut->addWikiMsg('confirmemail_sent');
         }
     } else {
         if ($wgUser->isEmailConfirmed()) {
             // date and time are separate parameters to facilitate localisation.
             // $time is kept for backward compat reasons.
             // 'emailauthenticated' is also used in SpecialPreferences.php
             $time = $wgLang->timeAndDate($wgUser->mEmailAuthenticated, true);
             $d = $wgLang->date($wgUser->mEmailAuthenticated, true);
             $t = $wgLang->time($wgUser->mEmailAuthenticated, true);
             $wgOut->addWikiMsg('emailauthenticated', $time, $d, $t);
         }
         if ($wgUser->isEmailConfirmationPending()) {
             $wgOut->wrapWikiMsg("<div class=\"error mw-confirmemail-pending\">\n\$1</div>", 'confirmemail_pending');
         }
         $wgOut->addWikiMsg('confirmemail_text');
         $form = Xml::openElement('form', array('method' => 'post', 'action' => $this->getTitle()->getLocalUrl()));
         $form .= Xml::hidden('token', $wgUser->editToken());
         $form .= Xml::submitButton(wfMsg('confirmemail_send'));
         $form .= Xml::closeElement('form');
         $wgOut->addHTML($form);
     }
 }
Esempio n. 12
0
 public function execute($parameters)
 {
     global $wgOut, $wgRequest, $wgDisableTextSearch, $wgScript;
     $this->setHeaders();
     list($limit, $offset) = wfCheckLimits();
     $wgOut->addWikiText(wfMsgForContentNoTrans('proofreadpage_specialpage_text'));
     $this->searchList = null;
     $this->searchTerm = $wgRequest->getText('key');
     $this->suppressSqlOffset = false;
     if (!$wgDisableTextSearch) {
         $self = $this->getTitle();
         $wgOut->addHTML(Xml::openElement('form', array('action' => $wgScript)) . Html::hidden('title', $this->getTitle()->getPrefixedText()) . Xml::input('limit', false, $limit, array('type' => 'hidden')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('proofreadpage_specialpage_legend')) . Xml::input('key', 20, $this->searchTerm) . ' ' . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('fieldset') . Xml::closeElement('form'));
         if ($this->searchTerm) {
             $index_namespace = $this->index_namespace;
             $index_ns_index = MWNamespace::getCanonicalIndex(strtolower(str_replace(' ', '_', $index_namespace)));
             $searchEngine = SearchEngine::create();
             $searchEngine->setLimitOffset($limit, $offset);
             $searchEngine->setNamespaces(array($index_ns_index));
             $searchEngine->showRedirects = false;
             $textMatches = $searchEngine->searchText($this->searchTerm);
             $escIndex = preg_quote($index_namespace, '/');
             $this->searchList = array();
             while ($result = $textMatches->next()) {
                 $title = $result->getTitle();
                 if ($title->getNamespace() == $index_ns_index) {
                     array_push($this->searchList, $title->getDBkey());
                 }
             }
             $this->suppressSqlOffset = true;
         }
     }
     parent::execute($parameters);
 }
Esempio n. 13
0
 public function execute($subpage)
 {
     global $wgOut, $wgRequest, $wgUser, $wgCacheEpoch, $wgCityId;
     wfProfileIn(__METHOD__);
     $this->setHeaders();
     $this->mTitle = SpecialPage::getTitleFor('cacheepoch');
     if ($this->isRestricted() && !$this->userCanExecute($wgUser)) {
         $this->displayRestrictionError();
         wfProfileOut(__METHOD__);
         return;
     }
     //no WikiFactory (internal wikis)
     if (empty($wgCityId)) {
         $wgOut->addHTML(wfMsg('cacheepoch-no-wf'));
         wfProfileOut(__METHOD__);
         return;
     }
     if ($wgRequest->wasPosted()) {
         $wgCacheEpoch = wfTimestampNow();
         $status = WikiFactory::setVarByName('wgCacheEpoch', $wgCityId, $wgCacheEpoch, wfMsg('cacheepoch-wf-reason'));
         if ($status) {
             $wgOut->addHTML('<h2>' . wfMsg('cacheepoch-updated', $wgCacheEpoch) . '</h2>');
         } else {
             $wgOut->addHTML('<h2>' . wfMsg('cacheepoch-not-updated') . '</h2>');
         }
     } else {
         $wgOut->addHTML('<h2>' . wfMsg('cacheepoch-header') . '</h2>');
     }
     $wgOut->addHTML(Xml::openElement('form', array('action' => $this->mTitle->getFullURL(), 'method' => 'post')));
     $wgOut->addHTML(wfMsg('cacheepoch-value', $wgCacheEpoch) . '<br>');
     $wgOut->addHTML(Xml::submitButton(wfMsg('cacheepoch-submit')));
     $wgOut->addHTML(Xml::closeElement('form'));
     wfProfileOut(__METHOD__);
 }
Esempio n. 14
0
 function showForm($err = '')
 {
     global $wgOut, $wgUser, $wgLang;
     $wgOut->setPagetitle(wfMsg("makesysoptitle"));
     $wgOut->addWikiText(wfMsg("makesysoptext"));
     $titleObj = Title::makeTitle(NS_SPECIAL, "Makesysop");
     $action = $titleObj->getLocalUrl("action=submit");
     if ($wgUser->isAllowed('userrights')) {
         $wgOut->addWikiText(wfMsg('makesysop-see-userrights'));
     }
     if ("" != $err) {
         $wgOut->setSubtitle(wfMsg("formerror"));
         $wgOut->addHTML("<p class='error'>{$err}</p>\n");
     }
     $namedesc = wfMsg("makesysopname");
     if (!is_null($this->mUser)) {
         $encUser = htmlspecialchars($this->mUser);
     } else {
         $encUser = "";
     }
     $reason = htmlspecialchars(wfMsg("userrights-reason"));
     $makebureaucrat = wfMsg("setbureaucratflag");
     $mss = wfMsg("set_user_rights");
     $wgOut->addHTML(Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'makesysop')) . Xml::openElement('fieldset') . Xml::element('legend', array(), wfMsg('makesysoptitle')) . "<table border='0'>\n\t\t\t<tr>\n\t\t\t\t<td align='right'>{$namedesc}</td>\n\t\t\t\t<td align='left'>" . Xml::input('wpMakesysopUser', 40, $encUser) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td align='right'>{$reason}</td>\n\t\t\t\t<td align='left'>" . Xml::input('wpMakesysopReason', 40, $this->mReason, array('maxlength' => 255)) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td align='left'>" . Xml::checkLabel($makebureaucrat, 'wpSetBureaucrat', 'wpSetBureaucrat', $this->mSetBureaucrat) . "</td>\n\t\t\t</tr><tr>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td align='left'>" . Xml::submitButton($mss, array('name' => 'wpMakesysopSubmit')) . "</td>\n\t\t\t</tr>\n\t\t\t</table>" . Xml::hidden('wpEditToken', $wgUser->editToken()) . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
 }
 /**
  * @param $namespace int
  * @param $type string
  * @param $level string
  * @param $minsize int
  * @private
  */
 function showOptions($namespace, $type = 'edit', $level, $sizetype, $size)
 {
     global $wgScript;
     $action = htmlspecialchars($wgScript);
     $title = SpecialPage::getTitleFor('ProtectedTitles');
     $special = htmlspecialchars($title->getPrefixedDBkey());
     return "<form action=\"{$action}\" method=\"get\">\n" . '<fieldset>' . Xml::element('legend', array(), wfMsg('protectedtitles')) . Xml::hidden('title', $special) . "&nbsp;\n" . $this->getNamespaceMenu($namespace) . "&nbsp;\n" . $this->getLevelMenu($level) . "&nbsp;\n" . "&nbsp;" . Xml::submitButton(wfMsg('allpagessubmit')) . "\n" . "</fieldset></form>";
 }
Esempio n. 16
0
 /**
  * Show options for the log list
  * @param $type String
  * @param $user String
  * @param $page String
  * @param $pattern String
  * @param $year Integer: year
  * @param $month Integer: month
  * @param $filter Boolean
  */
 public function showOptions($type = '', $user = '', $page = '', $pattern = '', $year = '', $month = '', $filter = null)
 {
     global $wgScript, $wgMiserMode;
     $action = htmlspecialchars($wgScript);
     $title = SpecialPage::getTitleFor('Log');
     $special = htmlspecialchars($title->getPrefixedDBkey());
     $this->out->addHTML("<form action=\"{$action}\" method=\"get\"><fieldset>" . Xml::element('legend', array(), wfMsg('log')) . Xml::hidden('title', $special) . "\n" . $this->getTypeMenu($type) . "\n" . $this->getUserInput($user) . "\n" . $this->getTitleInput($page) . "\n" . (!$wgMiserMode ? $this->getTitlePattern($pattern) . "\n" : "") . "<p>" . $this->getDateMenu($year, $month) . "\n" . ($filter ? "</p><p>" . $this->getFilterLinks($type, $filter) . "\n" : "") . Xml::submitButton(wfMsg('allpagessubmit')) . "</p>\n" . "</fieldset></form>");
 }
Esempio n. 17
0
 public function execute($subpage)
 {
     global $wgOut, $wgRequest, $wgCookiePrefix;
     wfProfileIn(__METHOD__);
     $this->mRequest = RequestContext::getMain()->getRequest();
     $this->mOut = RequestContext::getMain()->getOutput();
     $this->setHeaders();
     $this->mTitle = SpecialPage::getTitleFor("Datacenter");
     /**
      * if posted change cookie value
      */
     if ($this->mRequest->wasPosted()) {
         $val = $this->mRequest->getVal("iowacookie", 0);
         if ($val == 2) {
             $this->mOut->addHTML(Wikia::successbox("cookie set to sjc"));
             $this->mRequest->response()->setcookie($this->mCookieName, "sjc");
             $this->mCookie = "sjc";
         } elseif ($val == 1) {
             $this->mOut->addHTML(Wikia::successbox("cookie set to iowa"));
             $this->mRequest->response()->setcookie($this->mCookieName, "iowa");
             $this->mCookie = "iowa";
         } elseif ($val == 3) {
             $this->mOut->addHTML(Wikia::successbox("cookie set to ash"));
             $this->mRequest->response()->setcookie($this->mCookieName, "ash");
             $this->mCookie = "ash";
         } elseif ($val == 4) {
             $this->mOut->addHTML(Wikia::successbox("cookie set to closest"));
             $this->mRequest->response()->setcookie($this->mCookieName, "closest");
             $this->mCookie = "closest";
         } else {
             $this->mOut->addHTML(Wikia::successbox("cookie removed"));
             $this->mRequest->response()->setcookie($this->mCookieName, "sjc", 1);
             $this->mCookie = false;
         }
     } else {
         /**
          * show current value of cookie
          */
         if (isset($_COOKIE[$wgCookiePrefix . $this->mCookieName])) {
             $this->mCookie = $_COOKIE[$wgCookiePrefix . $this->mCookieName];
         }
     }
     $this->mOut->addHTML("Current value of cookie {$wgCookiePrefix}{$this->mCookieName}: <em>" . ($this->mCookie ? $this->mCookie : "not set") . "</em>");
     /**
      * show input chooser
      */
     $this->mOut->addHTML(Xml::openElement("form", array("action" => $this->mTitle->getFullURL(), "method" => "post")));
     $select = new XMLSelect("iowacookie", "iowacookie");
     $select->addOption("Switch to the closest", 4);
     $select->addOption("Switch to San Jose", 2);
     $select->addOption("Switch to Iowa", 1);
     $select->addOption("Switch to Ashburn", 3);
     $select->addOption("Remove preferences", 0);
     $this->mOut->addHTML($select->getHTML());
     $this->mOut->addHTML(Xml::submitButton("submit"));
     $this->mOut->addHTML(Xml::closeElement("form"));
     wfProfileOut(__METHOD__);
 }
	private function makeSearchForm( $process, $wild = false ) {
		$self = SpecialPage::getTitleFor( 'Profiling' );
		$html  = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
		$html .= '<table><tr><td>' . wfMsgHtml( 'profiling-process' ) . '</td><td>';
		$html .= Xml::input( 'process', 50, $process ) . '</td></tr><td align="right">' . Xml::check( 'wildcard', $wild ) . '</td>';
		$html .= '<td>' . wfMsgHtml( 'profiling-wildcard' ) . '</td></tr>';
		$html .= '<tr><td>&#160;</td><td>' . Xml::submitButton( wfMsg( 'profiling-ok' ), array( 'name' => 'submit' ) ) . '</td></table></form>';
		return $html;
	}
Esempio n. 19
0
 public function getForm($par = null)
 {
     global $wgScript, $wgRequest;
     $category = $par;
     if (!$category) {
         $category = $wgRequest->getVal('category');
     }
     $f = Xml::openElement('form', array('method' => 'get', 'action' => $wgScript)) . Xml::openElement('fieldset') . Xml::element('legend', array(), wfMsg('randomincategory')) . Html::Hidden('title', $this->getTitle()->getPrefixedText()) . Xml::openElement('p') . Xml::label(wfMsg('randomincategory-label'), 'category') . ' ' . Xml::input('category', null, $category, array('id' => 'category')) . ' ' . Xml::submitButton(wfMsg('randomincategory-submit')) . Xml::closeElement('p') . Xml::closeElement('fieldset') . Xml::closeElement('form');
     return $f;
 }
 public function getPageHeader()
 {
     $self = SpecialPage::getTitleFor($this->getName());
     $form = Xml::openElement('form', array('method' => 'post', 'action' => $self->getLocalUrl()));
     $form .= '<table><tr><td align="right">' . Xml::label("Exclude titles", 'excludetitles') . '</td>';
     $form .= '<td>' . Xml::input('excludetitles', 30, $this->excludeorig, array('id' => 'excludetitles')) . '</td></tr>';
     $form .= '<tr><td></td><td>' . Xml::submitButton(wfMsg('allpagessubmit')) . '</td></tr></table>';
     $form .= Html::hidden('offset', $this->offset) . Html::hidden('limit', $this->limit) . '</form>';
     return $form;
 }
 function draw_OTP()
 {
     global $wgOut, $wgUser;
     $formu = Xml::openElement('form', array('method' => 'post', 'action' => $this->getTitle()->getLocalUrl('action=submit')));
     $formu .= Xml::inputLabel(wfMsg('latch-OTP') . ' ', 'txt_OTP', 'txt_OTP', 20) . '<BR>&nbsp';
     $formu .= Xml::submitButton(wfMsg('latch-enter'), array('name' => 'clickBotOTP')) . '<BR>';
     # Adding protection against CSRF
     $formu .= Html::hidden('token', $wgUser->getEditToken(), array('id' => 'token'));
     $formu .= Xml::closeElement('form');
     $wgOut->addHTML($formu);
 }
 function getPageHeader()
 {
     global $wgScript, $wgMiserMode;
     # Do not show useless input form if wiki is running in misermode
     if ($wgMiserMode) {
         return '';
     }
     $prefix = $this->prefix;
     $t = $this->getTitle();
     return Xml::openElement('form', array('method' => 'get', 'action' => $wgScript)) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('withoutinterwiki-legend')) . Html::hidden('title', $t->getPrefixedText()) . Xml::inputLabel(wfMsg('allpagesprefix'), 'prefix', 'wiprefix', 20, $prefix) . ' ' . Xml::submitButton(wfMsg('withoutinterwiki-submit')) . Xml::closeElement('fieldset') . Xml::closeElement('form');
 }
Esempio n. 23
0
 function execute($par)
 {
     $mime = $par ? $par : $this->getRequest()->getText('mime');
     $this->setHeaders();
     $this->outputHeader();
     $this->getOutput()->addHTML(Xml::openElement('form', array('id' => 'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor('MIMEsearch')->getLocalUrl())) . Xml::openElement('fieldset') . Html::hidden('title', SpecialPage::getTitleFor('MIMEsearch')->getPrefixedText()) . Xml::element('legend', null, wfMsg('mimesearch')) . Xml::inputLabel(wfMsg('mimetype'), 'mime', 'mime', 20, $mime) . ' ' . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('fieldset') . Xml::closeElement('form'));
     list($this->major, $this->minor) = File::splitMime($mime);
     if ($this->major == '' || $this->minor == '' || $this->minor == 'unknown' || !self::isValidType($this->major)) {
         return;
     }
     parent::execute($par);
 }
 function makeFilterForm()
 {
     $filterForm = Xml::openElement('form', array('method' => 'get', 'action' => $this->getConfig()->get('Script')));
     $filterForm .= Xml::openElement('fieldset') . Xml::element('legend', null, $this->msg('approvedrevs-filter-legend')->text()) . Html::hidden('title', $this->getTitle()->getPrefixedText()) . Xml::inputLabel($this->msg('approvedrevs-filter-field-org')->text(), 'organization', 'filter-field-org', null, $this->mOrganization) . ' ';
     /*
                     Xml::inputLabel(
                         $this->msg('approvedrevs-filter-field-group' )->text(),
                         'group', 'filter-field-group', null, $group ) . ' ' .
     */
     $filterForm .= $this->getModeSelector();
     $filterForm .= Xml::submitButton($this->msg('approvedrevs-filter-field-submit')->text()) . Xml::closeElement('fieldset') . Xml::closeElement('form');
     return $filterForm;
 }
 /**
  * Output a form to allow searching for a user
  */
 function switchForm()
 {
     global $wgScript;
     $knownwiki = $this->getRequest()->getVal('wpKnownWiki');
     $knownwiki = $knownwiki ? $knownwiki : wfWikiId();
     // Generate wiki selector
     $selector = new XmlSelect('wpKnownWiki', 'wpKnownWiki', $knownwiki);
     foreach (CentralAuthUser::getWikiList() as $wiki) {
         $selector->addOption($wiki);
     }
     $this->getOutput()->addModuleStyles('mediawiki.special');
     $this->getOutput()->addHTML(Xml::openElement('form', array('method' => 'get', 'action' => $wgScript, 'name' => 'uluser', 'id' => 'mw-userrights-form1')) . Html::hidden('title', $this->getTitle()) . Xml::openElement('fieldset') . Xml::element('legend', array(), wfMsg('userrights-lookup-user')) . Xml::inputLabel(wfMsg('userrights-user-editname'), 'user', 'username', 30, $this->mTarget) . ' <br />' . Xml::label(wfMsg('centralauth-globalgrouppermissions-knownwiki'), 'wpKnownWiki') . ' ' . $selector->getHTML() . '<br />' . Xml::submitButton(wfMsg('editusergroup')) . Xml::closeElement('fieldset') . Xml::closeElement('form') . "\n");
 }
/**
 * Output the HTML search form, and constructs the MIMEsearchPage object.
 */
function wfSpecialMIMEsearch($par = null)
{
    global $wgRequest, $wgTitle, $wgOut;
    $mime = isset($par) ? $par : $wgRequest->getText('mime');
    $wgOut->addHTML(Xml::openElement('form', array('id' => 'specialmimesearch', 'method' => 'get', 'action' => $wgTitle->getLocalUrl())) . Xml::inputLabel(wfMsg('mimetype'), 'mime', 'mime', 20, $mime) . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('form'));
    list($major, $minor) = wfSpecialMIMEsearchParse($mime);
    if ($major == '' or $minor == '' or !wfSpecialMIMEsearchValidType($major)) {
        return;
    }
    $wpp = new MIMEsearchPage($major, $minor);
    list($limit, $offset) = wfCheckLimits();
    $wpp->doQuery($offset, $limit);
}
Esempio n. 27
0
 function execute($subpage)
 {
     global $wgRequest, $wgOut;
     $wgOut->setPageTitle('Wikitext Preview');
     if ($wikitext = $wgRequest->getText('wikitext')) {
         $wgOut->addHTML(Xml::fieldset('Wikitext preview', $wgOut->parse($wikitext)));
     }
     $f = Xml::textarea('wikitext', $wikitext);
     $f .= Xml::submitButton('Preview wikitext');
     $f .= Html::Hidden('title', $this->getTitle()->getPrefixedText());
     $f = Xml::tags('form', array('method' => 'POST', 'action' => $this->getTitle()->getLocalURL()), $f);
     $wgOut->addHTML(Xml::fieldset('Preview wikitext', $f));
 }
Esempio n. 28
0
 /**
  * Generate a form to allow users to enter an ISBN
  *
  * @return string
  */
 private function makeForm()
 {
     global $wgScript;
     $title = self::getTitleFor('Booksources');
     $form = '<fieldset><legend>' . wfMsgHtml('booksources-search-legend') . '</legend>';
     $form .= Xml::openElement('form', array('method' => 'get', 'action' => $wgScript));
     $form .= Xml::hidden('title', $title->getPrefixedText());
     $form .= '<p>' . Xml::inputLabel(wfMsg('booksources-isbn'), 'isbn', 'isbn', 20, $this->isbn);
     $form .= '&nbsp;' . Xml::submitButton(wfMsg('booksources-go')) . '</p>';
     $form .= Xml::closeElement('form');
     $form .= '</fieldset>';
     return $form;
 }
Esempio n. 29
0
    function buildForm()
    {
        global $wgScript;
        $languages = Language::getLanguageNames(false);
        ksort($languages);
        $out = Xml::openElement('form', array('method' => 'get', 'action' => $wgScript, 'id' => 'mw-allmessages-form')) . Xml::fieldset(wfMsg('allmessages-filter-legend')) . Xml::hidden('title', $this->getTitle()) . Xml::openElement('table', array('class' => 'mw-allmessages-table')) . "\n" . '<tr>
				<td class="mw-label">' . Xml::label(wfMsg('allmessages-prefix'), 'mw-allmessages-form-prefix') . "</td>\n\n\t\t\t\t<td class=\"mw-input\">" . Xml::input('prefix', 20, str_replace('_', ' ', $this->prefix), array('id' => 'mw-allmessages-form-prefix')) . "</td>\n\n\t\t\t</tr>\n\t\t\t<tr>\n\n\t\t\t\t<td class='mw-label'>" . wfMsg('allmessages-filter') . "</td>\n\n\t\t\t\t<td class='mw-input'>" . Xml::radioLabel(wfMsg('allmessages-filter-unmodified'), 'filter', 'unmodified', 'mw-allmessages-form-filter-unmodified', $this->filter == 'unmodified' ? true : false) . Xml::radioLabel(wfMsg('allmessages-filter-all'), 'filter', 'all', 'mw-allmessages-form-filter-all', $this->filter == 'all' ? true : false) . Xml::radioLabel(wfMsg('allmessages-filter-modified'), 'filter', 'modified', 'mw-allmessages-form-filter-modified', $this->filter == 'modified' ? true : false) . "</td>\n\n\t\t\t</tr>\n\t\t\t<tr>\n\n\t\t\t\t<td class=\"mw-label\">" . Xml::label(wfMsg('allmessages-language'), 'mw-allmessages-form-lang') . "</td>\n\n\t\t\t\t<td class=\"mw-input\">" . Xml::openElement('select', array('id' => 'mw-allmessages-form-lang', 'name' => 'lang'));
        foreach ($languages as $lang => $name) {
            $selected = $lang == $this->langCode ? true : false;
            $out .= Xml::option($lang . ' - ' . $name, $lang, $selected) . "\n";
        }
        $out .= Xml::closeElement('select') . "</td>\n\n\t\t\t</tr>\n\t\t\t<tr>\n\n\t\t\t\t<td></td>\n\t\t\t\t<td>" . Xml::submitButton(wfMsg('allmessages-filter-submit')) . "</td>\n\n\t\t\t</tr>" . Xml::closeElement('table') . $this->table->getHiddenFields(array('title', 'prefix', 'filter', 'lang')) . Xml::closeElement('fieldset') . Xml::closeElement('form');
        return $out;
    }
 function getPageHeader()
 {
     # Do not show useless input form if special page is cached
     if ($this->isCached()) {
         return '';
     }
     $prefix = $this->prefix;
     $t = $this->getPageTitle();
     return Html::openElement('form', array('method' => 'get', 'action' => wfScript())) . "\n" . Html::openElement('fieldset') . "\n" . Html::element('legend', null, $this->msg('withoutinterwiki-legend')->text()) . "\n" . Html::hidden('title', $t->getPrefixedText()) . "\n" . Xml::inputLabel($this->msg('allpagesprefix')->text(), 'prefix', 'wiprefix', 20, $prefix) . "\n" . Xml::submitButton($this->msg('withoutinterwiki-submit')->text()) . "\n" . Html::closeElement('fieldset') . "\n" . Html::closeElement('form');
 }