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


PHP Xml::option方法代码示例

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


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

示例1: getRatingTierMenu

	/**
	 * Get rating tier dropdown select
	 * @param int $selected, selected tier
	 * @return string
	 */	
	 public static function getRatingTierMenu( $selected = '' ) {
		$s  = "<label for='wpRatingTier'>" . wfMsgHtml('readerfeedback-tierfilter') . "</label>&#160;";
		$s .= Xml::openElement( 'select', array('name' => 'ratingtier', 'id' => 'wpRatingTier') );
		$s .= Xml::option( wfMsg( "readerfeedback-tier-high" ), 3, $selected===3);
		$s .= Xml::option( wfMsg( "readerfeedback-tier-medium" ), 2, $selected===2 );
		$s .= Xml::option( wfMsg( "readerfeedback-tier-poor" ), 1, $selected===1 );
		$s .= Xml::closeElement('select')."\n";
		return $s;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:14,代码来源:ReaderFeedbackXML.php

示例2: 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

示例3: 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

示例4: trailerForm

 public static function trailerForm(&$items, $opts)
 {
     $opts->consumeValue('trailer');
     global $wgRequest;
     $default = $wgRequest->getVal('trailer', '');
     global $wgLang;
     if (is_callable(array('LanguageNames', 'getNames'))) {
         $languages = LanguageNames::getNames($wgLang->getCode(), LanguageNames::FALLBACK_NORMAL, LanguageNames::LIST_MW);
     } else {
         $languages = Language::getLanguageNames(false);
     }
     ksort($languages);
     $options = Xml::option(wfMsg('cleanchanges-language-na'), '', $default === '');
     foreach ($languages as $code => $name) {
         $selected = "/{$code}" === $default;
         $options .= Xml::option("{$code} - {$name}", "/{$code}", $selected) . "\n";
     }
     $str = Xml::openElement('select', array('name' => 'trailer', 'class' => 'mw-language-selector', 'id' => 'sp-rc-language')) . $options . Xml::closeElement('select');
     $items['tailer'] = array(wfMsgHtml('cleanchanges-language'), $str);
     return true;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:21,代码来源:Filters.php

示例5: execute

 /**
  * This method actually generates the output
  * @return string HTML output
  */
 public function execute($param = false)
 {
     $sHeadline = wfMessage($this->getOption('i18nKeyName'))->plain();
     $help = Xml::element('span', array('style' => 'color: #777777; font-size: 10px;'), wfMessage('bs-extendedsearch-search-help-multiselect')->plain(), false);
     $sEntries = '';
     foreach ($this->entries as $datasetArray) {
         $bSelected = false;
         if (isset($datasetArray['selected']) && $datasetArray['selected'] === true) {
             $bSelected = true;
         }
         $sEntries .= Xml::option(htmlspecialchars($datasetArray['text'], ENT_QUOTES, 'UTF-8'), $datasetArray['value'], $bSelected);
     }
     $sFormSelect = Xml::openElement('select', array('name' => $this->getOption('urlFieldName'), 'multiple' => 'true', 'size' => 10, 'style' => 'width: 200px'));
     $sFormSelect .= $sEntries;
     $sFormSelect .= Xml::closeElement('select');
     $divBody = $sHeadline . '<br />' . $help . '<br />' . $sFormSelect;
     if (isset($this->dirtyAppended)) {
         $divBody .= $this->dirtyAppended;
     }
     $sOut = Xml::openElement('div', array('class' => 'bs-extendedsearch-multivaluefield')) . $divBody . Xml::closeElement('div');
     return $sOut;
 }
开发者ID:hfroese,项目名称:mediawiki-extensions-BlueSpiceExtensions,代码行数:26,代码来源:view.SearchMultivalueField.php

示例6: wfTimezone

function wfTimezone($input, array $args, Parser $parser, PPFrame $frame)
{
    //time to convert (format specified below)
    //$time = 'Tuesday, April 21, 2009 2:32:46 PM';
    $time = $args['time'];
    //time zone provided by the user
    $inputTz = $args['zone'];
    // create the DateTimeZone object
    $dtzone = new DateTimeZone($inputTz);
    // now create the DateTime object for this time and user time zone
    $dtime = new DateTime($time, $dtzone);
    // Get the timestamp
    $timestamp = $dtime->format('U');
    // create an array listing the time zones
    $timezones = array('Kwajalein' => '(GMT-12:00) International Date Line West', 'Pacific/Midway' => '(GMT-11:00) Midway Island', 'Pacific/Samoa' => '(GMT-11:00) Samoa', 'Pacific/Honolulu' => '(GMT-10:00) Hawaii', 'America/Anchorage' => '(GMT-09:00) Alaska', 'America/Los_Angeles' => '(GMT-08:00) Pacific Time (US &amp; Canada)', 'America/Tijuana' => '(GMT-08:00) Tijuana, Baja California', 'America/Denver' => '(GMT-07:00) Mountain Time (US &amp; Canada)', 'America/Chihuahua' => '(GMT-07:00) Chihuahua', 'America/Mazatlan' => '(GMT-07:00) Mazatlan', 'America/Phoenix' => '(GMT-07:00) Arizona', 'America/Regina' => '(GMT-06:00) Saskatchewan', 'America/Tegucigalpa' => '(GMT-06:00) Central America', 'America/Chicago' => '(GMT-06:00) Central Time (US &amp; Canada)', 'America/Mexico_City' => '(GMT-06:00) Mexico City', 'America/Monterrey' => '(GMT-06:00) Monterrey', 'America/New_York' => '(GMT-05:00) Eastern Time (US &amp; Canada)', 'America/Bogota' => '(GMT-05:00) Bogota', 'America/Lima' => '(GMT-05:00) Lima', 'America/Rio_Branco' => '(GMT-05:00) Rio Branco', 'America/Indiana/Indianapolis' => '(GMT-05:00) Indiana (East)', 'America/Caracas' => '(GMT-04:30) Caracas', 'America/Halifax' => '(GMT-04:00) Atlantic Time (Canada)', 'America/Manaus' => '(GMT-04:00) Manaus', 'America/Santiago' => '(GMT-04:00) Santiago', 'America/La_Paz' => '(GMT-04:00) La Paz', 'America/St_Johns' => '(GMT-03:30) Newfoundland', 'America/Argentina/Buenos_Aires' => '(GMT-03:00) Georgetown', 'America/Sao_Paulo' => '(GMT-03:00) Brasilia', 'America/Godthab' => '(GMT-03:00) Greenland', 'America/Montevideo' => '(GMT-03:00) Montevideo', 'Atlantic/South_Georgia' => '(GMT-02:00) Mid-Atlantic', 'Atlantic/Azores' => '(GMT-01:00) Azores', 'Atlantic/Cape_Verde' => '(GMT-01:00) Cape Verde Is.', 'Europe/Dublin' => '(GMT) Dublin', 'Europe/Lisbon' => '(GMT) Lisbon', 'Europe/London' => '(GMT) London', 'Africa/Monrovia' => '(GMT) Monrovia', 'Atlantic/Reykjavik' => '(GMT) Reykjavik', 'Africa/Casablanca' => '(GMT) Casablanca', 'Europe/Belgrade' => '(GMT+01:00) Belgrade', 'Europe/Bratislava' => '(GMT+01:00) Bratislava', 'Europe/Budapest' => '(GMT+01:00) Budapest', 'Europe/Ljubljana' => '(GMT+01:00) Ljubljana', 'Europe/Prague' => '(GMT+01:00) Prague', 'Europe/Sarajevo' => '(GMT+01:00) Sarajevo', 'Europe/Skopje' => '(GMT+01:00) Skopje', 'Europe/Warsaw' => '(GMT+01:00) Warsaw', 'Europe/Zagreb' => '(GMT+01:00) Zagreb', 'Europe/Brussels' => '(GMT+01:00) Brussels', 'Europe/Copenhagen' => '(GMT+01:00) Copenhagen', 'Europe/Madrid' => '(GMT+01:00) Madrid', 'Europe/Paris' => '(GMT+01:00) Paris', 'Africa/Algiers' => '(GMT+01:00) West Central Africa', 'Europe/Amsterdam' => '(GMT+01:00) Amsterdam', 'Europe/Berlin' => '(GMT+01:00) Berlin', 'Europe/Rome' => '(GMT+01:00) Rome', 'Europe/Stockholm' => '(GMT+01:00) Stockholm', 'Europe/Vienna' => '(GMT+01:00) Vienna', 'Europe/Minsk' => '(GMT+02:00) Minsk', 'Africa/Cairo' => '(GMT+02:00) Cairo', 'Europe/Helsinki' => '(GMT+02:00) Helsinki', 'Europe/Riga' => '(GMT+02:00) Riga', 'Europe/Sofia' => '(GMT+02:00) Sofia', 'Europe/Tallinn' => '(GMT+02:00) Tallinn', 'Europe/Vilnius' => '(GMT+02:00) Vilnius', 'Europe/Athens' => '(GMT+02:00) Athens', 'Europe/Bucharest' => '(GMT+02:00) Bucharest', 'Europe/Istanbul' => '(GMT+02:00) Istanbul', 'Asia/Jerusalem' => '(GMT+02:00) Jerusalem', 'Asia/Amman' => '(GMT+02:00) Amman', 'Asia/Beirut' => '(GMT+02:00) Beirut', 'Africa/Windhoek' => '(GMT+02:00) Windhoek', 'Africa/Harare' => '(GMT+02:00) Harare', 'Asia/Kuwait' => '(GMT+03:00) Kuwait', 'Asia/Riyadh' => '(GMT+03:00) Riyadh', 'Asia/Baghdad' => '(GMT+03:00) Baghdad', 'Africa/Nairobi' => '(GMT+03:00) Nairobi', 'Asia/Tbilisi' => '(GMT+03:00) Tbilisi', 'Europe/Moscow' => '(GMT+03:00) Moscow', 'Europe/Volgograd' => '(GMT+03:00) Volgograd', 'Asia/Tehran' => '(GMT+03:30) Tehran', 'Asia/Muscat' => '(GMT+04:00) Muscat', 'Asia/Baku' => '(GMT+04:00) Baku', 'Asia/Yerevan' => '(GMT+04:00) Yerevan', 'Asia/Yekaterinburg' => '(GMT+05:00) Ekaterinburg', 'Asia/Karachi' => '(GMT+05:00) Karachi', 'Asia/Tashkent' => '(GMT+05:00) Tashkent', 'Asia/Kolkata' => '(GMT+05:30) Calcutta', 'Asia/Colombo' => '(GMT+05:30) Sri Jayawardenepura', 'Asia/Katmandu' => '(GMT+05:45) Kathmandu', 'Asia/Dhaka' => '(GMT+06:00) Dhaka', 'Asia/Almaty' => '(GMT+06:00) Almaty', 'Asia/Novosibirsk' => '(GMT+06:00) Novosibirsk', 'Asia/Rangoon' => '(GMT+06:30) Yangon (Rangoon)', 'Asia/Krasnoyarsk' => '(GMT+07:00) Krasnoyarsk', 'Asia/Bangkok' => '(GMT+07:00) Bangkok', 'Asia/Jakarta' => '(GMT+07:00) Jakarta', 'Asia/Brunei' => '(GMT+08:00) Beijing', 'Asia/Chongqing' => '(GMT+08:00) Chongqing', 'Asia/Hong_Kong' => '(GMT+08:00) Hong Kong', 'Asia/Urumqi' => '(GMT+08:00) Urumqi', 'Asia/Irkutsk' => '(GMT+08:00) Irkutsk', 'Asia/Ulaanbaatar' => '(GMT+08:00) Ulaan Bataar', 'Asia/Kuala_Lumpur' => '(GMT+08:00) Kuala Lumpur', 'Asia/Singapore' => '(GMT+08:00) Singapore', 'Asia/Taipei' => '(GMT+08:00) Taipei', 'Australia/Perth' => '(GMT+08:00) Perth', 'Asia/Seoul' => '(GMT+09:00) Seoul', 'Asia/Tokyo' => '(GMT+09:00) Tokyo', 'Asia/Yakutsk' => '(GMT+09:00) Yakutsk', 'Australia/Darwin' => '(GMT+09:30) Darwin', 'Australia/Adelaide' => '(GMT+09:30) Adelaide', 'Australia/Canberra' => '(GMT+10:00) Canberra', 'Australia/Melbourne' => '(GMT+10:00) Melbourne', 'Australia/Sydney' => '(GMT+10:00) Sydney', 'Australia/Brisbane' => '(GMT+10:00) Brisbane', 'Australia/Hobart' => '(GMT+10:00) Hobart', 'Asia/Vladivostok' => '(GMT+10:00) Vladivostok', 'Pacific/Guam' => '(GMT+10:00) Guam', 'Pacific/Port_Moresby' => '(GMT+10:00) Port Moresby', 'Asia/Magadan' => '(GMT+11:00) Magadan', 'Pacific/Fiji' => '(GMT+12:00) Fiji', 'Asia/Kamchatka' => '(GMT+12:00) Kamchatka', 'Pacific/Auckland' => '(GMT+12:00) Auckland', 'Pacific/Tongatapu' => '(GMT+13:00) Nukualofa');
    $html = Xml::openElement('select', array('name' => 'tz'));
    foreach ($timezones as $tz => $tzDescription) {
        // create the DateTimeZone object
        $dtzone = new DateTimeZone($tz);
        // first convert the timestamp into a string representing the local time
        $time = date('r', $timestamp);
        // now create the DateTime object for this time
        $dtime = new DateTime($time);
        // convert this to the specific timezone using the DateTimeZone object
        $dtime->setTimeZone($dtzone);
        // print the time using your preferred format
        // TODO add new formats
        $time = $dtime->format('g:i A m/d/y');
        if ($tz == $inputTz) {
            $html .= Xml::option($tz . ' ' . $time, $tzDescription, true);
        } else {
            $html .= Xml::option($tz . ' ' . $time, $tzDescription, false);
        }
    }
    $html .= Xml::closeElement('select');
    return $html;
}
开发者ID:aahashderuffy,项目名称:extensions,代码行数:37,代码来源:AllTimeZones.php

示例7: addOption

 public function addOption($name, $value = false)
 {
     // Stab stab stab
     $value = $value !== false ? $value : $name;
     $this->options[] = Xml::option($name, $value, $value === $this->default);
 }
开发者ID:CristianOspinaOspina,项目名称:testlinkpruebas,代码行数:6,代码来源:Xml.php

示例8: tagSelector

 /**
  * Build a drop-down box for selecting a collaborative watchlist tag
  *
  * @param array $rlIds A list of collaborative watchlist ids
  * @param String $label The label for the select tag
  * @param String $elemId The id of the select tag
  * @return String A string containing HTML
  */
 public static function tagSelector($rlIds, $label = '', $elemId = 'mw-collaborative-watchlist-addtag-selector')
 {
     global $wgContLang;
     $tagsAndInfo = CollabWatchlistChangesList::getValidTagsAndInfo($rlIds);
     $optionsAll = array();
     $options = array();
     foreach ($tagsAndInfo as $tagName => $info) {
         $optionsAll[] = Xml::option($tagName . ' ' . $info['rt_description'], $tagName);
         foreach ($info['cw_ids'] as $rlId) {
             $options[$rlId][] = Xml::option($tagName, $tagName);
         }
     }
     $ret = Xml::openElement('select', array('id' => $elemId, 'name' => 'collabwatchlisttag', 'class' => 'mw-collaborative-watchlist-tag-selector')) . implode("\n", $optionsAll) . Xml::closeElement('select');
     if (!is_null($label)) {
         $ret = Xml::label($label, $elemId) . '&nbsp;' . $ret;
     }
     foreach ($options as $rlId => $optionsRl) {
         $ret .= Xml::openElement('select', array('style' => 'display: none;', 'id' => $elemId . '-' . $rlId, 'name' => 'collabwatchlisttag-rl', 'class' => 'mw-collaborative-watchlist-tag-selector')) . implode("\n", $optionsRl) . Xml::closeElement('select');
     }
     $ret .= Xml::openElement('select', array('style' => 'display: none;', 'id' => $elemId . '-empty', 'name' => 'collabwatchlisttag-rl', 'class' => 'mw-collaborative-watchlist-tag-selector')) . Xml::closeElement('select');
     return $ret;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:30,代码来源:CollabWatchlistChangesList.php

示例9: showForm

 private function showForm()
 {
     global $wgImportSources, $wgExportMaxLinkDepth;
     $action = $this->getTitle()->getLocalUrl(array('action' => 'submit'));
     $user = $this->getUser();
     $out = $this->getOutput();
     if ($user->isAllowed('importupload')) {
         $out->addHTML(Xml::fieldset($this->msg('import-upload')->text()) . Xml::openElement('form', array('enctype' => 'multipart/form-data', 'method' => 'post', 'action' => $action, 'id' => 'mw-import-upload-form')) . $this->msg('importtext')->parseAsBlock() . Html::hidden('action', 'submit') . Html::hidden('source', 'upload') . Xml::openElement('table', array('id' => 'mw-import-table')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-upload-filename')->text(), 'xmlimport') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('xmlimport', 50, '', array('type' => 'file')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-comment')->text(), 'mw-import-comment') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('log-comment', 50, '', array('id' => 'mw-import-comment', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-rootpage')->text(), 'mw-interwiki-rootpage') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('rootpage', 50, $this->rootpage, array('id' => 'mw-interwiki-rootpage', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($this->msg('uploadbtn')->text()) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . Html::hidden('editToken', $user->getEditToken()) . Xml::closeElement('form') . Xml::closeElement('fieldset'));
     } else {
         if (empty($wgImportSources)) {
             $out->addWikiMsg('importnosources');
         }
     }
     if ($user->isAllowed('import') && !empty($wgImportSources)) {
         # Show input field for import depth only if $wgExportMaxLinkDepth > 0
         $importDepth = '';
         if ($wgExportMaxLinkDepth > 0) {
             $importDepth = "<tr>\n\t\t\t\t\t\t\t<td class='mw-label'>" . $this->msg('export-pagelinks')->parse() . "</td>\n\t\t\t\t\t\t\t<td class='mw-input'>" . Xml::input('pagelink-depth', 3, 0) . "</td>\n\t\t\t\t\t\t</tr>";
         }
         $out->addHTML(Xml::fieldset($this->msg('importinterwiki')->text()) . Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form')) . $this->msg('import-interwiki-text')->parseAsBlock() . Html::hidden('action', 'submit') . Html::hidden('source', 'interwiki') . Html::hidden('editToken', $user->getEditToken()) . Xml::openElement('table', array('id' => 'mw-import-table')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-source')->text(), 'interwiki') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::openElement('select', array('name' => 'interwiki')));
         foreach ($wgImportSources as $prefix) {
             $selected = $this->interwiki === $prefix ? ' selected="selected"' : '';
             $out->addHTML(Xml::option($prefix, $prefix, $selected));
         }
         $out->addHTML(Xml::closeElement('select') . Xml::input('frompage', 50, $this->frompage) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel($this->msg('import-interwiki-history')->text(), 'interwikiHistory', 'interwikiHistory', $this->history) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel($this->msg('import-interwiki-templates')->text(), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t{$importDepth}\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-namespace')->text(), 'namespace') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Html::namespaceSelector(array('selected' => $this->namespace, 'all' => ''), array('name' => 'namespace', 'id' => 'namespace', 'class' => 'namespaceselector')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-comment')->text(), 'mw-interwiki-comment') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('log-comment', 50, '', array('id' => 'mw-interwiki-comment', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label($this->msg('import-interwiki-rootpage')->text(), 'mw-interwiki-rootpage') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('rootpage', 50, $this->rootpage, array('id' => 'mw-interwiki-rootpage', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton($this->msg('import-interwiki-submit')->text(), Linker::tooltipAndAccesskeyAttribs('import')) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('form') . Xml::closeElement('fieldset'));
     }
 }
开发者ID:nalwayaabhishek,项目名称:MediaWiki,代码行数:27,代码来源:SpecialImport.php

示例10: getLevelMenu

 /**
  * Creates the input label of the restriction level
  * @param string $pr_level Protection level
  * @return string Formatted HTML
  */
 protected function getLevelMenu($pr_level)
 {
     // Temporary array
     $m = array($this->msg('restriction-level-all')->text() => 0);
     $options = array();
     // First pass to load the log names
     foreach ($this->getConfig()->get('RestrictionLevels') as $type) {
         // Messages used can be 'restriction-level-sysop' and 'restriction-level-autoconfirmed'
         if ($type != '' && $type != '*') {
             $text = $this->msg("restriction-level-{$type}")->text();
             $m[$text] = $type;
         }
     }
     // Third pass generates sorted XHTML content
     foreach ($m as $text => $type) {
         $selected = $type == $pr_level;
         $options[] = Xml::option($text, $type, $selected);
     }
     return '<span class="mw-input-with-label">' . Xml::label($this->msg('restriction-level')->text(), $this->IdLevel) . ' ' . Xml::tags('select', array('id' => $this->IdLevel, 'name' => $this->IdLevel), implode("\n", $options)) . "</span>";
 }
开发者ID:huatuoorg,项目名称:mediawiki,代码行数:25,代码来源:SpecialProtectedpages.php

示例11: showInfo

 /**
  * Retrieves and shows the gathered info to the user
  * @param $target Mixed: user whose info we're looking up
  * @param $emailUser String: e-mail address (like example@example.com)
  */
 function showInfo($target, $emailUser = '')
 {
     global $wgOut, $wgLang, $wgScript;
     $count = 0;
     $users = array();
     $userTarget = '';
     // Look for @ in username
     if (strpos($target, '@') !== false) {
         // Find username by email
         $emailUser = htmlspecialchars($emailUser);
         $dbr = wfGetDB(DB_SLAVE);
         $res = $dbr->select('user', array('user_name'), array('user_email' => $target), __METHOD__);
         $loop = 0;
         foreach ($res as $row) {
             if ($loop === 0) {
                 $userTarget = $row->user_name;
             }
             if (!empty($emailUser) && $emailUser == $row->user_name) {
                 $userTarget = $emailUser;
             }
             $users[] = $row->user_name;
             $loop++;
         }
         $count = $loop;
     }
     $ourUser = !empty($userTarget) ? $userTarget : $target;
     $user = User::newFromName($ourUser);
     if ($user == null || $user->getId() == 0) {
         $wgOut->addWikiText('<span class="error">' . wfMsg('lookupuser-nonexistent', $target) . '</span>');
     } else {
         # Multiple matches?
         if ($count > 1) {
             $options = array();
             if (!empty($users) && is_array($users)) {
                 foreach ($users as $id => $userName) {
                     $options[] = Xml::option($userName, $userName, $userName == $userTarget);
                 }
             }
             $selectForm = "\n" . Xml::openElement('select', array('id' => 'email_user', 'name' => 'email_user'));
             $selectForm .= "\n" . implode("\n", $options) . "\n";
             $selectForm .= Xml::closeElement('select') . "\n";
             $wgOut->addHTML(Xml::openElement('fieldset') . "\n" . Xml::openElement('form', array('method' => 'get', 'action' => $wgScript)) . "\n" . Html::hidden('title', $this->getTitle()->getPrefixedText()) . "\n" . Html::hidden('target', $target) . "\n" . Xml::openElement('table', array('border' => '0')) . "\n" . Xml::openElement('tr') . "\n" . Xml::openElement('td', array('align' => 'right')) . wfMsgHtml('lookupuser-foundmoreusers') . Xml::closeElement('td') . "\n" . Xml::openElement('td', array('align' => 'left')) . "\n" . $selectForm . Xml::closeElement('td') . "\n" . Xml::openElement('td', array('colspan' => '2', 'align' => 'center')) . Xml::submitButton(wfMsgHtml('go')) . Xml::closeElement('td') . "\n" . Xml::closeElement('tr') . "\n" . Xml::closeElement('table') . "\n" . Xml::closeElement('form') . "\n" . Xml::closeElement('fieldset'));
         }
         $authTs = $user->getEmailAuthenticationTimestamp();
         if ($authTs) {
             $authenticated = wfMsg('lookupuser-authenticated', $wgLang->timeanddate($authTs));
         } else {
             $authenticated = wfMsg('lookupuser-not-authenticated');
         }
         $optionsString = '';
         foreach ($user->getOptions() as $name => $value) {
             $optionsString .= "{$name} = {$value} <br />";
         }
         $name = $user->getName();
         if ($user->getEmail()) {
             $email = $user->getEmail();
         } else {
             $email = wfMsg('lookupuser-no-email');
         }
         if ($user->getRegistration()) {
             $registration = $wgLang->timeanddate($user->getRegistration());
         } else {
             $registration = wfMsg('lookupuser-no-registration');
         }
         $wgOut->addWikiText('*' . wfMsg('username') . ' [[User:' . $name . '|' . $name . ']] (' . $wgLang->pipeList(array('[[User talk:' . $name . '|' . wfMsg('talkpagelinktext') . ']]', '[[Special:Contributions/' . $name . '|' . wfMsg('contribslink') . ']])')));
         $wgOut->addWikiText('*' . wfMsg('lookupuser-id', $user->getId()));
         $wgOut->addWikiText('*' . wfMsg('lookupuser-email', $email, $name));
         $wgOut->addWikiText('*' . wfMsg('lookupuser-realname', $user->getRealName()));
         $wgOut->addWikiText('*' . wfMsg('lookupuser-registration', $registration));
         $wgOut->addWikiText('*' . wfMsg('lookupuser-touched', $wgLang->timeanddate($user->mTouched)));
         $wgOut->addWikiText('*' . wfMsg('lookupuser-info-authenticated', $authenticated));
         $wgOut->addWikiText('*' . wfMsg('lookupuser-useroptions') . '<br />' . $optionsString);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:79,代码来源:LookupUser.body.php

示例12: buildSelector

 /**
  * Build protection level selector
  *
  * @param string $action action to protect
  * @param string $selected current protection level
  * @return String: HTML fragment
  */
 function buildSelector($action, $selected)
 {
     global $wgUser;
     // If the form is disabled, display all relevant levels. Otherwise,
     // just show the ones this user can use.
     $levels = MWNamespace::getRestrictionLevels($this->mTitle->getNamespace(), $this->disabled ? null : $wgUser);
     $id = 'mwProtect-level-' . $action;
     $attribs = array('id' => $id, 'name' => $id, 'size' => count($levels), 'onchange' => 'ProtectionForm.updateLevels(this)') + $this->disabledAttrib;
     $out = Xml::openElement('select', $attribs);
     foreach ($levels as $key) {
         $out .= Xml::option($this->getOptionLabel($key), $key, $key == $selected);
     }
     $out .= Xml::closeElement('select');
     return $out;
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:22,代码来源:ProtectionForm.php

示例13: getLevelMenu

	/**
	 * @param string $pr_level Determines which option is selected as default
	 * @return string Formatted HTML
	 * @private
	 */
	function getLevelMenu( $pr_level ) {
		global $wgRestrictionLevels;

		// Temporary array
		$m = array( $this->msg( 'restriction-level-all' )->text() => 0 );
		$options = array();

		// First pass to load the log names
		foreach ( $wgRestrictionLevels as $type ) {
			if ( $type != '' && $type != '*' ) {
				// Messages: restriction-level-sysop, restriction-level-autoconfirmed
				$text = $this->msg( "restriction-level-$type" )->text();
				$m[$text] = $type;
			}
		}

		// Is there only one level (aside from "all")?
		if ( count( $m ) <= 2 ) {
			return '';
		}
		// Third pass generates sorted XHTML content
		foreach ( $m as $text => $type ) {
			$selected = ( $type == $pr_level );
			$options[] = Xml::option( $text, $type, $selected );
		}

		return Xml::label( $this->msg( 'restriction-level' )->text(), $this->IdLevel ) . '&#160;' .
			Xml::tags( 'select',
				array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ),
				implode( "\n", $options ) );
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:36,代码来源:SpecialProtectedtitles.php

示例14: showForm

 private function showForm()
 {
     global $wgUser, $wgOut, $wgRequest, $wgTitle, $wgImportSources, $wgExportMaxLinkDepth;
     if (!$wgUser->isAllowed('import') && !$wgUser->isAllowed('importupload')) {
         return $wgOut->permissionRequired('import');
     }
     $action = $wgTitle->getLocalUrl('action=submit');
     if ($wgUser->isAllowed('importupload')) {
         $wgOut->addWikiMsg("importtext");
         $wgOut->addHTML(Xml::fieldset(wfMsg('import-upload')) . Xml::openElement('form', array('enctype' => 'multipart/form-data', 'method' => 'post', 'action' => $action, 'id' => 'mw-import-upload-form')) . Xml::hidden('action', 'submit') . Xml::hidden('source', 'upload') . Xml::openElement('table', array('id' => 'mw-import-table')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('import-upload-filename'), 'xmlimport') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('xmlimport', 50, '', array('type' => 'file')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('import-comment'), 'mw-import-comment') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('log-comment', 50, '', array('id' => 'mw-import-comment', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton(wfMsg('uploadbtn')) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . Xml::hidden('editToken', $wgUser->editToken()) . Xml::closeElement('form') . Xml::closeElement('fieldset'));
     } else {
         if (empty($wgImportSources)) {
             $wgOut->addWikiMsg('importnosources');
         }
     }
     if ($wgUser->isAllowed('import') && !empty($wgImportSources)) {
         # Show input field for import depth only if $wgExportMaxLinkDepth > 0
         $importDepth = '';
         if ($wgExportMaxLinkDepth > 0) {
             $importDepth = "<tr>\n\t\t\t\t\t\t\t<td class='mw-label'>" . wfMsgExt('export-pagelinks', 'parseinline') . "</td>\n\t\t\t\t\t\t\t<td class='mw-input'>" . Xml::input('pagelink-depth', 3, 0) . "</td>\n\t\t\t\t\t\t</tr>";
         }
         $wgOut->addHTML(Xml::fieldset(wfMsg('importinterwiki')) . Xml::openElement('form', array('method' => 'post', 'action' => $action, 'id' => 'mw-import-interwiki-form')) . wfMsgExt('import-interwiki-text', array('parse')) . Xml::hidden('action', 'submit') . Xml::hidden('source', 'interwiki') . Xml::hidden('editToken', $wgUser->editToken()) . Xml::openElement('table', array('id' => 'mw-import-table')) . "<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('import-interwiki-source'), 'interwiki') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::openElement('select', array('name' => 'interwiki')));
         foreach ($wgImportSources as $prefix) {
             $selected = $this->interwiki === $prefix ? ' selected="selected"' : '';
             $wgOut->addHTML(Xml::option($prefix, $prefix, $selected));
         }
         $wgOut->addHTML(Xml::closeElement('select') . Xml::input('frompage', 50, $this->frompage) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('import-interwiki-history'), 'interwikiHistory', 'interwikiHistory', $this->history) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('import-interwiki-templates'), 'interwikiTemplates', 'interwikiTemplates', $this->includeTemplates) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t{$importDepth}\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('import-interwiki-namespace'), 'namespace') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::namespaceSelector($this->namespace, '') . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='mw-label'>" . Xml::label(wfMsg('import-comment'), 'mw-interwiki-comment') . "</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::input('log-comment', 50, '', array('id' => 'mw-interwiki-comment', 'type' => 'text')) . ' ' . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td class='mw-submit'>" . Xml::submitButton(wfMsg('import-interwiki-submit'), array('accesskey' => 's')) . "</td>\n\t\t\t\t</tr>" . Xml::closeElement('table') . Xml::closeElement('form') . Xml::closeElement('fieldset'));
     }
 }
开发者ID:ruizrube,项目名称:spdef,代码行数:29,代码来源:SpecialImport.php

示例15: showForm

 public function showForm($err)
 {
     global $wgOut, $wgUser, $wgSysopUserBans;
     $wgOut->setPageTitle(wfMsg('blockip-title'));
     $wgOut->addWikiMsg('blockiptext');
     if ($wgSysopUserBans) {
         $mIpaddress = Xml::label(wfMsg('ipadressorusername'), 'mw-bi-target');
     } else {
         $mIpaddress = Xml::label(wfMsg('ipaddress'), 'mw-bi-target');
     }
     $mIpbexpiry = Xml::label(wfMsg('ipbexpiry'), 'wpBlockExpiry');
     $mIpbother = Xml::label(wfMsg('ipbother'), 'mw-bi-other');
     $mIpbreasonother = Xml::label(wfMsg('ipbreason'), 'wpBlockReasonList');
     $mIpbreason = Xml::label(wfMsg('ipbotherreason'), 'mw-bi-reason');
     $titleObj = SpecialPage::getTitleFor('Blockip');
     $user = User::newFromName($this->BlockAddress);
     $alreadyBlocked = false;
     $otherBlockedMsgs = array();
     if ($err && $err[0] != 'ipb_already_blocked') {
         $key = array_shift($err);
         $msg = wfMsgReal($key, $err);
         $wgOut->setSubtitle(wfMsgHtml('formerror'));
         $wgOut->addHTML(Xml::tags('p', array('class' => 'error'), $msg));
     } elseif ($this->BlockAddress) {
         # Get other blocks, i.e. from GlobalBlocking or TorBlock extension
         wfRunHooks('OtherBlockLogLink', array(&$otherBlockedMsgs, $this->BlockAddress));
         $userId = is_object($user) ? $user->getId() : 0;
         $currentBlock = Block::newFromDB($this->BlockAddress, $userId);
         if (!is_null($currentBlock) && !$currentBlock->mAuto && ($currentBlock->mRangeStart == $currentBlock->mRangeEnd || $currentBlock->mAddress == $this->BlockAddress)) {
             $alreadyBlocked = true;
             # Set the block form settings to the existing block
             if (!$this->wasPosted) {
                 $this->BlockAnonOnly = $currentBlock->mAnonOnly;
                 $this->BlockCreateAccount = $currentBlock->mCreateAccount;
                 $this->BlockEnableAutoblock = $currentBlock->mEnableAutoblock;
                 $this->BlockEmail = $currentBlock->mBlockEmail;
                 $this->BlockHideName = $currentBlock->mHideName;
                 $this->BlockAllowUsertalk = $currentBlock->mAllowUsertalk;
                 if ($currentBlock->mExpiry == 'infinity') {
                     $this->BlockOther = 'indefinite';
                 } else {
                     $this->BlockOther = wfTimestamp(TS_ISO_8601, $currentBlock->mExpiry);
                 }
                 $this->BlockReason = $currentBlock->mReason;
             }
         }
     }
     # Show other blocks from extensions, i.e. GlockBlocking and TorBlock
     if (count($otherBlockedMsgs)) {
         $wgOut->addHTML(Html::rawElement('h2', array(), wfMsgExt('ipb-otherblocks-header', 'parseinline', count($otherBlockedMsgs))) . "\n");
         $list = '';
         foreach ($otherBlockedMsgs as $link) {
             $list .= Html::rawElement('li', array(), $link) . "\n";
         }
         $wgOut->addHTML(Html::rawElement('ul', array('class' => 'mw-blockip-alreadyblocked'), $list) . "\n");
     }
     # Username/IP is blocked already locally
     if ($alreadyBlocked) {
         $wgOut->addWikiMsg('ipb-needreblock', $this->BlockAddress);
     }
     $scBlockExpiryOptions = wfMsgForContent('ipboptions');
     $showblockoptions = $scBlockExpiryOptions != '-';
     if (!$showblockoptions) {
         $mIpbother = $mIpbexpiry;
     }
     $blockExpiryFormOptions = Xml::option(wfMsg('ipbotheroption'), 'other');
     foreach (explode(',', $scBlockExpiryOptions) as $option) {
         if (strpos($option, ':') === false) {
             $option = "{$option}:{$option}";
         }
         list($show, $value) = explode(':', $option);
         $show = htmlspecialchars($show);
         $value = htmlspecialchars($value);
         $blockExpiryFormOptions .= Xml::option($show, $value, $this->BlockExpiry === $value ? true : false) . "\n";
     }
     $reasonDropDown = Xml::listDropDown('wpBlockReasonList', wfMsgForContent('ipbreason-dropdown'), wfMsgForContent('ipbreasonotherlist'), $this->BlockReasonList, 'wpBlockDropDown', 4);
     global $wgStylePath, $wgStyleVersion;
     $wgOut->addHTML(Xml::tags('script', array('type' => 'text/javascript', 'src' => "{$wgStylePath}/common/block.js?{$wgStyleVersion}"), '') . Xml::openElement('form', array('method' => 'post', 'action' => $titleObj->getLocalURL('action=submit'), 'id' => 'blockip')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('blockip-legend')) . Xml::openElement('table', array('border' => '0', 'id' => 'mw-blockip-table')) . "<tr>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpaddress}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>" . Html::input('wpBlockAddress', $this->BlockAddress, 'text', array('tabindex' => '1', 'id' => 'mw-bi-target', 'onchange' => 'updateBlockOptions()', 'size' => '45', 'required' => '') + ($this->BlockAddress ? array() : array('autofocus'))) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>");
     if ($showblockoptions) {
         $wgOut->addHTML("\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpbexpiry}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>" . Xml::tags('select', array('id' => 'wpBlockExpiry', 'name' => 'wpBlockExpiry', 'onchange' => 'considerChangingExpiryFocus()', 'tabindex' => '2'), $blockExpiryFormOptions) . "</td>");
     }
     $wgOut->addHTML("\n\t\t\t</tr>\n\t\t\t<tr id='wpBlockOther'>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpbother}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>" . Xml::input('wpBlockOther', 45, $this->BlockOther, array('tabindex' => '3', 'id' => 'mw-bi-other')) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpbreasonother}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>\n\t\t\t\t\t{$reasonDropDown}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id=\"wpBlockReason\">\n\t\t\t\t<td class='mw-label'>\n\t\t\t\t\t{$mIpbreason}\n\t\t\t\t</td>\n\t\t\t\t<td class='mw-input'>" . Html::input('wpBlockReason', $this->BlockReason, 'text', array('tabindex' => '5', 'id' => 'mw-bi-reason', 'maxlength' => '200', 'size' => '45') + ($this->BlockAddress ? array('autofocus') : array())) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id='wpAnonOnlyRow'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbanononly'), 'wpAnonOnly', 'wpAnonOnly', $this->BlockAnonOnly, array('tabindex' => '6')) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id='wpCreateAccountRow'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbcreateaccount'), 'wpCreateAccount', 'wpCreateAccount', $this->BlockCreateAccount, array('tabindex' => '7')) . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr id='wpEnableAutoblockRow'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbenableautoblock'), 'wpEnableAutoblock', 'wpEnableAutoblock', $this->BlockEnableAutoblock, array('tabindex' => '8')) . "\n\t\t\t\t</td>\n\t\t\t</tr>");
     if (self::canBlockEmail($wgUser)) {
         $wgOut->addHTML("\n\t\t\t\t<tr id='wpEnableEmailBan'>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbemailban'), 'wpEmailBan', 'wpEmailBan', $this->BlockEmail, array('tabindex' => '9')) . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>");
     }
     // Allow some users to hide name from block log, blocklist and listusers
     if ($wgUser->isAllowed('hideuser')) {
         $wgOut->addHTML("\n\t\t\t\t<tr id='wpEnableHideUser'>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td class='mw-input'><strong>" . Xml::checkLabel(wfMsg('ipbhidename'), 'wpHideName', 'wpHideName', $this->BlockHideName, array('tabindex' => '10')) . "\n\t\t\t\t\t</strong></td>\n\t\t\t\t</tr>");
     }
     # Watchlist their user page? (Only if user is logged in)
     if ($wgUser->isLoggedIn()) {
         $wgOut->addHTML("\n\t\t\t<tr id='wpEnableWatchUser'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipbwatchuser'), 'wpWatchUser', 'wpWatchUser', $this->BlockWatchUser, array('tabindex' => '11')) . "\n\t\t\t\t</td>\n\t\t\t</tr>");
     }
     # Can we explicitly disallow the use of user_talk?
     global $wgBlockAllowsUTEdit;
     if ($wgBlockAllowsUTEdit) {
         $wgOut->addHTML("\n\t\t\t\t<tr id='wpAllowUsertalkRow'>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td class='mw-input'>" . Xml::checkLabel(wfMsg('ipballowusertalk'), 'wpAllowUsertalk', 'wpAllowUsertalk', $this->BlockAllowUsertalk, array('tabindex' => '12')) . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>");
     }
     $wgOut->addHTML("\n\t\t\t<tr>\n\t\t\t\t<td style='padding-top: 1em'>&nbsp;</td>\n\t\t\t\t<td  class='mw-submit' style='padding-top: 1em'>" . Xml::submitButton(wfMsg($alreadyBlocked ? 'ipb-change-block' : 'ipbsubmit'), array('name' => 'wpBlock', 'tabindex' => '13', 'accesskey' => 's')) . "\n\t\t\t\t</td>\n\t\t\t</tr>" . Xml::closeElement('table') . Xml::hidden('wpEditToken', $wgUser->editToken()) . ($alreadyBlocked ? Xml::hidden('wpChangeBlock', 1) : "") . Xml::closeElement('fieldset') . Xml::closeElement('form') . Xml::tags('script', array('type' => 'text/javascript'), 'updateBlockOptions()') . "\n");
     $wgOut->addHTML($this->getConvenienceLinks());
//.........这里部分代码省略.........
开发者ID:rocLv,项目名称:conference,代码行数:101,代码来源:SpecialBlockip.php


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