r111988 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111987‎ | r111988 | r111989 >
Date:02:48, 21 February 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added help message to ambassador profile forms
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.settings.php (modified) (history)
  • /trunk/extensions/EducationProgram/resources/ep.ambprofile.css (added) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialAmbassadorProfile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.settings.php
@@ -32,6 +32,7 @@
3333 'ambassadorPictureDomains' => array(
3434 'wikimedia.org'
3535 ),
 36+ 'ambassadorCommonsUrl' => 'https://commons.wikimedia.org/wiki/Special:UploadWizard',
3637 );
3738 }
3839
Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -423,6 +423,9 @@
424424 'scripts' => array(
425425 'ep.ambprofile.js',
426426 ),
 427+ 'styles' => array(
 428+ 'ep.ambprofile.css',
 429+ ),
427430 'dependencies' => array(
428431 'jquery.ui.button',
429432 'ep.imageinput',
Index: trunk/extensions/EducationProgram/specials/SpecialAmbassadorProfile.php
@@ -69,35 +69,12 @@
7070 'id' => 'wpTextbox1',
7171 'default' => $ambassador->getField( 'bio' ),
7272 );
73 -
74 -// $lang = $this->getLanguage();
75 -//
76 -// $prefix = $this->getMsgPrefix();
 73+
 74+ // FIXME: ambassadorCommonsUrl is not getting passed, this looks like a bug or regression in HTMLForm since nothing else passes args to help-message.
7775 $fields['photo'] = array(
7876 'type' => 'text',
7977 'label-message' => $this->getMsgPrefix() . 'profile-photo',
80 -// 'validation-callback' => function ( $value, array $alldata = null ) use ( $lang, $prefix ) {
81 -// if ( trim( $value ) === '' ) {
82 -// return true;
83 -// }
84 -//
85 -// $domains = EPSettings::get( 'ambassadorPictureDomains' );
86 -//
87 -// foreach ( $domains as $domain ) {
88 -// $pattern = '@^https?://(([a-z0-9]+)\.)?' . str_replace( '.', '\.', $domain ) . '/.*$@i';
89 -//
90 -// if ( preg_match( $pattern, $value ) ) {
91 -// return true;
92 -// }
93 -// }
94 -//
95 -// return wfMsgExt(
96 -// $prefix . 'profile-invalid-photo',
97 -// 'parsemag',
98 -// $lang->listToText( $domains ),
99 -// count( $domains )
100 -// );
101 -// },
 78+ 'help-message' => array( $this->getMsgPrefix() . 'profile-photo-help', EPSettings::get( 'ambassadorCommonsUrl' ) ),
10279 'default' => $ambassador->getField( 'photo' ),
10380 'cssclass' => 'commons-input',
10481 );
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -619,6 +619,7 @@
620620 'epoa-profile-invalid-photo' => 'The photo must be located on {{PLURAL:$2|this website: $1|one of these websites: $1}}',
621621 'epoa-profile-bio' => 'Short bio',
622622 'epoa-profile-photo' => 'Profile photo',
 623+ 'epoa-profile-photo-help' => 'A picture of you that will be shown next to your bio. Enter the name of an image on Wikimedia Commons and a preview will appear. You can type the first few letters of the image name and then select your image from the suggestion list. If you do not have a picture of you on commons yet, [$1 go upload one]!',
623624 'epoa-profile-saved' => 'Your profile has been saved',
624625
625626 // Special:CampusAmbassadorProfile
@@ -628,6 +629,7 @@
629630 'epca-profile-invalid-photo' => 'The photo must be located on {{PLURAL:$2|this website: $1|one of these websites: $1}}',
630631 'epca-profile-bio' => 'Short bio',
631632 'epca-profile-photo' => 'Profile photo',
 633+ 'epca-profile-photo-help' => 'A picture of you that will be shown next to your bio. Enter the name of an image on Wikimedia Commons and a preview will appear. You can type the first few letters of the image name and then select your image from the suggestion list. If you do not have a picture of you on commons yet, [$1 go upload one]!',
632634 'epca-profile-saved' => 'Your profile has been saved',
633635 );
634636
Index: trunk/extensions/EducationProgram/resources/ep.ambprofile.css
@@ -0,0 +1,13 @@
 2+/**
 3+ * CSS for the Education Program MediaWiki extension.
 4+ * @see https://www.mediawiki.org/wiki/Extension:Education_Program
 5+ *
 6+ * @licence GNU GPL v3 or later
 7+ * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
 8+ */
 9+
 10+td.htmlform-tip {
 11+ font-size: small;
 12+ padding: .2em 2em;
 13+ color: #666666;
 14+}
\ No newline at end of file
Property changes on: trunk/extensions/EducationProgram/resources/ep.ambprofile.css
___________________________________________________________________
Added: svn:eol-style
115 + native

Status & tagging log