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);
 }
 function show()
 {
     global $wgOut, $wgUser, $wgRequest;
     AbuseFilter::disableConditionLimit();
     if (!$wgUser->isAllowed('abusefilter-modify')) {
         $wgOut->addWikiMsg('abusefilter-mustbeeditor');
         return;
     }
     $this->loadParameters();
     $wgOut->setPageTitle(wfMsg('abusefilter-test'));
     $wgOut->addWikiMsg('abusefilter-test-intro', self::$mChangeLimit);
     $output = '';
     $output .= AbuseFilter::buildEditBox($this->mFilter, 'wpTestFilter') . "\n";
     $output .= Xml::inputLabel(wfMsg('abusefilter-test-load-filter'), 'wpInsertFilter', 'mw-abusefilter-load-filter', 10, '') . ' ' . Xml::element('input', array('type' => 'button', 'value' => wfMsg('abusefilter-test-load'), 'id' => 'mw-abusefilter-load'));
     $output = Xml::tags('div', array('id' => 'mw-abusefilter-test-editor'), $output);
     $output .= Xml::tags('p', null, Xml::checkLabel(wfMsg('abusefilter-test-shownegative'), 'wpShowNegative', 'wpShowNegative', $this->mShowNegative));
     // Selectory stuff
     $selectFields = array();
     $selectFields['abusefilter-test-user'] = Xml::input('wpTestUser', 45, $this->mTestUser);
     $selectFields['abusefilter-test-period-start'] = Xml::input('wpTestPeriodStart', 45, $this->mTestPeriodStart);
     $selectFields['abusefilter-test-period-end'] = Xml::input('wpTestPeriodEnd', 45, $this->mTestPeriodEnd);
     $selectFields['abusefilter-test-page'] = Xml::input('wpTestPage', 45, $this->mTestPage);
     $output .= Xml::buildForm($selectFields, 'abusefilter-test-submit');
     $output .= Html::hidden('title', $this->getTitle('test')->getPrefixedText());
     $output = Xml::tags('form', array('action' => $this->getTitle('test')->getLocalURL(), 'method' => 'post'), $output);
     $output = Xml::fieldset(wfMsg('abusefilter-test-legend'), $output);
     $wgOut->addHTML($output);
     if ($wgRequest->wasPosted()) {
         $this->doTest();
     }
 }
 function constructCreateForm()
 {
     global $wgOut, $wgScript;
     global $wgUserProperties, $wgActivityModes;
     $wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL(), 'method' => 'post')));
     $wgOut->addHTML(Xml::element('h2', null, wfMsg('nss-create-account-header')) . "\n");
     $wgOut->addHTML("<table border=\"1\" id=\"newuser\">\n");
     $props = array_merge(array('username', 'email'), $wgUserProperties);
     foreach ($props as $i) {
         $msg = 'am-' . $i;
         $wgOut->addHTML("\t<tr><th>" . (wfEmptyMsg($msg, wfMsg($msg)) ? $i : wfMsgHtml($msg)) . "</th><td>" . Xml::input("am-" . str_replace(' ', '_', $i), 40) . "</td></tr>\n");
     }
     global $wgActivityModes;
     $select = new XmlSelect("am-active");
     $select->setDefault('active');
     $select->setAttribute('width', '100%');
     foreach ($wgActivityModes as $key) {
         $select->addOption($key);
     }
     $wgOut->addHTML("\t<tr><th>" . wfMsgHtml('am-active') . "</th><td>" . $select->getHTML() . "</td></tr>\n");
     $wgOut->addHTML("</table>\n");
     $wgOut->addHTML("<div id=\"newaccount-submit\">\n" . Html::Hidden('action', 'create') . Xml::checkLabel(wfMsg('nss-no-mail'), 'nss-no-mail', 'nss-no-mail') . "<br />\n" . Xml::element('input', array('type' => 'submit', 'value' => wfMsg('nss-create-account'))) . "</div>\n</form>\n");
     $wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL(), 'method' => 'post')));
     $wgOut->addHTML("<div id=\"newaccount-raw\">\n" . Xml::textarea('nss-create-account-raw', '') . "\n" . Html::Hidden('action', 'create-raw') . Xml::checkLabel(wfMsg('nss-no-mail'), 'nss-no-mail', 'nss-no-mail') . "<br />\n" . Xml::element('input', array('type' => 'submit', 'value' => wfMsg('nss-create-account'))) . "</div>\n</form>\n");
 }
 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");
 }
 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);
 }
 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);
 }
 /**
  * Prompt for a username or IP address.
  *
  * @param $userName string
  */
 protected function promptForm($userName = '')
 {
     $out = $this->getOutput();
     $out->addModules('mediawiki.userSuggest');
     $out->addWikiMsg('nuke-tools');
     $out->addHTML(Xml::openElement('form', array('action' => $this->getPageTitle()->getLocalURL('action=submit'), 'method' => 'post')) . '<table><tr>' . '<td>' . Xml::label($this->msg('nuke-userorip')->text(), 'nuke-target') . '</td>' . '<td>' . Xml::input('target', 40, $userName, array('id' => 'nuke-target', 'class' => 'mw-autocomplete-user', 'autofocus' => true)) . '</td>' . '</tr><tr>' . '<td>' . Xml::label($this->msg('nuke-pattern')->text(), 'nuke-pattern') . '</td>' . '<td>' . Xml::input('pattern', 40, '', array('id' => 'nuke-pattern')) . '</td>' . '</tr><tr>' . '<td>' . Xml::label($this->msg('nuke-namespace')->text(), 'nuke-namespace') . '</td>' . '<td>' . Html::namespaceSelector(array('all' => 'all'), array('name' => 'namespace')) . '</td>' . '</tr><tr>' . '<td>' . Xml::label($this->msg('nuke-maxpages')->text(), 'nuke-limit') . '</td>' . '<td>' . Xml::input('limit', 7, '500', array('id' => 'nuke-limit')) . '</td>' . '</tr><tr>' . '<td></td>' . '<td>' . Xml::submitButton($this->msg('nuke-submit-user')->text()) . '</td>' . '</tr></table>' . Html::hidden('wpEditToken', $this->getUser()->getEditToken()) . Xml::closeElement('form'));
 }
 function showList()
 {
     global $wgOut, $wgScript;
     $errors = array();
     // Validate search IP
     $ip = $this->mSearchIP;
     if (!IP::isIPAddress($ip) && strlen($ip)) {
         $errors[] = array('globalblocking-list-ipinvalid', $ip);
         $ip = '';
     }
     $wgOut->addWikiMsg('globalblocking-list-intro');
     // Build the search form
     $searchForm = '';
     $searchForm .= Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('globalblocking-search-legend'));
     $searchForm .= Xml::openElement('form', array('method' => 'get', 'action' => $wgScript, 'name' => 'globalblocklist-search'));
     $searchForm .= Html::hidden('title', SpecialPage::getTitleFor('GlobalBlockList')->getPrefixedText());
     if (is_array($errors) && count($errors) > 0) {
         $errorstr = '';
         foreach ($errors as $error) {
             if (is_array($error)) {
                 $msg = array_shift($error);
             } else {
                 $msg = $error;
                 $error = array();
             }
             $errorstr .= Xml::tags('li', null, wfMsgExt($msg, array('parseinline'), $error));
         }
         $wgOut->addWikiMsg('globalblocking-unblock-errors', count($errors));
         $wgOut->addHTML(Xml::tags('ul', array('class' => 'error'), $errorstr));
     }
     $fields = array();
     $fields['globalblocking-search-ip'] = Xml::input('ip', 45, $ip);
     $searchForm .= Xml::buildForm($fields, 'globalblocking-search-submit');
     $searchForm .= Xml::closeElement('form') . Xml::closeElement('fieldset');
     $wgOut->addHTML($searchForm);
     // Build a list of blocks.
     $conds = array();
     if (strlen($ip)) {
         list($range_start, $range_end) = IP::parseRange($ip);
         if ($range_start != $range_end) {
             // They searched for a range. Match that exact range only
             $conds = array('gb_address' => $ip);
         } else {
             // They searched for an IP. Match any range covering that IP
             $hex_ip = IP::toHex($ip);
             $ip_pattern = substr($hex_ip, 0, 4) . '%';
             // Don't bother checking blocks out of this /16.
             $dbr = wfGetDB(DB_SLAVE);
             $conds = array('gb_range_end>=' . $dbr->addQuotes($hex_ip), 'gb_range_start<=' . $dbr->addQuotes($hex_ip), 'gb_range_start like ' . $dbr->addQuotes($ip_pattern), 'gb_expiry>' . $dbr->addQuotes($dbr->timestamp(wfTimestampNow())));
         }
     }
     $pager = new GlobalBlockListPager($this, $conds);
     $body = $pager->getBody();
     if ($body != '') {
         $wgOut->addHTML($pager->getNavigationBar() . Html::rawElement('ul', array(), $body) . $pager->getNavigationBar());
     } else {
         $wgOut->wrapWikiMsg("<div class='mw-globalblocking-noresults'>\n\$1</div>\n", array('globalblocking-list-noresults'));
     }
 }
	/**
	 * Input form
	 */
	static function onSpecialListusersHeaderForm( $pager, &$out ) {
		$testwiki = IncubatorTest::getUrlParam();
		$project = self::getProjectInput();
		$input = $project ? $project['name'] : ( $testwiki ? $testwiki['prefix'] : null );
		$out .= Xml::label( wfMsg( 'wminc-testwiki' ), 'testwiki' ) . ' ' .
			Xml::input( 'testwiki', 20, $input, array( 'id' => 'testwiki' ) ) . '<br />';
		return true;
	}
 /** Produce a nice little form */
 function getForm()
 {
     list($sum, $answer) = $this->pickSum();
     $index = $this->storeCaptcha(array('answer' => $answer));
     $form = '<table><tr><td>' . $this->fetchMath($sum) . '</td>';
     $form .= '<td>' . Xml::input('wpCaptchaWord', false, false, array('tabindex' => '1')) . '</td></tr></table>';
     $form .= Html::hidden('wpCaptchaId', $index);
     return $form;
 }
	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. 12
