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


PHP Xml::check方法代码示例

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


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

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

示例2: addRequestWikiForm

 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);
 }
开发者ID:Reception123,项目名称:CreateWiki,代码行数:25,代码来源:SpecialRequestWiki.php

示例3: meaneditor_checkboxes

function meaneditor_checkboxes(&$editpage, &$checkboxes, &$tabindex)
{
    $checkboxes['want_traditional_editor'] = '';
    $attribs = array('tabindex' => ++$tabindex, 'id' => 'wpWantTraditionalEditor');
    $checkboxes['want_traditional_editor'] = Xml::check('wpWantTraditionalEditor', $editpage->userWantsTraditionalEditor, $attribs) . "&nbsp;<label for='wpWantTraditionalEditor'>" . wfMsg('checkbox_force_traditional') . "</label>";
    return true;
}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:7,代码来源:MeanEditor.php

示例4: makeSearchForm

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

示例5: getOneCheckbox

 protected function getOneCheckbox($checked, $attribs, $label)
 {
     if ($this->mParent instanceof OOUIHTMLForm) {
         throw new MWException('HTMLMultiSelectField#getOneCheckbox() is not supported');
     } else {
         $elementFunc = ['Html', $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element'];
         $checkbox = Xml::check("{$this->mName}[]", $checked, $attribs) . '&#160;' . call_user_func($elementFunc, 'label', ['for' => $attribs['id']], $label);
         if ($this->mParent->getConfig()->get('UseMediaWikiUIEverywhere')) {
             $checkbox = Html::openElement('div', ['class' => 'mw-ui-checkbox']) . $checkbox . Html::closeElement('div');
         }
         return $checkbox;
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:13,代码来源:HTMLMultiSelectField.php

示例6: getHTML

 public static function getHTML($cur_value, $input_name, $is_mandatory, $is_disabled, $other_args)
 {
     global $sfgTabIndex, $sfgFieldNum, $sfgShowOnSelect;
     $className = $is_mandatory ? 'mandatoryField' : 'createboxInput';
     if (array_key_exists('class', $other_args)) {
         $className .= ' ' . $other_args['class'];
     }
     $inputID = "input_{$sfgFieldNum}";
     if (array_key_exists('show on select', $other_args)) {
         $className .= ' sfShowIfCheckedCheckbox';
         foreach ($other_args['show on select'] as $div_id => $options) {
             // We don't actually use "$options" for
             // anything, because it's just a checkbox.
             if (array_key_exists($inputID, $sfgShowOnSelect)) {
                 $sfgShowOnSelect[$inputID][] = $div_id;
             } else {
                 $sfgShowOnSelect[$inputID] = array($div_id);
             }
         }
     }
     // Can show up here either as an array or a string, depending on
     // whether it came from user input or a wiki page
     if (is_array($cur_value)) {
         $isChecked = array_key_exists('value', $cur_value) && $cur_value['value'] == 'on';
     } else {
         // Default to false - no need to check if it matches
         // a 'false' word.
         $lowercaseCurValue = strtolower(trim($cur_value));
         $possibleYesMessages = array(strtolower(wfMessage('htmlform-yes')->inContentLanguage()->text()), '1', 'yes', 'true');
         // Add values from Semantic MediaWiki, if it's installed.
         if (wfMessage('smw_true_words')->exists()) {
             $smwTrueWords = explode(',', wfMessage('smw_true_words')->inContentLanguage()->text());
             foreach ($smwTrueWords as $smwTrueWord) {
                 $possibleYesMessages[] = strtolower(trim($smwTrueWord));
             }
         }
         $isChecked = in_array($lowercaseCurValue, $possibleYesMessages);
     }
     $text = "\t" . Html::hidden($input_name . '[is_checkbox]', 'true') . "\n";
     $checkboxAttrs = array('id' => $inputID, 'class' => $className, 'tabindex' => $sfgTabIndex);
     if ($is_disabled) {
         $checkboxAttrs['disabled'] = true;
     }
     if (method_exists('Html', 'check')) {
         // MW 1.24+
         $text .= "\t" . Html::check("{$input_name}[value]", $isChecked, $checkboxAttrs);
     } else {
         $text .= "\t" . Xml::check("{$input_name}[value]", $isChecked, $checkboxAttrs);
     }
     return $text;
 }
开发者ID:paladox,项目名称:mediawiki-extensions-SemanticForms,代码行数:51,代码来源:SF_CheckboxInput.php

示例7: showUserForm

 function showUserForm()
 {
     global $wgOut, $wgUser;
     $names = BanPests::getBannableUsers();
     $whitelist = BanPests::getWhitelist();
     $wgOut->addWikiMsg('blockandnuke-tools');
     $wgOut->addHTML(Xml::openElement('form', array('action' => $this->getTitle()->getLocalURL('action=submit'), 'method' => 'post')) . HTML::hidden('wpEditToken', $wgUser->getEditToken()) . '<ul>');
     //make into links  $sk = $wgUser->getSkin();
     foreach ($names as $user) {
         if (!in_array($user, $whitelist)) {
             $wgOut->addHTML('<li>' . Xml::check('names[]', true, array('value' => $user)) . $user . "</li>\n");
         }
     }
     $wgOut->addHTML("</ul>\n" . Xml::submitButton(wfMsg('blockandnuke-submit-user')) . "</form>");
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:15,代码来源:BlockandNuke.body.php

示例8: formatRow

 /**
  * Generate the content of each table row (1 row = 1 ad)
  *
  * @param $row object: database row
  *
  * @return string HTML
  */
 function formatRow($row)
 {
     // Begin ad row
     $htmlOut = Xml::openElement('tr');
     if ($this->editable) {
         // Remove box
         $htmlOut .= Xml::tags('td', array('valign' => 'top'), Xml::check('removeAds[]', false, array('value' => $row->ad_name, 'onchange' => $this->onRemoveChange)));
     }
     // Preview
     $ad = Ad::fromName($row->ad_name);
     $htmlOut .= Xml::tags('td', array('valign' => 'top'), $ad->linkToPreview());
     // End ad row
     $htmlOut .= Xml::closeElement('tr');
     return $htmlOut;
 }
开发者ID:kolzchut,项目名称:mediawiki-extensions-Promoter,代码行数:22,代码来源:AdPager.php

示例9: getOneCheckbox

 protected function getOneCheckbox($checked, $attribs, $label)
 {
     if ($this->mParent instanceof OOUIHTMLForm) {
         if ($this->mOptionsLabelsNotFromMessage) {
             $label = new OOUI\HtmlSnippet($label);
         }
         return new OOUI\FieldLayout(new OOUI\CheckboxInputWidget(['name' => "{$this->mName}[]", 'selected' => $checked] + OOUI\Element::configFromHtmlAttributes($attribs)), ['label' => $label, 'align' => 'inline']);
     } else {
         $elementFunc = ['Html', $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element'];
         $checkbox = Xml::check("{$this->mName}[]", $checked, $attribs) . '&#160;' . call_user_func($elementFunc, 'label', ['for' => $attribs['id']], $label);
         if ($this->mParent->getConfig()->get('UseMediaWikiUIEverywhere')) {
             $checkbox = Html::openElement('div', ['class' => 'mw-ui-checkbox']) . $checkbox . Html::closeElement('div');
         }
         return $checkbox;
     }
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:16,代码来源:HTMLMultiSelectField.php

示例10: formatRow

 /**
  * Generate the content of each table row (1 row = 1 ad)
  */
 function formatRow($row)
 {
     // Begin ad row
     $htmlOut = Xml::openElement('tr');
     if ($this->editable) {
         // Add box
         $htmlOut .= Xml::tags('td', array('valign' => 'top'), Xml::check('addAds[]', '', array('value' => $row->ad_name)));
         // Weight select
         $htmlOut .= Xml::tags('td', array('valign' => 'top', 'class' => 'pr-weight'), Xml::listDropDown("weight[{$row->ad_id}]", Promoter::dropDownList($this->msg('promoter-weight')->text(), range(0, 100, 5)), '', '25', '', ''));
     }
     // Link and Preview
     $ad = Ad::fromName($row->ad_name);
     $htmlOut .= Xml::tags('td', array('valign' => 'top'), $ad->linkToPreview());
     // End ad row
     $htmlOut .= Xml::closeElement('tr');
     return $htmlOut;
 }
开发者ID:kolzchut,项目名称:mediawiki-extensions-Promoter,代码行数:20,代码来源:PromoterPager.php

示例11: getInputHTML

 function getInputHTML($value)
 {
     global $wgUseMediaWikiUIEverywhere;
     if (!empty($this->mParams['invert'])) {
         $value = !$value;
     }
     $attr = $this->getTooltipAndAccessKey();
     $attr['id'] = $this->mID;
     $attr += $this->getAttributes(array('disabled', 'tabindex'));
     if ($this->mClass !== '') {
         $attr['class'] = $this->mClass;
     }
     $chkLabel = Xml::check($this->mName, $value, $attr) . '&#160;' . Html::rawElement('label', array('for' => $this->mID), $this->mLabel);
     if ($wgUseMediaWikiUIEverywhere || $this->mParent instanceof VFormHTMLForm) {
         $chkLabel = Html::rawElement('div', array('class' => 'mw-ui-checkbox'), $chkLabel);
     }
     return $chkLabel;
 }
开发者ID:eliagbayani,项目名称:LiteratureEditor,代码行数:18,代码来源:HTMLCheckField.php

示例12: getInputHTML

 function getInputHTML($value)
 {
     if (!empty($this->mParams['invert'])) {
         $value = !$value;
     }
     $attr = $this->getTooltipAndAccessKey();
     $attr['id'] = $this->mID;
     $attr += $this->getAttributes(array('disabled', 'tabindex'));
     if ($this->mClass !== '') {
         $attr['class'] = $this->mClass;
     }
     if ($this->mParent->isVForm()) {
         // Nest checkbox inside label.
         return Html::rawElement('label', array('class' => 'mw-ui-checkbox-label'), Xml::check($this->mName, $value, $attr) . htmlspecialchars($this->mLabel));
     } else {
         return Xml::check($this->mName, $value, $attr) . '&#160;' . Html::rawElement('label', array('for' => $this->mID), $this->mLabel);
     }
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:18,代码来源:HTMLCheckField.php

示例13: formatOptions

 function formatOptions($options, $value)
 {
     $html = '';
     $attribs = $this->getAttributes(array('disabled', 'tabindex'));
     $elementFunc = array('Html', $this->mOptionsLabelsNotFromMessage ? 'rawElement' : 'element');
     foreach ($options as $label => $info) {
         if (is_array($info)) {
             $html .= Html::rawElement('h1', array(), $label) . "\n";
             $html .= $this->formatOptions($info, $value);
         } else {
             $thisAttribs = array('id' => "{$this->mID}-{$info}", 'value' => $info);
             $checkbox = Xml::check($this->mName . '[]', in_array($info, $value, true), $attribs + $thisAttribs);
             $checkbox .= '&#160;' . call_user_func($elementFunc, 'label', array('for' => "{$this->mID}-{$info}"), $label);
             $html .= ' ' . Html::rawElement('div', array('class' => 'mw-htmlform-flatlist-item'), $checkbox);
         }
     }
     return $html;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:18,代码来源:HTMLMultiSelectField.php

示例14: getQuestionForm

	function getQuestionForm( $question, $options ) {
		global $wgRequest;
		$name = 'securepoll_q' . $question->getId();
		$s = '';
		foreach ( $options as $option ) {
			$optionHTML = $option->parseMessageInline( 'text' );
			$optionId = $option->getId();
			$inputId = "{$name}_opt{$optionId}";
			$oldValue = $wgRequest->getBool( $inputId );
			$s .= 
				'<div class="securepoll-option-approval">' .
				Xml::check( $inputId, $oldValue, array( 'id' => $inputId ) ) .
				'&#160;' .
				Xml::tags( 'label', array( 'for' => $inputId ), $optionHTML ) .
				'&#160;' .
				"</div>\n";
		}
		return $s;
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:19,代码来源:ApprovalBallot.php

示例15: displayNavigation

 private function displayNavigation()
 {
     global $wgOut;
     $groupSelector = new XmlSelect('group', 'group-select');
     // pull groups
     $groups = MessageGroups::singleton()->getGroups();
     foreach ($groups as $group) {
         if (!$group->isMeta()) {
             continue;
         }
         $groupSelector->addOption($group->getLabel(), $group->getId());
     }
     $fields = array();
     $fields['transstats-choose-group'] = $groupSelector->getHTML();
     $fields['transstats-breakdown'] = Xml::check('breakdown', false);
     $out = Xml::openElement('form');
     $out .= Xml::buildForm($fields);
     $out .= Xml::submitButton(wfMsg('transstats-submit'));
     $out .= Xml::closeElement('form');
     $wgOut->addHTML($out);
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:21,代码来源:SpecialTranslationCount.body.php


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