r71129 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r71128‎ | r71129 | r71130 >
Date:16:49, 15 August 2010
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
Added MediaWiki core update detection to Special:Update
Modified paths:
  • /trunk/extensions/Deployment/Deployment.i18n.php (modified) (history)
  • /trunk/extensions/Deployment/specials/SpecialUpdate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Deployment/specials/SpecialUpdate.php
@@ -71,7 +71,7 @@
7272 $this->showCoreStatus( false );
7373 }
7474
75 - $this->showExtensionStatuses( count( $updates ) > 0 ? $updates : false );
 75+ $this->showExtensionStatuses($updates );
7676 }
7777
7878 } else {
@@ -85,12 +85,20 @@
8686 *
8787 * @since 0.1
8888 *
89 - * @param $status
 89+ * @param $status Mixed: false when there are no updates or a version number (string) when there is.
9090 */
9191 protected function showCoreStatus( $status ) {
92 - global $wgVersion;
 92+ global $wgOut, $wgVersion;
9393
94 -
 94+ if ( $status !== false ) {
 95+ $wgOut->addHTML( '<h3>' . wfMsg( 'mediawiki-up-to-date' ) . '</h3>' );
 96+ $wgOut->addWikiMsg( 'mediawiki-up-to-date-long' );
 97+ }
 98+ else {
 99+ $wgOut->addHTML( '<h3>' . wfMsg( 'mediawiki-update-available' ) . '</h3>' );
 100+ // TODO: link
 101+ $wgOut->addWikiMsgArray( 'mediawiki-update-available-long', array( $status, '' ) );
 102+ }
95103 }
96104
97105 /**
@@ -99,12 +107,12 @@
100108 *
101109 * @since 0.1
102110 *
103 - * @param $status
 111+ * @param $extensions Array: the extensions that have updates and their version numbers.
104112 */
105 - protected function showExtensionStatuses() {
106 - global $wgExtensionCredits;
 113+ protected function showExtensionStatuses( array $extensions ) {
 114+ global $wgOut, $wgExtensionCredits;
107115
108 -
 116+ //$wgOut->addHTML( var_dump($extensions) );
109117 // TODO
110118 }
111119
Index: trunk/extensions/Deployment/Deployment.i18n.php
@@ -62,7 +62,9 @@
6363
6464 // Special:Update
6565 'mediawiki-up-to-date' => 'You have the latest version of MediaWiki.',
66 - 'mediawiki-up-to-date-long' => 'You have the latest version of MediaWiki. You do not need to upgrade.',
 66+ 'mediawiki-up-to-date-long' => 'You have the latest version of MediaWiki ([[Special:Version|view version]]). You do not need to upgrade.',
 67+ 'mediawiki-update-available' => 'A new version of MediaWiki is available!',
 68+ 'mediawiki-update-available-long' => 'MediaWiki version $1 is available. [$2 Upgrade now] to keep your wiki secure and get the new awesome features in this release.',
6769 'extensions-up-to-date' => 'Your extensions are all up to date.',
6870
6971 // Special:Install

Comments

#Comment by Jeroen De Dauw (talk | contribs)   16:50, 15 August 2010

That !== should be an ===, will fix in follow up.

Status & tagging log