* Get the starting tags of a fieldset.
*
* @param $legend String: message name
+ *
+ * @return string
*/
protected function getFieldsetStart( $legend ) {
return "\n<fieldset><legend>" . wfMsgHtml( $legend ) . "</legend>\n";
/**
* Get the end tag of a fieldset.
+ *
+ * @returns string
*/
protected function getFieldsetEnd() {
return "</fieldset>\n";
}
+
+ /**
+ * Opens a textarea used to display the progress of a long operation
+ */
+ protected function startLiveBox() {
+ $this->addHTML(
+ '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
+ '<script>jQuery( "#config-spinner" ).show();</script>' .
+ '<textarea id="config-live-log" name="LiveLog" rows="10" cols="30" readonly="readonly">'
+ );
+ $this->parent->output->flush();
+ }
+
+ /**
+ * Opposite to startLiveBox()
+ */
+ protected function endLiveBox() {
+ $this->addHTML( '</textarea>
+<script>jQuery( "#config-spinner" ).hide()</script>' );
+ $this->parent->output->flush();
+ }
}
class WebInstaller_Language extends WebInstallerPage {
/**
* Get a <select> for selecting languages.
+ *
+ * @return string
*/
public function getLanguageSelector( $name, $label, $selectedCode ) {
global $wgDummyLanguageCodes;
// If there is no $wgUpgradeKey, tell the user to add one to LocalSettings.php
if ( $vars['wgUpgradeKey'] === false ) {
if ( $this->getVar( 'wgUpgradeKey', false ) === false ) {
- $this->parent->generateUpgradeKey();
+ $secretKey = $this->getVar( 'wgSecretKey' ); // preserve $wgSecretKey
+ $this->parent->generateKeys();
+ $this->setVar( 'wgSecretKey', $secretKey );
$this->setVar( '_UpgradeKeySupplied', true );
}
$this->startForm();
if ( $this->parent->request->wasPosted() ) {
$installer->preUpgrade();
- $this->addHTML(
- '<div id="config-spinner" style="display:none;"><img src="../skins/common/images/ajax-loader.gif" /></div>' .
- '<script>jQuery( "#config-spinner" )[0].style.display = "block";</script>' .
- '<textarea id="config-update-log" name="UpdateLog" rows="10" readonly="readonly">'
- );
- $this->parent->output->flush();
+
+ $this->startLiveBox();
$result = $installer->doUpgrade();
- $this->addHTML( '</textarea>
-<script>jQuery( "#config-spinner" )[0].style.display = "none";</script>' );
- $this->parent->output->flush();
+ $this->endLiveBox();
+
if ( $result ) {
+ // If they're going to possibly regenerate LocalSettings, we
+ // need to create the upgrade/secret keys. Bug 26481
+ if( !$this->getVar( '_ExistingDBSettings' ) ) {
+ $this->parent->generateKeys();
+ }
$this->setVar( '_UpgradeDone', true );
$this->showDoneMessage();
return 'output';
} else {
$iframeAttribs['src'] = $this->getCCPartnerUrl();
}
+ $wrapperStyle = ($this->getVar('_LicenseCode') == 'cc-choose') ? '' : 'display: none';
return
- "<div class=\"config-cc-wrapper\" id=\"config-cc-wrapper\" style=\"display: none;\">\n" .
+ "<div class=\"config-cc-wrapper\" id=\"config-cc-wrapper\" style=\"$wrapperStyle\">\n" .
Html::element( 'iframe', $iframeAttribs, '', false /* not short */ ) .
"</div>\n";
}
public function startStage( $step ) {
$this->addHTML( "<li>" . wfMsgHtml( "config-install-$step" ) . wfMsg( 'ellipsis') );
+ if ( $step == 'extension-tables' ) {
+ $this->startLiveBox();
+ }
}
public function endStage( $step, $status ) {
+ if ( $step == 'extension-tables' ) {
+ $this->endLiveBox();
+ }
$msg = $status->isOk() ? 'config-install-step-done' : 'config-install-step-failed';
$html = wfMsgHtml( 'word-separator' ) . wfMsgHtml( $msg );
if ( !$status->isOk() ) {