diff options
Diffstat (limited to 'includes/templates')
-rw-r--r-- | includes/templates/NoLocalSettings.php | 32 | ||||
-rw-r--r-- | includes/templates/Usercreate.php | 80 | ||||
-rw-r--r-- | includes/templates/Userlogin.php | 45 |
3 files changed, 85 insertions, 72 deletions
diff --git a/includes/templates/NoLocalSettings.php b/includes/templates/NoLocalSettings.php index 0006df40..5b88dfd1 100644 --- a/includes/templates/NoLocalSettings.php +++ b/includes/templates/NoLocalSettings.php @@ -1,4 +1,5 @@ <?php +// @codingStandardsIgnoreFile /** * Template used when there is no LocalSettings.php file. * @@ -33,8 +34,8 @@ if ( !isset( $wgVersion ) ) { $matches = array(); $ext = 'php'; $path = '/'; -foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) { - if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) { +foreach ( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) { + if ( !preg_match( '/\.(php5?)$/', $part, $matches ) ) { $path .= "$part/"; } else { $ext = $matches[1] == 'php5' ? 'php5' : 'php'; @@ -71,20 +72,25 @@ if ( !function_exists( 'session_name' ) ) { </style> </head> <body> - <img src="<?php echo htmlspecialchars( $path ) ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' /> + <img src="<?php echo htmlspecialchars( $path ) ?>resources/assets/mediawiki.png" alt='The MediaWiki logo' /> <h1>MediaWiki <?php echo htmlspecialchars( $wgVersion ) ?></h1> <div class='error'> - <p>LocalSettings.php not found.</p> - <p> - <?php - if ( $installerStarted ) { - echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> complete the installation</a> and download LocalSettings.php."; - } else { - echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\"> set up the wiki</a> first."; - } - ?> - </p> + <?php if ( !file_exists( MW_CONFIG_FILE ) ) { ?> + <p>LocalSettings.php not found.</p> + <p> + <?php + if ( $installerStarted ) { + echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\">complete the installation</a> and download LocalSettings.php."; + } else { + echo "Please <a href=\"" . htmlspecialchars( $path ) . "mw-config/index." . htmlspecialchars( $ext ) . "\">set up the wiki</a> first."; + } + ?> + </p> + <?php } else { ?> + <p>LocalSettings.php not readable.</p> + <p>Please correct file permissions and try again.</p> + <?php } ?> </div> </body> diff --git a/includes/templates/Usercreate.php b/includes/templates/Usercreate.php index fcd492cb..01da0bd7 100644 --- a/includes/templates/Usercreate.php +++ b/includes/templates/Usercreate.php @@ -1,4 +1,5 @@ <?php +// @codingStandardsIgnoreFile /** * Html form for account creation (since 1.22 with VForm appearance). * @@ -22,7 +23,6 @@ */ class UsercreateTemplate extends BaseTemplate { - /** * Extensions (AntiSpoof and TitleBlacklist) call this in response to * UserCreateForm hook to add checkboxes to the create account form. @@ -51,24 +51,29 @@ class UsercreateTemplate extends BaseTemplate { <div id="signupstart"><?php $this->msgWiki( 'signupstart' ); ?></div> <?php } ?> <div id="userloginForm"> - <h2 class="createaccount-join"> - <?php $this->msg( $this->data['loggedin'] ? 'createacct-another-join' : 'createacct-join' ); ?> - </h2> <form name="userlogin2" id="userlogin2" class="mw-ui-vform" method="post" action="<?php $this->text( 'action' ); ?>"> <section class="mw-form-header"> <?php $this->html( 'header' ); /* extensions such as ConfirmEdit add form HTML here */ ?> </section> + <!-- This element is used by the mediawiki.special.userlogin.signup.js module. --> + <div + id="mw-createacct-status-area" + <?php if ( $this->data['message'] ) { ?> + class="<?php echo $this->data['messagetype']; ?>box" + <?php } else { ?> + style="display: none;" + <?php } ?> + > <?php if ( $this->data['message'] ) { ?> - <div class="<?php $this->text( 'messagetype' ); ?>box"> <?php if ( $this->data['messagetype'] == 'error' ) { ?> <strong><?php $this->msg( 'createacct-error' ); ?></strong> <br /> <?php } ?> <?php $this->html( 'message' ); ?> - </div> <?php } ?> + </div> - <div> + <div class="mw-ui-vform-field"> <label for='wpName2'> <?php $this->msg( 'userlogin-yourname' ); ?> @@ -76,7 +81,7 @@ class UsercreateTemplate extends BaseTemplate { </label> <?php echo Html::input( 'wpName', $this->data['name'], 'text', array( - 'class' => 'mw-input loginText', + 'class' => 'mw-ui-input loginText', 'id' => 'wpName2', 'tabindex' => '1', 'size' => '20', @@ -87,24 +92,25 @@ class UsercreateTemplate extends BaseTemplate { ?> </div> - <div> + <div class="mw-ui-vform-field"> <?php if ( $this->data['createemail'] ) { ?> - <label class="mw-ui-checkbox-label"> + <div class="mw-ui-checkbox"> <input name="wpCreateaccountMail" type="checkbox" value="1" id="wpCreateaccountMail" tabindex="2" <?php if ( $this->data['createemailset'] ) { echo 'checked="checked"'; } ?> - > - <?php $this->msg( 'createaccountmail' ); ?> - </label> + ><label for="wpCreateaccountMail"> + <?php $this->msg( 'createaccountmail' ); ?> + </label> + </div> <?php } ?> </div> - <div class="mw-row-password"> + <div class="mw-ui-vform-field mw-row-password"> <label for='wpPassword2'><?php $this->msg( 'userlogin-yourpassword' ); ?></label> <?php echo Html::input( 'wpPassword', null, 'password', array( - 'class' => 'mw-input loginPassword', + 'class' => 'mw-ui-input loginPassword', 'id' => 'wpPassword2', 'tabindex' => '3', 'size' => '20', @@ -116,26 +122,25 @@ class UsercreateTemplate extends BaseTemplate { <?php if ( $this->data['usedomain'] ) { - $doms = ""; + $select = new XmlSelect( 'wpDomain', false, $this->data['domain'] ); + $select->setAttribute( 'tabindex', 4 ); foreach ( $this->data['domainnames'] as $dom ) { - $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>"; + $select->addOption( $dom ); } ?> - <div id="mw-user-domain-section"> + <div class="mw-ui-vform-field" id="mw-user-domain-section"> <label for="wpDomain"><?php $this->msg( 'yourdomainname' ); ?></label> - <div class="mw-input"> - <select name="wpDomain" value="<?php $this->text( 'domain' ); ?>" tabindex="4"> - <?php echo $doms ?> - </select> + <div> + <?php echo $select->getHTML(); ?> </div> </div> <?php } ?> - <div class="mw-row-password"> + <div class="mw-ui-vform-field mw-row-password"> <label for='wpRetype'><?php $this->msg( 'createacct-yourpasswordagain' ); ?></label> <?php echo Html::input( 'wpRetype', null, 'password', array( - 'class' => 'mw-input loginPassword', + 'class' => 'mw-ui-input loginPassword', 'id' => 'wpRetype', 'tabindex' => '5', 'size' => '20', @@ -145,7 +150,7 @@ class UsercreateTemplate extends BaseTemplate { ?> </div> - <div> + <div class="mw-ui-vform-field"> <?php if ( $this->data['useemail'] ) { ?> <label for='wpEmail'> <?php @@ -157,7 +162,7 @@ class UsercreateTemplate extends BaseTemplate { </label> <?php echo Html::input( 'wpEmail', $this->data['email'], 'email', array( - 'class' => 'mw-input loginText', + 'class' => 'mw-ui-input loginText', 'id' => 'wpEmail', 'tabindex' => '6', 'size' => '20', @@ -170,9 +175,9 @@ class UsercreateTemplate extends BaseTemplate { </div> <?php if ( $this->data['userealname'] ) { ?> - <div> + <div class="mw-ui-vform-field"> <label for='wpRealName'><?php $this->msg( 'createacct-realname' ); ?></label> - <input type='text' class='mw-input loginText' name="wpRealName" id="wpRealName" + <input type='text' class='mw-ui-input loginText' name="wpRealName" id="wpRealName" tabindex="7" value="<?php $this->text( 'realname' ); ?>" size='20' /> <div class="prefsectiontip"> @@ -182,10 +187,10 @@ class UsercreateTemplate extends BaseTemplate { <?php } ?> <?php if ( $this->data['usereason'] ) { ?> - <div> + <div class="mw-ui-vform-field"> <label for='wpReason'><?php $this->msg( 'createacct-reason' ); ?></label> <?php echo Html::input( 'wpReason', $this->data['reason'], 'text', array( - 'class' => 'mw-input loginText', + 'class' => 'mw-ui-input loginText', 'id' => 'wpReason', 'tabindex' => '8', 'size' => '20', @@ -198,12 +203,12 @@ class UsercreateTemplate extends BaseTemplate { $tabIndex = 9; if ( isset( $this->data['extraInput'] ) && is_array( $this->data['extraInput'] ) ) { foreach ( $this->data['extraInput'] as $inputItem ) { ?> - <div> + <div class="mw-ui-vform-field"> <?php // If it's a checkbox, output the whole thing (assume it has a msg). if ( $inputItem['type'] == 'checkbox' ) { ?> - <label class="mw-ui-checkbox-label"> + <div class="mw-ui-checkbox"> <input name="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" id="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" @@ -212,9 +217,8 @@ class UsercreateTemplate extends BaseTemplate { <?php if ( !empty( $inputItem['value'] ) ) { echo 'checked="checked"'; } ?> - > - <?php $this->msg( $inputItem['msg'] ); ?> - </label> + ><label for="<?php echo htmlspecialchars( $inputItem['name'] ); ?>"></label> + </div><?php $this->msgHtml( $inputItem['msg'] ); ?> <?php } else { // Not a checkbox. @@ -227,7 +231,7 @@ class UsercreateTemplate extends BaseTemplate { <?php } ?> <input type="<?php echo htmlspecialchars( $inputItem['type'] ); ?>" - class="mw-input" + class="mw-ui-input" name="<?php echo htmlspecialchars( $inputItem['name'] ); ?>" tabindex="<?php echo $tabIndex++; ?>" value="<?php echo htmlspecialchars( $inputItem['value'] ); ?>" @@ -248,14 +252,14 @@ class UsercreateTemplate extends BaseTemplate { // so skip one index. $tabIndex++; ?> - <div class="mw-submit"> + <div class="mw-ui-vform-field mw-submit"> <?php echo Html::input( 'wpCreateaccount', $this->getMsg( $this->data['loggedin'] ? 'createacct-another-submit' : 'createacct-submit' ), 'submit', array( - 'class' => "mw-ui-button mw-ui-big mw-ui-block mw-ui-primary", + 'class' => "mw-ui-button mw-ui-big mw-ui-block mw-ui-constructive", 'id' => 'wpCreateaccount', 'tabindex' => $tabIndex++ ) diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index 9aedd3c7..8bba4265 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -1,4 +1,5 @@ <?php +// @codingStandardsIgnoreFile /** * Html form for user login (since 1.22 with VForm appearance). * @@ -28,6 +29,7 @@ class UserloginTemplate extends BaseTemplate { $expirationDays = ceil( $wgCookieExpiration / ( 3600 * 24 ) ); ?> <div class="mw-ui-container"> + <div id="userloginprompt"><?php $this->msgWiki('loginprompt') ?></div> <?php if ( $this->haveData( 'languages' ) ) { ?> <div id="languagelinks"> <p><?php $this->html( 'languages' ); ?></p> @@ -54,7 +56,7 @@ class UserloginTemplate extends BaseTemplate { </div> <?php } ?> - <div> + <div class="mw-ui-vform-field"> <label for='wpName1'> <?php $this->msg( 'userlogin-yourname' ); @@ -70,7 +72,7 @@ class UserloginTemplate extends BaseTemplate { <?php $extraAttrs = array(); echo Html::input( 'wpName', $this->data['name'], 'text', array( - 'class' => 'loginText', + 'class' => 'loginText mw-ui-input', 'id' => 'wpName1', 'tabindex' => '1', 'size' => '20', @@ -84,7 +86,7 @@ class UserloginTemplate extends BaseTemplate { ?> </div> - <div> + <div class="mw-ui-vform-field"> <label for='wpPassword1'> <?php $this->msg( 'userlogin-yourpassword' ); @@ -100,7 +102,7 @@ class UserloginTemplate extends BaseTemplate { </label> <?php echo Html::input( 'wpPassword', null, 'password', array( - 'class' => 'loginPassword', + 'class' => 'loginPassword mw-ui-input', 'id' => 'wpPassword1', 'tabindex' => '2', 'size' => '20', @@ -113,16 +115,15 @@ class UserloginTemplate extends BaseTemplate { <?php if ( isset( $this->data['usedomain'] ) && $this->data['usedomain'] ) { - $doms = ""; + $select = new XmlSelect( 'wpDomain', false, $this->data['domain'] ); + $select->setAttribute( 'tabindex', 3 ); foreach ( $this->data['domainnames'] as $dom ) { - $doms .= "<option>" . htmlspecialchars( $dom ) . "</option>"; + $select->addOption( $dom ); } ?> - <div id="mw-user-domain-section"> + <div class="mw-ui-vform-field" id="mw-user-domain-section"> <label for='wpDomain'><?php $this->msg( 'yourdomainname' ); ?></label> - <select name="wpDomain" value="<?php $this->text( 'domain' ); ?>" tabindex="3"> - <?php echo $doms; ?> - </select> + <?php echo $select->getHTML(); ?> </div> <?php } ?> @@ -132,29 +133,30 @@ class UserloginTemplate extends BaseTemplate { } ?> - <div> + <div class="mw-ui-vform-field"> <?php if ( $this->data['canremember'] ) { ?> - <label class="mw-ui-checkbox-label"> + <div class="mw-ui-checkbox"> <input name="wpRemember" type="checkbox" value="1" id="wpRemember" tabindex="4" <?php if ( $this->data['remember'] ) { echo 'checked="checked"'; } ?> - > - <?php echo $this->getMsg( 'userlogin-remembermypassword' )->numParams( $expirationDays )->escaped(); ?> - </label> + ><label for="wpRemember"> + <?php echo $this->getMsg( 'userlogin-remembermypassword' )->numParams( $expirationDays )->escaped(); ?></label> + </div> <?php } ?> </div> - <div> + <div class="mw-ui-vform-field"> <?php - echo Html::input( 'wpLoginAttempt', $this->getMsg( 'login' )->text(), 'submit', array( + echo Html::input( 'wpLoginAttempt', $this->getMsg( 'pt-login-button' )->text(), 'submit', array( 'id' => 'wpLoginAttempt', 'tabindex' => '6', - 'class' => 'mw-ui-button mw-ui-big mw-ui-block mw-ui-primary' + 'class' => 'mw-ui-button mw-ui-big mw-ui-block mw-ui-constructive' ) ); ?> </div> - <div id="mw-userlogin-help"> + + <div class="mw-ui-vform-field" id="mw-userlogin-help"> <?php echo Html::element( 'a', @@ -167,14 +169,15 @@ class UserloginTemplate extends BaseTemplate { ); ?> </div> + <?php if ( $this->haveData( 'createOrLoginHref' ) ) { ?> <?php if ( $this->data['loggedin'] ) { ?> <div id="mw-createaccount-another"> - <h3 id="mw-userloginlink"><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button"><?php $this->msg( 'userlogin-createanother' ); ?></a></h3> + <a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button"><?php $this->msg( 'userlogin-createanother' ); ?></a> </div> <?php } else { ?> <div id="mw-createaccount-cta"> - <h3 id="mw-userloginlink"><?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button mw-ui-constructive"><?php $this->msg( 'userlogin-joinproject' ); ?></a></h3> + <?php $this->msg( 'userlogin-noaccount' ); ?><a href="<?php $this->text( 'createOrLoginHref' ); ?>" id="mw-createaccount-join" tabindex="7" class="mw-ui-button mw-ui-progressive"><?php $this->msg( 'userlogin-joinproject' ); ?></a> </div> <?php } ?> <?php } ?> |