summaryrefslogtreecommitdiff
path: root/includes/installer/WebInstallerPage.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/installer/WebInstallerPage.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/installer/WebInstallerPage.php')
-rw-r--r--includes/installer/WebInstallerPage.php57
1 files changed, 37 insertions, 20 deletions
diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php
index dc9c6d27..ff8185a1 100644
--- a/includes/installer/WebInstallerPage.php
+++ b/includes/installer/WebInstallerPage.php
@@ -69,7 +69,8 @@ abstract class WebInstallerPage {
if ( $continue ) {
// Fake submit button for enter keypress (bug 26267)
$s .= Xml::submitButton( wfMsg( "config-$continue" ),
- array( 'name' => "enter-$continue", 'style' => 'visibility:hidden;overflow:hidden;width:1px;margin:0' ) ) . "\n";
+ array( 'name' => "enter-$continue", 'style' =>
+ 'visibility:hidden;overflow:hidden;width:1px;margin:0' ) ) . "\n";
}
if ( $back ) {
@@ -122,7 +123,7 @@ abstract class WebInstallerPage {
/**
* Get the end tag of a fieldset.
*
- * @returns string
+ * @return string
*/
protected function getFieldsetEnd() {
return "</fieldset>\n";
@@ -133,9 +134,11 @@ abstract class WebInstallerPage {
*/
protected function startLiveBox() {
$this->addHTML(
- '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
+ '<div id="config-spinner" style="display:none;">' .
+ '<img src="../skins/common/images/ajax-loader.gif" /></div>' .
'<script>jQuery( "#config-spinner" ).show();</script>' .
- '<div id="config-live-log"><textarea name="LiveLog" rows="10" cols="30" readonly="readonly">'
+ '<div id="config-live-log">' .
+ '<textarea name="LiveLog" rows="10" cols="30" readonly="readonly">'
);
$this->parent->output->flush();
}
@@ -155,9 +158,10 @@ class WebInstaller_Language extends WebInstallerPage {
public function execute() {
global $wgLang;
$r = $this->parent->request;
- $userLang = $r->getVal( 'UserLang' );
+ $userLang = $r->getVal( 'uselang' );
$contLang = $r->getVal( 'ContLang' );
+ $languages = Language::getLanguageNames();
$lifetime = intval( ini_get( 'session.gc_maxlifetime' ) );
if ( !$lifetime ) {
$lifetime = 1440; // PHP default
@@ -178,7 +182,6 @@ class WebInstaller_Language extends WebInstallerPage {
}
$this->parent->showError( $msg, $wgLang->formatTimePeriod( $lifetime ) );
} else {
- $languages = Language::getLanguageNames();
if ( isset( $languages[$userLang] ) ) {
$this->setVar( '_UserLang', $userLang );
}
@@ -190,7 +193,8 @@ class WebInstaller_Language extends WebInstallerPage {
} elseif ( $this->parent->showSessionWarning ) {
# The user was knocked back from another page to the start
# This probably indicates a session expiry
- $this->parent->showError( 'config-session-expired', $wgLang->formatTimePeriod( $lifetime ) );
+ $this->parent->showError( 'config-session-expired',
+ $wgLang->formatTimePeriod( $lifetime ) );
}
$this->parent->setSession( 'test', true );
@@ -203,8 +207,10 @@ class WebInstaller_Language extends WebInstallerPage {
}
$this->startForm();
$s = Html::hidden( 'LanguageRequestTime', time() ) .
- $this->getLanguageSelector( 'UserLang', 'config-your-language', $userLang, $this->parent->getHelpBox( 'config-your-language-help' ) ) .
- $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang, $this->parent->getHelpBox( 'config-wiki-language-help' ) );
+ $this->getLanguageSelector( 'uselang', 'config-your-language', $userLang,
+ $this->parent->getHelpBox( 'config-your-language-help' ) ) .
+ $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang,
+ $this->parent->getHelpBox( 'config-wiki-language-help' ) );
$this->addHTML( $s );
$this->endForm( 'continue', false );
}
@@ -212,6 +218,10 @@ class WebInstaller_Language extends WebInstallerPage {
/**
* Get a <select> for selecting languages.
*
+ * @param $name
+ * @param $label
+ * @param $selectedCode
+ * @param $helpHtml string
* @return string
*/
public function getLanguageSelector( $name, $label, $selectedCode, $helpHtml = '' ) {
@@ -219,13 +229,13 @@ class WebInstaller_Language extends WebInstallerPage {
$s = $helpHtml;
- $s .= Html::openElement( 'select', array( 'id' => $name, 'name' => $name, 'tabindex' => $this->parent->nextTabIndex() ) ) . "\n";
+ $s .= Html::openElement( 'select', array( 'id' => $name, 'name' => $name,
+ 'tabindex' => $this->parent->nextTabIndex() ) ) . "\n";
$languages = Language::getLanguageNames();
ksort( $languages );
- $dummies = array_flip( $wgDummyLanguageCodes );
foreach ( $languages as $code => $lang ) {
- if ( isset( $dummies[$code] ) ) continue;
+ if ( isset( $wgDummyLanguageCodes[$code] ) ) continue;
$s .= "\n" . Xml::option( "$code - $lang", $code, $code == $selectedCode );
}
$s .= "\n</select>\n";
@@ -270,7 +280,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
$this->startForm();
$this->addHTML( $this->parent->getInfoBox(
wfMsgNoTrans( 'config-upgrade-key-missing',
- "<pre>\$wgUpgradeKey = '" . $this->getVar( 'wgUpgradeKey' ) . "';</pre>" )
+ "<pre dir=\"ltr\">\$wgUpgradeKey = '" . $this->getVar( 'wgUpgradeKey' ) . "';</pre>" )
) );
$this->endForm( 'continue' );
return 'output';
@@ -336,7 +346,8 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
*/
protected function handleExistingUpgrade( $vars ) {
// Check $wgDBtype
- if ( !isset( $vars['wgDBtype'] ) || !in_array( $vars['wgDBtype'], Installer::getDBTypes() ) ) {
+ if ( !isset( $vars['wgDBtype'] ) ||
+ !in_array( $vars['wgDBtype'], Installer::getDBTypes() ) ) {
return Status::newFatal( 'config-localsettings-connection-error', '' );
}
@@ -447,12 +458,13 @@ class WebInstaller_DBConnect extends WebInstallerPage {
"</li>\n";
$settings .=
- Html::openElement( 'div', array( 'id' => 'DB_wrapper_' . $type, 'class' => 'dbWrapper' ) ) .
+ Html::openElement( 'div', array( 'id' => 'DB_wrapper_' . $type,
+ 'class' => 'dbWrapper' ) ) .
Html::element( 'h3', array(), wfMsg( 'config-header-' . $type ) ) .
$installer->getConnectForm() .
"</div>\n";
}
- $types .= "</ul><br clear=\"left\"/>\n";
+ $types .= "</ul><br style=\"clear: left\"/>\n";
$this->addHTML(
$this->parent->label( 'config-db-type', false, $types ) .
@@ -620,7 +632,8 @@ class WebInstaller_Name extends WebInstallerPage {
'label' => 'config-project-namespace',
'itemLabelPrefix' => 'config-ns-',
'values' => array( 'site-name', 'generic', 'other' ),
- 'commonAttribs' => array( 'class' => 'enableForOther', 'rel' => 'config_wgMetaNamespace' ),
+ 'commonAttribs' => array( 'class' => 'enableForOther',
+ 'rel' => 'config_wgMetaNamespace' ),
'help' => $this->parent->getHelpBox( 'config-project-namespace-help' )
) ) .
$this->parent->getTextBox( array(
@@ -894,12 +907,14 @@ class WebInstaller_Options extends WebInstallerPage {
$this->parent->getTextBox( array(
'var' => 'wgDeletedDirectory',
'label' => 'config-upload-deleted',
+ 'attribs' => array( 'dir' => 'ltr' ),
'help' => $this->parent->getHelpBox( 'config-upload-deleted-help' )
) ) .
'</div>' .
$this->parent->getTextBox( array(
'var' => 'wgLogo',
'label' => 'config-logo',
+ 'attribs' => array( 'dir' => 'ltr' ),
'help' => $this->parent->getHelpBox( 'config-logo-help' )
) )
);
@@ -1174,10 +1189,12 @@ class WebInstaller_Complete extends WebInstallerPage {
// Pop up a dialog box, to make it difficult for the user to forget
// to download the file
$lsUrl = $this->getVar( 'wgServer' ) . $this->parent->getURL( array( 'localsettings' => 1 ) );
- if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) {
+ if ( isset( $_SERVER['HTTP_USER_AGENT'] ) &&
+ strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) {
// JS appears the only method that works consistently with IE7+
- $this->addHtml( "\n<script type=\"" . $GLOBALS['wgJsMimeType'] . '">jQuery( document ).ready( function() { document.location='
- . Xml::encodeJsVar( $lsUrl) . "; } );</script>\n" );
+ $this->addHtml( "\n<script type=\"" . $GLOBALS['wgJsMimeType'] .
+ '">jQuery( document ).ready( function() { document.location=' .
+ Xml::encodeJsVar( $lsUrl) . "; } );</script>\n" );
} else {
$this->parent->request->response()->header( "Refresh: 0;url=$lsUrl" );
}