0
 function promptForm()
 {
     global $wgOut;
     $input = Xml::input('target', 40);
     $submit = Xml::submitButton(wfMsg('nuke-submit-user'));
     $wgOut->addWikiMsg('nuke-tools');
     $wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL('action=submit'), 'method' => 'post')) . "{$input}\n{$submit}\n");
     $wgOut->addHTML("</form>");
 }
Esempio n. 13
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;
 }
	protected function getAddForm() {
		return Xml::fieldset( wfMsg( 'premoderation-wl-addip-fieldset' ) ) .
			Xml::openElement( 'form', array( 'id' => 'prem-wl-form', 'method' => 'post' ) ) .
			'<table><tr><td>' .	wfMsg( 'premoderation-private-ip' ) . '</td><td>' .
			Xml::input( 'ip', 50, '', array( 'id' => 'prem-whitelist-addip' ) ) . '</td></tr>' .
			'<tr><td>' . wfMsg( 'summary' ) . '</td><td>' . Xml::input( 'summary', 50, '',
			array( 'id' => 'prem-summary' ) ) . '</td></tr><tr>' . '<td>' .
			Xml::submitButton( wfMsg( 'htmlform-submit' ), array( 'id' => 'prem-wl-submit' ) ) .
			'<input type="hidden" name="action" value="add" /></td></tr></table>' .
			Xml::closeElement( 'form' ) . Xml::closeElement( 'fieldset' );
	}
	/**
	 * Another simple helper function to output the html of a table row, but with two input boxes.
	 * See addTableRow for parameter details
	 */
	private function add2ColTableRow( &$out, $varname1, $varname2, $varval1, $varval2, $label1, $label2 ) {
		$out->addHTML( Xml::openElement( 'tr' ) );
		$out->addHTML( Xml::openElement( 'td', array( 'class' => 'mw-label' ) ) );
		$out->addHTML( Xml::element( 'label', array( 'for' => $varname1 ), "$label1" ) );
		$out->addHTML( Xml::closeElement( 'td' ) );
		$out->addHTML( Xml::openElement( 'td' ) );
		$out->addHTML( Xml::input( $varname1, 15, $varval1, array( 'id' => "inp_$varname1", 'oninput' => 'updateFirstName(event)' ) ) );
		$out->addHTML( Xml::element( 'label', array( 'for' => $varname2 ), " $label2: " ) );
		$out->addHTML( Xml::input( $varname2, 20, $varval2, array( 'id' => "inp_$varname2", 'oninput' => 'updateSurname(event)' ) ) );
		$out->addHTML( Xml::closeElement( 'td' ) );
		$out->addHTML( Xml::closeElement( 'tr' ) );
	}
