本文整理汇总了PHP中Xml::password方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::password方法的具体用法?PHP Xml::password怎么用?PHP Xml::password使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml::password方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainPrefsForm
//.........这里部分代码省略.........
if (mb_strlen($this->mNick) > $wgMaxSigChars) {
$invalidSig = $this->tableRow(' ', Xml::element('span', array('class' => 'error'), wfMsg('badsiglength', $wgLang->formatNum($wgMaxSigChars))));
} elseif (!empty($this->mToggles['fancysig']) && false === $wgParser->validateSig($this->mNick)) {
$invalidSig = $this->tableRow(' ', Xml::element('span', array('class' => 'error'), wfMsg('badsig')));
} else {
$invalidSig = '';
}
$wgOut->addHTML($this->tableRow(Xml::label(wfMsg('yournick'), 'wpNick'), Xml::input('wpNick', 25, $this->mNick, array('id' => 'wpNick', 'maxlength' => $wgMaxSigChars))) . $invalidSig . $this->tableRow(' ', $this->getToggle('fancysig')));
list($lsLabel, $lsSelect) = Xml::languageSelector($this->mUserLanguage);
$wgOut->addHTML($this->tableRow($lsLabel, $lsSelect));
/* see if there are multiple language variants to choose from*/
if (!$wgDisableLangConversion) {
$variants = $wgContLang->getVariants();
$variantArray = array();
$languages = Language::getLanguageNames(true);
foreach ($variants as $v) {
$v = str_replace('_', '-', strtolower($v));
if (array_key_exists($v, $languages)) {
// If it doesn't have a name, we'll pretend it doesn't exist
$variantArray[$v] = $languages[$v];
}
}
$options = "\n";
foreach ($variantArray as $code => $name) {
$selected = $code == $this->mUserVariant;
$options .= Xml::option("{$code} - {$name}", $code, $selected) . "\n";
}
if (count($variantArray) > 1) {
$wgOut->addHtml($this->tableRow(Xml::label(wfMsg('yourvariant'), 'wpUserVariant'), Xml::tags('select', array('name' => 'wpUserVariant', 'id' => 'wpUserVariant'), $options)));
}
}
# Password
if ($wgAuth->allowPasswordChange()) {
$wgOut->addHTML($this->tableRow(Xml::element('h2', null, wfMsg('changepassword'))) . $this->tableRow(Xml::label(wfMsg('oldpassword'), 'wpOldpass'), Xml::password('wpOldpass', 25, $this->mOldpass, array('id' => 'wpOldpass'))) . $this->tableRow(Xml::label(wfMsg('newpassword'), 'wpNewpass'), Xml::password('wpNewpass', 25, $this->mNewpass, array('id' => 'wpNewpass'))) . $this->tableRow(Xml::label(wfMsg('retypenew'), 'wpRetypePass'), Xml::password('wpRetypePass', 25, $this->mRetypePass, array('id' => 'wpRetypePass'))) . Xml::tags('tr', null, Xml::tags('td', array('colspan' => '2'), $this->getToggle("rememberpassword"))));
}
# <FIXME>
# Enotif
if ($wgEnableEmail) {
$moreEmail = '';
if ($wgEnableUserEmail) {
$emf = wfMsg('allowemail');
$disabled = $disableEmailPrefs ? ' disabled="disabled"' : '';
$moreEmail = "<input type='checkbox' {$emfc} {$disabled} value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label for='wpEmailFlag'>{$emf}</label>";
}
$wgOut->addHTML($this->tableRow(Xml::element('h2', null, wfMsg('email'))) . $this->tableRow($emailauthenticated . $enotifrevealaddr . $enotifwatchlistpages . $enotifusertalkpages . $enotifminoredits . $moreEmail . $this->getToggle('ccmeonemails')));
}
# </FIXME>
$wgOut->addHTML(Xml::closeElement('table') . Xml::closeElement('fieldset'));
# Quickbar
#
if ($this->mSkin == 'cologneblue' || $this->mSkin == 'standard') {
$wgOut->addHtml("<fieldset>\n<legend>" . wfMsg('qbsettings') . "</legend>\n");
for ($i = 0; $i < count($qbs); ++$i) {
if ($i == $this->mQuickbar) {
$checked = ' checked="checked"';
} else {
$checked = "";
}
$wgOut->addHTML("<div><label><input type='radio' name='wpQuickbar' value=\"{$i}\"{$checked} />{$qbs[$i]}</label></div>\n");
}
$wgOut->addHtml("</fieldset>\n\n");
} else {
# Need to output a hidden option even if the relevant skin is not in use,
# otherwise the preference will get reset to 0 on submit
$wgOut->addHtml(wfHidden('wpQuickbar', $this->mQuickbar));
}
示例2: chooseNameForm
/**
* Displays a form to let the user choose an account to attach with the
* given OpenID
*
* @param $openid String: OpenID url
* @param $sreg Array: options get from OpenID
* @param $messagekey String or null: message name to display at the top
*/
function chooseNameForm( $openid, $sreg, $ax, $messagekey = null ) {
global $wgOut, $wgOpenIDAllowExistingAccountSelection, $wgAllowRealName, $wgUser;
global $wgOpenIDProposeUsernameFromSREG, $wgOpenIDAllowAutomaticUsername, $wgOpenIDAllowNewAccountname;
if ( $messagekey ) {
$wgOut->addWikiMsg( $messagekey );
}
$wgOut->addWikiMsg( 'openidchooseinstructions' );
$wgOut->addHTML(
Xml::openElement( 'form',
array( 'action' => $this->getTitle( 'ChooseName' )->getLocalUrl(), 'method' => 'POST' ) ) . "\n" .
Xml::fieldset( wfMsg( 'openidchooselegend' ), false, array( 'id' => 'mw-openid-choosename' ) ) . "\n" .
Xml::openElement( 'table' )
);
$def = false;
if ( $wgOpenIDAllowExistingAccountSelection ) {
# Let them attach it to an existing user
# Grab the UserName in the cookie if it exists
global $wgCookiePrefix;
$name = '';
if ( isset( $_COOKIE["{$wgCookiePrefix}UserName"] ) ) {
$name = trim( $_COOKIE["{$wgCookiePrefix}UserName"] );
}
# show OpenID Attributes
$oidAttributesToAccept = array( 'fullname', 'nickname', 'email', 'language' );
$oidAttributes = array();
foreach ( $oidAttributesToAccept as $oidAttr ) {
if ( $oidAttr == 'fullname' && !$wgAllowRealName ) {
continue;
}
if ( array_key_exists( $oidAttr, $sreg ) ) {
$checkName = 'wpUpdateUserInfo' . $oidAttr;
$oidAttributes[] = Xml::tags( 'li', array(),
Xml::check( $checkName, false, array( 'id' => $checkName ) ) .
Xml::tags( 'label', array( 'for' => $checkName ),
wfMsgHtml( "openid$oidAttr" ) . wfMsgExt( 'colon-separator', array( 'escapenoentities' ) ) .
Xml::tags( 'i', array(), $sreg[$oidAttr] )
)
);
}
}
$oidAttributesUpdate = '';
if ( count( $oidAttributes ) > 0 ) {
$oidAttributesUpdate = "<br />\n" .
wfMsgHtml( 'openidupdateuserinfo' ) . "\n" .
Xml::tags( 'ul', array(), implode( "\n", $oidAttributes ) );
}
$wgOut->addHTML(
Xml::openElement( 'tr' ) .
Xml::tags( 'td', array( 'class' => 'mw-label' ),
Xml::radio( 'wpNameChoice', 'existing', !$def, array( 'id' => 'wpNameChoiceExisting' ) )
) . "\n" .
Xml::tags( 'td', array( 'class' => 'mw-input' ),
Xml::label( wfMsg( 'openidchooseexisting' ), 'wpNameChoiceExisting' ) . "<br />\n" .
wfMsgHtml( 'openidchooseusername' ) . "\n" .
Xml::input( 'wpExistingName', 16, $name, array( 'id' => 'wpExistingName' ) ) . "\n" .
wfMsgHtml( 'openidchoosepassword' ) . "\n" .
Xml::password( 'wpExistingPassword' ) . "\n" .
$oidAttributesUpdate . "\n"
) . "\n" .
Xml::closeElement( 'tr' ) . "\n"
);
$def = true;
} // $wgOpenIDAllowExistingAccountSelection
# These are only available if all visitors are allowed to create accounts
if ( $wgUser->isAllowed( 'createaccount' ) && !$wgUser->isBlockedFromCreateAccount() ) {
if ( $wgOpenIDProposeUsernameFromSREG ) {
# These options won't exist if we can't get them.
if ( array_key_exists( 'nickname', $sreg ) && $this->userNameOK( $sreg['nickname'] ) ) {
$wgOut->addHTML(
Xml::openElement( 'tr' ) .
Xml::tags( 'td', array( 'class' => 'mw-label' ),
Xml::radio( 'wpNameChoice', 'nick', !$def, array( 'id' => 'wpNameChoiceNick' ) )
) .
Xml::tags( 'td', array( 'class' => 'mw-input' ),
Xml::label( wfMsg( 'openidchoosenick', $sreg['nickname'] ), 'wpNameChoiceNick' )
) .
Xml::closeElement( 'tr' ) . "\n"
);
}
//.........这里部分代码省略.........
示例3: mainPrefsForm
//.........这里部分代码省略.........
$invalidSig = $this->tableRow(' ', Xml::element('span', array('class' => 'error'), wfMsg('badsig')));
} else {
$invalidSig = '';
}
$wgOut->addHTML($this->tableRow(Xml::label(wfMsg('yournick'), 'wpNick'), Xml::input('wpNick', 25, $this->mNick, array('id' => 'wpNick', 'class' => 'input_med', 'maxlength' => $wgMaxSigChars))) . $invalidSig . $this->tableRow(' ', $this->getToggle('fancysig')));
list($lsLabel, $lsSelect) = Xml::languageSelector($this->mUserLanguage);
$wgOut->addHTML($this->tableRow($lsLabel, $lsSelect));
/* see if there are multiple language variants to choose from*/
if (!$wgDisableLangConversion) {
$variants = $wgContLang->getVariants();
$variantArray = array();
$languages = Language::getLanguageNames(true);
foreach ($variants as $v) {
$v = str_replace('_', '-', strtolower($v));
if (array_key_exists($v, $languages)) {
// If it doesn't have a name, we'll pretend it doesn't exist
$variantArray[$v] = $languages[$v];
}
}
$options = "\n";
foreach ($variantArray as $code => $name) {
$selected = $code == $this->mUserVariant;
$options .= Xml::option("{$code} - {$name}", $code, $selected) . "\n";
}
if (count($variantArray) > 1) {
$wgOut->addHtml($this->tableRow(Xml::label(wfMsg('yourvariant'), 'wpUserVariant'), Xml::tags('select', array('name' => 'wpUserVariant', 'id' => 'wpUserVariant'), $options)));
}
}
// TEEN FILTER
$options = Xml::radioLabel(wfMsg('pref_content_preferences_all'), 'wpContentFilter', 0, 'wpContentFilter_0', $this->mContentFilter == 0, array('class' => 'normal_font')) . "<br/><br/>" . Xml::radioLabel(wfMsg('pref_content_preferences_young'), 'wpContentFilter', 1, 'wpContentFilter_1', $this->mContentFilter == 1, array('class' => 'normal_font')) . "<br/><br/>" . Xml::radioLabel(wfMsg('pref_content_preferences_adult'), 'wpContentFilter', 2, 'wpContentFilter_2', $this->mContentFilter == 2, array('class' => 'normal_font')) . "<br/><br/>";
$wgOut->addHtml($this->tableRow(wfMsg('pref_content_preferences_info'), $options));
# Password
if ($wgAuth->allowPasswordChange()) {
$wgOut->addHTML($this->tableRow(Xml::element('legend', null, wfMsg('changepassword'))) . $this->tableRow(Xml::label(wfMsg('oldpassword'), 'wpOldpass'), Xml::password('wpOldpass', 25, $this->mOldpass, array('id' => 'wpOldpass', 'class' => 'input_med'))) . $this->tableRow(Xml::label(wfMsg('newpassword'), 'wpNewpass'), Xml::password('wpNewpass', 25, $this->mNewpass, array('id' => 'wpNewpass', 'class' => 'input_med'))) . $this->tableRow(Xml::label(wfMsg('retypenew'), 'wpRetypePass'), Xml::password('wpRetypePass', 25, $this->mRetypePass, array('id' => 'wpRetypePass', 'class' => 'input_med'))) . Xml::tags('tr', null, Xml::tags('td', array('colspan' => '2'), $this->getToggle("rememberpassword"))) . Xml::tags('tr', null, Xml::tags('td', array('colspan' => '2'), "")));
}
# <FIXME>
# Enotif
if ($wgEnableEmail) {
$moreEmail = '';
$marketingEmail = '';
$authorEmail = '';
if ($wgEnableUserEmail) {
$emf = wfMsg('allowemail');
$disabled = $disableEmailPrefs ? ' disabled="disabled"' : '';
$moreEmail = "<input type='checkbox' class='input_med' {$emfc} {$disabled} value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label class='normal_font' for='wpEmailFlag'>{$emf}</label>";
//XXADDED Author emails
$auth_emf = wfMsg('allowauthornotificationdialog');
$authorEmail = "<div><input type='checkbox' class='input_med' {$auth_emfc} {$disabled} value='1' name='wpAuthorEmailNotifications' id='wpAuthorEmailNotifications' /> <label class='normal_font' for='wpAuthorEmailNotifications'>{$auth_emf}</label></div>";
if (class_exists('ThumbsUp')) {
// Thumbs up talk notifications
$thumbs_label = wfMsg('allowthumbsupnotifications');
$thumbsNotifyField = "<div><input type='checkbox' class='input_med' {$thumbs_checked} value='1' name='wpThumbsNotifications' id='wpThumbsNotifications' /> <label class='normal_font' for='wpThumbsNotifications'>" . "{$thumbs_label}</label></div>";
// Thumbs up email notifications
$thumbs_label = wfMsg('allowthumbsupemailnotifications');
$thumbsEmailNotifyField = "<div><input type='checkbox' class='input_med' {$thumbs_email_checked} value='1' name='wpThumbsEmailNotifications' id='wpThumbsNotifications' /> " . "<label class='normal_font' for='wpThumbsEmailNotifications'>{$thumbs_label}</label></div>";
//$thumbsboxoptions = "<div style='border:2px solid #DDD;margin:3px 0 3px 0;padding:3px;'>$thumbsNotifyField</div>\n";
$thumbsboxoptions = "<div style='margin:3px 0 3px 0;padding:3px;'>{$thumbsNotifyField} {$thumbsEmailNotifyField}</div>\n";
} else {
$thumbsboxoptions = "";
}
//XXADDED Marketing emails
$memf = wfMsg('allowmarketingemail');
//XXADDED UserTalk emails
$ut_emf = wfMsg('usertalknotifications');
$marketingEmail = "<div><input type='checkbox' class='input_med' {$memfc} {$disabled} value='1' name='wpMarketingEmailFlag' id='wpMarketingEmailFlag' /> <label class='normal_font' for='wpMarketingEmailFlag'>{$memf}</label></div>";
$usertalkEmail = "<div><input type='checkbox' class='input_med' {$ut_emfc} {$disabled} value='1' name='wpUserTalkNotifications' id='wpUserTalkNotifications' /> <label class='normal_font' for='wpUserTalkNotifications'>{$ut_emf}</label></div>";