当前位置: 首页>>代码示例>>PHP>>正文


PHP Xml::label方法代码示例

本文整理汇总了PHP中Xml::label方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::label方法的具体用法?PHP Xml::label怎么用?PHP Xml::label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Xml的用法示例。


在下文中一共展示了Xml::label方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: promptForm

 /**
  * 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'));
 }
开发者ID:jpena88,项目名称:mediawiki-dokku-deploy,代码行数:12,代码来源:Nuke_body.php

示例2: showForm

 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);
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:32,代码来源:PendingChanges_body.php

示例3: onSpecialListusersHeaderForm

	/**
	 * 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;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:11,代码来源:ListUsersTestWiki.php

示例4: getForm

 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;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:10,代码来源:RandomInCategory.body.php

示例5: getPageHeader

 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;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:10,代码来源:WantedPagesPageWikia.class.php

示例6: execute

 function execute($par)
 {
     global $wgUrlProtocols, $wgMiserMode;
     $this->setHeaders();
     $this->outputHeader();
     $out = $this->getOutput();
     $out->allowClickjacking();
     $request = $this->getRequest();
     $target = $request->getVal('target', $par);
     $namespace = $request->getIntorNull('namespace', null);
     $protocols_list = array();
     foreach ($wgUrlProtocols as $prot) {
         if ($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 ($protocol != '' && !in_array($protocol, $protocols_list)) {
         // unsupported protocol, show original search request
         $target2 = $target;
         $protocol = '';
     }
     $out->addWikiMsg('linksearch-text', '<nowiki>' . $this->getLang()->commaList($wgUrlProtocols) . '</nowiki>');
     $s = Xml::openElement('form', array('id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'])) . Html::hidden('title', $this->getTitle()->getPrefixedDbKey()) . '<fieldset>' . Xml::element('legend', array(), wfMsg('linksearch')) . Xml::inputLabel(wfMsg('linksearch-pat'), 'target', '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');
     $out->addHTML($s);
     if ($target != '') {
         $this->setParams(array('query' => $target2, 'namespace' => $namespace, 'protocol' => $protocol));
         parent::execute($par);
         if ($this->mMungedQuery === false) {
             $out->addWikiMsg('linksearch-error');
         }
     }
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:52,代码来源:SpecialLinkSearch.php

示例7: switchForm

 /**
  * 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");
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:16,代码来源:SpecialGlobalGroupMembership.php

示例8: buildForm

    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;
    }
开发者ID:rocLv,项目名称:conference,代码行数:14,代码来源:SpecialAllmessages.php

示例9: generateBillingFields

 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;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:50,代码来源:TwoStepTwoColumnLetter.php

示例10: buildForm

    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;
    }
开发者ID:paladox,项目名称:mediawiki,代码行数:14,代码来源:AllMessagesTablePager.php

示例11: execute

 function execute($par)
 {
     global $wgOut, $wgUser;
     $this->setHeaders();
     if (!$wgUser->isAllowed('stafflog')) {
         throw new PermissionsError('stafflog');
     }
     $pager = new StaffLoggerPager("");
     $sTypesDropDown = Xml::openElement('select', array('name' => 'type', 'id' => 'StaffLogFilterType'));
     foreach ($this->aTypes as $k => $v) {
         $sTypesDropDown .= Xml::option($v, $k, $k == $this->request->getText('type', ''));
     }
     $sTypesDropDown .= Xml::closeElement('select');
     $wgOut->addHTML(Xml::openElement('form', array('method' => 'get', 'action' => $this->getTitle()->getLocalURL())) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('stafflog-filter-label'), false) . Xml::inputLabel(wfMsg('stafflog-filter-user'), 'user', 'StaffLogFilterUser', false, htmlspecialchars($this->request->getText('user', ''), ENT_QUOTES, 'UTF-8')) . Xml::label(wfMsg('stafflog-filter-type'), 'StaffLogFilterType') . ' ' . $sTypesDropDown . ' ' . Xml::submitButton(wfMsg('stafflog-filter-apply')) . Xml::closeElement('fieldset') . Xml::closeElement('form') . Xml::openElement('div', array('class' => 'mw-spcontent')) . $pager->getNavigationBar() . '<ul>' . $pager->getBody() . '</ul>' . $pager->getNavigationBar() . Xml::closeElement('div'));
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:15,代码来源:StaffLog_body.php

示例12: translationFilterForm

	/**
	 * Hooks SpecialRecentChangesPanel. See the hook documentation for
	 * documentation of the function parameters.
	 *
	 * Adds a HTMl selector into $items
	 * @param $items
	 * @param $opts
	 * @return bool true
	 */
	public static function translationFilterForm( &$items, $opts ) {
		$opts->consumeValue( 'translations' );
		$default = $opts->getValue( 'translations' );

		$label = Xml::label( wfMsg( 'translate-rc-translation-filter' ), 'mw-translation-filter' );
		$select = new XmlSelect( 'translations', 'mw-translation-filter', $default );
		$select->addOption( wfMsg( 'translate-rc-translation-filter-no' ), 'noaction' );
		$select->addOption( wfMsg( 'translate-rc-translation-filter-only' ), 'only' );
		$select->addOption( wfMsg( 'translate-rc-translation-filter-filter' ), 'filter' );
		$select->addOption( wfMsg( 'translate-rc-translation-filter-site' ), 'site' );

		$items['translations'] = array( $label, $select->getHTML() );

		return true;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:24,代码来源:RcFilter.php

示例13: namespaceForm

 /**
  * 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;
 }
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:20,代码来源:SpecialAllpages.php

示例14: wfSpecialLinkSearch

/**
 * Special:LinkSearch to search the external-links table.
 */
function wfSpecialLinkSearch($par)
{
    list($limit, $offset) = wfCheckLimits();
    global $wgOut, $wgUrlProtocols, $wgMiserMode, $wgLang;
    $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->allowClickjacking();
    $wgOut->addWikiMsg('linksearch-text', '<nowiki>' . $wgLang->commaList($wgUrlProtocols) . '</nowiki>');
    $s = Xml::openElement('form', array('id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'])) . Html::hidden('title', $self->getPrefixedDbKey()) . '<fieldset>' . Xml::element('legend', array(), wfMsg('linksearch')) . Xml::inputLabel(wfMsg('linksearch-pat'), 'target', '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();
        $searcher->setParams(array('query' => $target2, 'namespace' => $namespace, 'protocol' => $protocol));
        $searcher->doQuery($offset, $limit);
    }
}
开发者ID:GodelDesign,项目名称:Godel,代码行数:49,代码来源:SpecialLinkSearch.php

示例15: languageForm

 /**
  * 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;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:23,代码来源:SpecialLanguageStats.php


注:本文中的Xml::label方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。