Esempio n. 17
0
    function buildForm()
    {
        $attrs = ['id' => 'mw-allmessages-form-lang', 'name' => 'lang'];
        $msg = wfMessage('allmessages-language');
        $langSelect = Xml::languageSelector($this->langcode, false, null, $attrs, $msg);
        $out = Xml::openElement('form', ['method' => 'get', 'action' => $this->getConfig()->get('Script'), 'id' => 'mw-allmessages-form']) . Xml::fieldset($this->msg('allmessages-filter-legend')->text()) . Html::hidden('title', $this->getTitle()->getPrefixedText()) . Xml::openElement('table', ['class' => 'mw-allmessages-table']) . "\n" . '<tr>
				<td class="mw-label">' . Xml::label($this->msg('allmessages-prefix')->text(), 'mw-allmessages-form-prefix') . "</td>\n\n\t\t\t<td class=\"mw-input\">" . Xml::input('prefix', 20, str_replace('_', ' ', $this->displayPrefix), ['id' => 'mw-allmessages-form-prefix']) . "</td>\n\n\t\t\t</tr>\n\t\t\t<tr>\n\n\t\t\t<td class='mw-label'>" . $this->msg('allmessages-filter')->escaped() . "</td>\n\n\t\t\t\t<td class='mw-input'>" . Xml::radioLabel($this->msg('allmessages-filter-unmodified')->text(), 'filter', 'unmodified', 'mw-allmessages-form-filter-unmodified', $this->filter === 'unmodified') . Xml::radioLabel($this->msg('allmessages-filter-all')->text(), 'filter', 'all', 'mw-allmessages-form-filter-all', $this->filter === 'all') . Xml::radioLabel($this->msg('allmessages-filter-modified')->text(), 'filter', 'modified', 'mw-allmessages-form-filter-modified', $this->filter === 'modified') . "</td>\n\n\t\t\t</tr>\n\t\t\t<tr>\n\n\t\t\t\t<td class=\"mw-label\">" . $langSelect[0] . "</td>\n\n\t\t\t\t<td class=\"mw-input\">" . $langSelect[1] . "</td>\n\n\t\t\t</tr>" . '<tr>
				<td class="mw-label">' . Xml::label($this->msg('table_pager_limit_label')->text(), 'mw-table_pager_limit_label') . '</td>
			<td class="mw-input">' . $this->getLimitSelect(['id' => 'mw-table_pager_limit_label']) . '</td>
			<tr>
				<td></td>
				<td>' . Xml::submitButton($this->msg('allmessages-filter-submit')->text()) . "</td>\n\n\t\t\t</tr>" . Xml::closeElement('table') . $this->getHiddenFields(['title', 'prefix', 'filter', 'lang', 'limit']) . Xml::closeElement('fieldset') . Xml::closeElement('form');
        return $out;
    }
 protected function generateBillingFields()
 {
     global $wgScriptPath;
     $form = '';
     // name
     $form .= $this->getNameField();
     // email
     $form .= $this->getEmailField();
     // amount
     $form .= '<tr>';
     $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
     $form .= '</tr>';
     $form .= '<tr>';
     $form .= '<td class="label">' . Xml::label(wfMsg('donate_interface-donor-amount'), 'amount') . '</td>';
     $form .= '<td>' . Xml::input('amount', '7', $this->getEscapedValue('amount'), array('type' => 'text', 'maxlength' => '10', 'id' => 'amount')) . ' ' . $this->generateCurrencyDropdown() . '</td>';
     $form .= '</tr>';
     // card logos
     if ($this->getEscapedValue('currency_code') == 'USD') {
         $form .= '<tr id="four_cards" style="display:table-row;">';
         $form .= '<td class="label"> </td><td>' . Xml::element('img', array('src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif")) . '</td>';
         $form .= '</tr>';
         $form .= '<tr id="two_cards" style="display:none;">';
         $form .= '<td class="label"> </td><td>' . Xml::element('img', array('src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif")) . '</td>';
         $form .= '</tr>';
     } else {
         $form .= '<tr id="four_cards" style="display:none;">';
         $form .= '<td class="label"> </td><td>' . Xml::element('img', array('src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif")) . '</td>';
         $form .= '</tr>';
         $form .= '<tr id="two_cards" style="display:table-row;">';
         $form .= '<td class="label"> </td><td>' . Xml::element('img', array('src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif")) . '</td>';
         $form .= '</tr>';
     }
     // card number
     $form .= $this->getCardNumberField();
     // cvv
     $form .= $this->getCvvField();
     // expiry
     $form .= $this->getExpiryField();
     // street
     $form .= $this->getStreetField();
     // city
     $form .= $this->getCityField();
     // state
     $form .= $this->getStateField();
     // zip
     $form .= $this->getZipField();
     // country
     $form .= $this->getCountryField();
     return $form;
 }
Esempio n. 19
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;
    }
Esempio n. 20
0
function efCreateInCategoryForm($catpage)
{
    global $wgOut;
    $url = 'http://techteam-qa3.wikia.com/wiki/Special:CreateInCategory';
    $form = Xml::openElement('div', array('style' => 'float: right; padding: 1em; width: 33%', 'class' => 'toc'));
    $form .= Xml::element('div', array(), wfMsg('createincategory-prompt'));
    $form .= Xml::openElement('form', array('method' => 'post', 'action' => $url));
    $form .= Xml::input('wpTitle');
    $form .= Html::hidden('wpCategory', $catpage->mTitle->getText());
    $form .= Xml::submitButton(wfMsg('createincategory-submit'));
    $form .= Xml::closeElement('form');
    $form .= Xml::closeElement('div');
    $wgOut->addHtml($form);
    return true;
}
 /**
  * HTML for the top form
  * @param integer $namespace A namespace constant (default NS_MAIN).
  * @param string $from Article name we are starting listing at.
  */
 function namespaceForm($namespace = NS_MAIN, $from = '')
 {
     global $wgScript, $wgContLang;
     $t = SpecialPage::getTitleFor($this->name);
     $align = $wgContLang->isRtl() ? 'left' : 'right';
     $out = Xml::openElement('div', array('class' => 'namespaceoptions'));
     $out .= Xml::openElement('form', array('method' => 'get', 'action' => $wgScript));
     $out .= Xml::hidden('title', $t->getPrefixedText());
     $out .= Xml::openElement('table', array('id' => 'nsselect', 'class' => 'allpages'));
     $out .= "<tr>\n\t\t\t<td align='{$align}'>" . Xml::label(wfMsg($this->nsfromMsg), 'nsfrom') . "</td>\n\t\t\t<td>" . Xml::input('from', 20, $from, array('id' => 'nsfrom')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='{$align}'>" . Xml::label(wfMsg('namespace'), 'namespace') . "</td>\n\t\t\t<td>" . Xml::namespaceSelector($namespace, null) . Xml::submitButton(wfMsg('allpagessubmit')) . "</td>\n\t\t\t</tr>";
     $out .= Xml::closeElement('table');
     $out .= Xml::closeElement('form');
     $out .= Xml::closeElement('div');
     return $out;
 }
 /**
  * (non-PHPdoc)
  * @see includes/EnhancedChangesList#endRecentChangesList()
  */
 public function endRecentChangesList()
 {
     global $wgRequest;
     $collabWatchlist = $wgRequest->getIntOrNull('collabwatchlist');
     $result = '';
     $result .= parent::endRecentChangesList();
     $glWlIdAndName = $this->getCollabWatchlistIdAndName($this->user->getId());
     $result .= $this->collabWatchlistAndTagSelectors($glWlIdAndName, $collabWatchlist, null, 'collabwatchlist', wfMsg('collabwatchlist')) . '&nbsp;';
     $result .= Xml::label(wfMsg('collabwatchlisttagcomment'), 'tagcomment') . '&nbsp;' . Xml::input('tagcomment') . '&nbsp;';
     if ($this->user->useRCPatrol()) {
         $result .= Xml::checkLabel(wfMsg('collabwatchlistpatrol'), 'setpatrolled', 'setpatrolled', true) . '&nbsp;';
     }
     $result .= Xml::submitButton(wfMsg('collabwatchlistsettagbutton'));
     $result .= Xml::closeElement('form');
     return $result;
 }
Esempio n. 23
0
 function searchForm()
 {
     $output = Xml::element('legend', null, wfMsg('abusefilter-log-search'));
     $fields = array();
     // Search conditions
     $fields['abusefilter-log-search-user'] = Xml::input('wpSearchUser', 45, $this->mSearchUser);
     if (self::canSeeDetails()) {
         $fields['abusefilter-log-search-filter'] = Xml::input('wpSearchFilter', 45, $this->mSearchFilter);
     }
     $fields['abusefilter-log-search-title'] = Xml::input('wpSearchTitle', 45, $this->mSearchTitle);
     $form = Html::hidden('title', $this->getTitle()->getPrefixedText());
     $form .= Xml::buildForm($fields, 'abusefilter-log-search-submit');
     $output .= Xml::tags('form', array('method' => 'get', 'action' => $this->getTitle()->getLocalURL()), $form);
     $output = Xml::tags('fieldset', null, $output);
     $this->getOutput()->addHTML($output);
 }
 function showForm()
 {
     global $wgScript;
     $out = $this->getOutput();
     $username = str_replace('_', ' ', $this->target);
     $form = Xml::openElement('form', array('name' => 'stablization', 'action' => $wgScript, 'method' => 'get'));
     $form .= "<fieldset><legend>" . wfMsg('usercredentials-leg') . "</legend>";
     $form .= "<table><tr>";
     $form .= "<td>" . Html::Hidden('title', $this->getTitle()->getPrefixedText()) . "</td>";
     $form .= "<td>" . wfMsgHtml("usercredentials-user") . "</td>";
     $form .= "<td>" . Xml::input('target', 35, $username, array('id' => 'wpUsername')) . "</td>";
     $form .= "<td>" . Xml::submitButton(wfMsg('go')) . "</td>";
     $form .= "</tr></table>";
     $form .= "</fieldset></form>\n";
     $out->addHTML($form);
 }
 /**
  * HTML for the top form
  * @param integer $namespace A namespace constant (default NS_MAIN).
  * @param string $from dbKey we are starting listing at.
  * @param string $to dbKey we are ending listing at.
  */
 function namespaceForm($namespace = NS_MAIN, $from = '', $to = '')
 {
     global $wgScript;
     $t = $this->getTitle();
     $out = Xml::openElement('div', array('class' => 'namespaceoptions'));
     $out .= Xml::openElement('form', array('method' => 'get', 'action' => $wgScript));
     $out .= Xml::hidden('title', $t->getPrefixedText());
     $out .= Xml::openElement('fieldset');
     $out .= Xml::element('legend', null, wfMsg('allpages'));
     $out .= Xml::openElement('table', array('id' => 'nsselect', 'class' => 'allpages'));
     $out .= "<tr>\n\t<td class='mw-label'>" . Xml::label(wfMsg('allpagesfrom'), 'nsfrom') . "\t</td>\n\t<td class='mw-input'>" . Xml::input('from', 30, str_replace('_', ' ', $from), array('id' => 'nsfrom')) . "\t</td>\n</tr>\n<tr>\n\t<td class='mw-label'>" . Xml::label(wfMsg('allpagesto'), 'nsto') . "\t</td>\n\t\t\t<td class='mw-input'>" . Xml::input('to', 30, str_replace('_', ' ', $to), array('id' => 'nsto')) . "\t\t</td>\n</tr>\n<tr>\n\t<td class='mw-label'>" . Xml::label(wfMsg('namespace'), 'namespace') . "\t</td>\n\t\t\t<td class='mw-input'>" . Xml::namespaceSelector($namespace, null) . ' ' . Xml::submitButton(wfMsg('allpagessubmit')) . "\t</td>\n</tr>";
     $out .= Xml::closeElement('table');
     $out .= Xml::closeElement('fieldset');
     $out .= Xml::closeElement('form');
     $out .= Xml::closeElement('div');
     return $out;
 }
 function execute($par)
 {
     wfLoadExtensionMessages('LinkSearch');
     $this->setHeaders();
     list($limit, $offset) = wfCheckLimits();
     global $wgOut, $wgRequest, $wgUrlProtocols, $wgMiserMode;
     $target = $GLOBALS['wgRequest']->getVal('target', $par);
     $namespace = $GLOBALS['wgRequest']->getIntorNull('namespace', null);
     $protocols_list[] = '';
     foreach ($wgUrlProtocols as $prot) {
         $protocols_list[] = $prot;
     }
     $target2 = $target;
     $protocol = '';
     $pr_sl = strpos($target2, '//');
     $pr_cl = strpos($target2, ':');
     if ($pr_sl) {
         // For protocols with '//'
         $protocol = substr($target2, 0, $pr_sl + 2);
         $target2 = substr($target2, $pr_sl + 2);
     } elseif (!$pr_sl && $pr_cl) {
         // For protocols without '//' like 'mailto:'
         $protocol = substr($target2, 0, $pr_cl + 1);
         $target2 = substr($target2, $pr_cl + 1);
     } elseif ($protocol == '' && $target2 != '') {
         // default
         $protocol = 'http://';
     }
     if (!in_array($protocol, $protocols_list)) {
         // unsupported protocol, show original search request
         $target2 = $target;
         $protocol = '';
     }
     $self = Title::makeTitle(NS_SPECIAL, 'Linksearch');
     $wgOut->addWikiText(wfMsg('linksearch-text', '<nowiki>' . implode(', ', $wgUrlProtocols) . '</nowiki>'));
     $s = Xml::openElement('form', array('id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'])) . Xml::hidden('title', $self->getPrefixedDbKey()) . '<fieldset>' . Xml::element('legend', array(), wfMsg('linksearch')) . Xml::label(wfMsg('linksearch-pat'), 'target') . ' ' . Xml::input('target', 50, $target) . ' ';
     if (!$wgMiserMode) {
         $s .= Xml::label(wfMsg('linksearch-ns'), 'namespace') . ' ' . XML::namespaceSelector($namespace, '');
     }
     $s .= Xml::submitButton(wfMsg('linksearch-ok')) . '</fieldset>' . Xml::closeElement('form');
     $wgOut->addHtml($s);
     if ($target != '') {
         $searcher = new LinkSearchPage($target2, $namespace, $protocol);
         $searcher->doQuery($offset, $limit);
     }
 }
 function getPageHeader()
 {
     global $wgScript, $wgContLang;
     $prefix = $this->prefix;
     $t = SpecialPage::getTitleFor($this->getName());
     $align = $wgContLang->isRtl() ? 'left' : 'right';
     $s = '<p>' . wfMsgExt('withoutinterwiki-header', array('parseinline')) . '</p>';
     $s .= Xml::openElement('div', array('class' => 'namespaceoptions'));
     $s .= Xml::openElement('form', array('method' => 'get', 'action' => $wgScript));
     $s .= Xml::hidden('title', $t->getPrefixedText());
     $s .= Xml::openElement('table', array('id' => 'nsselect', 'class' => 'withoutinterwiki'));
     $s .= "<tr>\n\t\t\t\t<td align='{$align}'>" . Xml::label(wfMsg('allpagesprefix'), 'wiprefix') . "</td>\n\t\t\t\t<td>" . Xml::input('prefix', 20, htmlspecialchars($prefix), array('id' => 'wiprefix')) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align='{$align}'></td>\n\t\t\t\t<td>" . Xml::submitButton(wfMsgHtml('withoutinterwiki-submit')) . "</td>\n\t\t\t</tr>";
     $s .= Xml::closeElement('table');
     $s .= Xml::closeElement('form');
     $s .= Xml::closeElement('div');
     return $s;
 }
Esempio n. 28
0
 /**
  * HTML for the top form
  * @param integer $code A language code (default empty, example: 'en').
  * @param bool $suppressComplete If completely translated groups should be suppressed
  * @return string HTML
  */
 function languageForm($code = '', $suppressComplete = false, $suppressEmpty = false)
 {
     global $wgScript;
     $t = $this->getTitle();
     $out = Xml::openElement('div', array('class' => 'languagecode'));
     $out .= Xml::openElement('form', array('method' => 'get', 'action' => $wgScript));
     $out .= Html::hidden('title', $t->getPrefixedText());
     $out .= Xml::openElement('fieldset');
     $out .= Xml::element('legend', null, wfMsg('translate-language-code'));
     $out .= Xml::openElement('table', array('id' => 'langcodeselect', 'class' => 'allpages'));
     $out .= "<tr>\n\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('translate-language-code-field-name'), 'code') . "</td>\n\t\t\t\t<td class='mw-input'>" . Xml::input('code', 30, str_replace('_', ' ', $code), array('id' => 'code')) . "</td></tr><tr><td colspan='2'>" . Xml::checkLabel(wfMsg('translate-suppress-complete'), 'suppresscomplete', 'suppresscomplete', $suppressComplete) . Xml::checkLabel(wfMsg('translate-suppress-empty'), 'suppressempty', 'suppressempty', $suppressEmpty) . "</td>" . "</tr>" . "<tr>" . "<td class='mw-input'>" . Xml::submitButton(wfMsg('allpagessubmit')) . "</td>\n\t\t\t</tr>";
     $out .= Xml::closeElement('table');
     $out .= Xml::closeElement('fieldset');
     $out .= Xml::closeElement('form');
     $out .= Xml::closeElement('div');
     return $out;
 }
Esempio n. 29
0
function efAddToListRenderInput($input, $args, $parser, $frame)
{
    global $wgTitle, $wgScriptPath;
    $ret = '';
    $ret .= Xml::openElement('form', array('action' => $wgScriptPath, 'method' => 'POST'));
    $ret .= Xml::input('item');
    $ret .= Html::hidden('action', 'addtolist');
    $ret .= Html::hidden('timestamp', wfTimestampNow());
    // for edit conflicts
    $ret .= Html::hidden('title', $wgTitle->getDBKey());
    if (!empty($args['signature'])) {
        $ret .= Html::hidden('postfix', ' --~~~');
    }
    $ret .= Xml::submitButton('Add to list');
    $ret .= Xml::closeElement('form');
    return $ret;
}
Esempio n. 30
0
 function show()
 {
     $filter = $this->mPage->mFilter;
     global $wgUser, $wgRequest, $wgOut;
     $sk = $wgUser->getSkin();
     if (!$wgUser->isAllowed('abusefilter-revert')) {
         $wgOut->permissionRequired('abusefilter-revert');
         return;
     }
     $this->loadParameters();
     if ($this->attemptRevert()) {
         return;
     }
     $wgOut->addWikiMsg('abusefilter-revert-intro', $filter);
     $wgOut->setPageTitle(wfMsg('abusefilter-revert-title', $filter));
     // First, the search form.
     $searchFields = array();
     $searchFields['abusefilter-revert-filter'] = Xml::element('strong', null, $filter);
     $searchFields['abusefilter-revert-periodstart'] = Xml::input('wpPeriodStart', 45, $this->origPeriodStart);
     $searchFields['abusefilter-revert-periodend'] = Xml::input('wpPeriodEnd', 45, $this->origPeriodEnd);
     $searchForm = Xml::buildForm($searchFields, 'abusefilter-revert-search');
     $searchForm .= "\n" . Xml::hidden('submit', 1);
     $searchForm = Xml::tags('form', array('action' => $this->getTitle("revert/{$filter}")->getLocalURL(), 'method' => 'POST'), $searchForm);
     $searchForm = Xml::fieldset(wfMsg('abusefilter-revert-search-legend'), $searchForm);
     $wgOut->addHTML($searchForm);
     if ($this->mSubmit) {
         // Add a summary of everything that will be reversed.
         $wgOut->addWikiMsg('abusefilter-revert-preview-intro');
         // Look up all of them.
         $results = $this->doLookup();
         $list = array();
         foreach ($results as $result) {
             $displayActions = array();
             global $wgLang;
             $displayActions = array_map(array('AbuseFilter', 'getActionDisplay'), $result['actions']);
             $msg = wfMsgExt('abusefilter-revert-preview-item', array('parseinline', 'replaceafter'), array($wgLang->timeanddate($result['timestamp'], true), $sk->userLink($result['userid'], $result['user']), $result['action'], $sk->link($result['title']), $wgLang->commaList($displayActions), $sk->link(SpecialPage::getTitleFor('AbuseLog'), wfMsgNoTrans('abusefilter-log-detailslink'), array(), array('details' => $result['id']))));
             $list[] = Xml::tags('li', null, $msg);
         }
         $wgOut->addHTML(Xml::tags('ul', null, implode("\n", $list)));
         // Add a button down the bottom.
         $confirmForm = Xml::hidden('editToken', $wgUser->editToken("abusefilter-revert-{$filter}")) . Xml::hidden('title', $this->getTitle("revert/{$filter}")->getPrefixedText()) . Xml::hidden('wpPeriodStart', $this->origPeriodStart) . Xml::hidden('wpPeriodEnd', $this->origPeriodEnd) . Xml::inputLabel(wfMsg('abusefilter-revert-reasonfield'), 'wpReason', 'wpReason', 45) . "\n" . Xml::submitButton(wfMsg('abusefilter-revert-confirm'));
         $confirmForm = Xml::tags('form', array('action' => $this->getTitle("revert/{$filter}")->getLocalURL(), 'method' => 'post'), $confirmForm);
         $wgOut->addHTML($confirmForm);
     }
 }