本文整理汇总了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') . ' ' . 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);
}
示例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);
}
示例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) . " <label for='wpWantTraditionalEditor'>" . wfMsg('checkbox_force_traditional') . "</label>";
return true;
}
示例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> </td><td>' . Xml::submitButton( wfMsg( 'profiling-ok' ), array( 'name' => 'submit' ) ) . '</td></table></form>';
return $html;
}
示例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) . ' ' . 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;
}
}
示例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;
}
示例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>");
}
示例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;
}
示例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) . ' ' . 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;
}
}
示例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;
}
示例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) . ' ' . 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;
}
示例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) . ' ' . Html::rawElement('label', array('for' => $this->mID), $this->mLabel);
}
}
示例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 .= ' ' . call_user_func($elementFunc, 'label', array('for' => "{$this->mID}-{$info}"), $label);
$html .= ' ' . Html::rawElement('div', array('class' => 'mw-htmlform-flatlist-item'), $checkbox);
}
}
return $html;
}
示例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 ) ) .
' ' .
Xml::tags( 'label', array( 'for' => $inputId ), $optionHTML ) .
' ' .
"</div>\n";
}
return $s;
}
示例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);
}