r88506 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88505‎ | r88506 | r88507 >
Date:01:09, 21 May 2011
Author:erik
Status:ok
Tags:
Comment:
Replace hardcoded URL to Wikimedia Commons Help Desk with interface message.
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizardTutorial.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizardTutorial.php
@@ -16,9 +16,6 @@
1717 // imagemap coordinates of the "helpdesk" button at the bottom, which is supposed to be clickable.
1818 const HELPDESK_BUTTON_COORDS = "27, 1319, 691, 1384";
1919
20 - // link to help desk within commons tutorial
21 - const HELPDESK_URL = 'http://commons.wikimedia.org/wiki/Help_desk';
22 -
2320 // id of imagemap used in tutorial
2421 const IMAGEMAP_ID = 'tutorialMap';
2522
@@ -95,6 +92,17 @@
9693 * @return {String} HTML representing the image, with clickable helpdesk button
9794 */
9895 public static function getImageHtml( $thumb ) {
 96+
 97+ $helpDeskUrl = wfMsg( 'mwe-upwiz-help-desk-url' );
 98+
 99+ // Per convention, we may be either using an absolute URL or a wiki page title in this UI message
 100+ if( preg_match( '/^(?:' . wfUrlProtocols() . ')/', $helpDeskUrl )) {
 101+ $helpDeskHref = $helpDeskUrl;
 102+ } else {
 103+ $helpDeskTitle = Title::newFromText( $helpDeskUrl );
 104+ $helpDeskHref = $helpDeskTitle ? $helpDeskTitle->getLocalURL() : '#';
 105+ }
 106+
99107 // here we use the not-yet-forgotten HTML imagemap to add a clickable area to the tutorial image.
100108 // we could do more special effects with hovers and images and such, not to mention SVG scripting,
101109 // but we aren't sure what we want yet...
@@ -108,7 +116,7 @@
109117 $area = Html::element( 'area', array(
110118 'shape' => 'rect',
111119 'coords' => self::HELPDESK_BUTTON_COORDS,
112 - 'href' => self::HELPDESK_URL,
 120+ 'href' => $helpDeskHref,
113121 'alt' => $areaAltText,
114122 'title' => $areaAltText
115123 ) );
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -64,6 +64,7 @@
6565 'mwe-upwiz-tutorial-error-file-missing' => 'Sorry, we could not find any files for the tutorial that is supposed to go here. Please contact the system administrators.',
6666 'mwe-upwiz-tutorial-error-cannot-transform' => 'Sorry, we could not get a scaled image of the tutorial to fit this screen. This may be a temporary problem with Wikimedia Commons; try again later.',
6767 'mwe-upwiz-help-desk' => 'Help Desk',
 68+ 'mwe-upwiz-help-desk-url' => 'Help Desk',
6869 'mwe-upwiz-add-file-n' => 'Add another file',
6970 'mwe-upwiz-add-file-0-free' => 'Select a media file to donate',
7071 'mwe-upwiz-transport-started' => 'Starting...',

Sign-offs

UserFlagDate
NeilKinspected16:40, 13 June 2011
NeilKtested16:40, 13 June 2011

Status & tagging log