https://www.mediawiki.org/wiki/Special:Code/MediaWiki/111988

Revision: 111988
Author:   jeroendedauw
Date:     2012-02-21 02:48:03 +0000 (Tue, 21 Feb 2012)
Log Message:
-----------
added help message to ambassador profile forms

Modified Paths:
--------------
    trunk/extensions/EducationProgram/EducationProgram.i18n.php
    trunk/extensions/EducationProgram/EducationProgram.php
    trunk/extensions/EducationProgram/EducationProgram.settings.php
    trunk/extensions/EducationProgram/specials/SpecialAmbassadorProfile.php

Added Paths:
-----------
    trunk/extensions/EducationProgram/resources/ep.ambprofile.css

Modified: trunk/extensions/EducationProgram/EducationProgram.i18n.php
===================================================================
--- trunk/extensions/EducationProgram/EducationProgram.i18n.php 2012-02-21 
02:14:36 UTC (rev 111987)
+++ trunk/extensions/EducationProgram/EducationProgram.i18n.php 2012-02-21 
02:48:03 UTC (rev 111988)
@@ -619,6 +619,7 @@
        'epoa-profile-invalid-photo' => 'The photo must be located on 
{{PLURAL:$2|this website: $1|one of these websites: $1}}',
        'epoa-profile-bio' => 'Short bio',
        'epoa-profile-photo' => 'Profile photo',
+       '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]!',
        'epoa-profile-saved' => 'Your profile has been saved',
 
        // Special:CampusAmbassadorProfile
@@ -628,6 +629,7 @@
        'epca-profile-invalid-photo' => 'The photo must be located on 
{{PLURAL:$2|this website: $1|one of these websites: $1}}',
        'epca-profile-bio' => 'Short bio',
        'epca-profile-photo' => 'Profile photo',
+       '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]!',
        'epca-profile-saved' => 'Your profile has been saved',
 );
 

Modified: trunk/extensions/EducationProgram/EducationProgram.php
===================================================================
--- trunk/extensions/EducationProgram/EducationProgram.php      2012-02-21 
02:14:36 UTC (rev 111987)
+++ trunk/extensions/EducationProgram/EducationProgram.php      2012-02-21 
02:48:03 UTC (rev 111988)
@@ -423,6 +423,9 @@
        'scripts' => array(
                'ep.ambprofile.js',
        ),
+       'styles' => array(
+               'ep.ambprofile.css',
+       ),
        'dependencies' => array(
                'jquery.ui.button',
                'ep.imageinput',

Modified: trunk/extensions/EducationProgram/EducationProgram.settings.php
===================================================================
--- trunk/extensions/EducationProgram/EducationProgram.settings.php     
2012-02-21 02:14:36 UTC (rev 111987)
+++ trunk/extensions/EducationProgram/EducationProgram.settings.php     
2012-02-21 02:48:03 UTC (rev 111988)
@@ -32,6 +32,7 @@
                        'ambassadorPictureDomains' => array(
                                'wikimedia.org'
                        ),
+                       'ambassadorCommonsUrl' => 
'https://commons.wikimedia.org/wiki/Special:UploadWizard',
                );
        }
 

Added: trunk/extensions/EducationProgram/resources/ep.ambprofile.css
===================================================================
--- trunk/extensions/EducationProgram/resources/ep.ambprofile.css               
                (rev 0)
+++ trunk/extensions/EducationProgram/resources/ep.ambprofile.css       
2012-02-21 02:48:03 UTC (rev 111988)
@@ -0,0 +1,13 @@
+/**
+ * CSS for the Education Program MediaWiki extension.
+ * @see https://www.mediawiki.org/wiki/Extension:Education_Program
+ * 
+ * @licence GNU GPL v3 or later
+ * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
+ */
+
+td.htmlform-tip {
+       font-size: small;
+       padding: .2em 2em;
+       color: #666666;
+}
\ No newline at end of file


Property changes on: 
trunk/extensions/EducationProgram/resources/ep.ambprofile.css
___________________________________________________________________
Added: svn:eol-style
   + native

Modified: 
trunk/extensions/EducationProgram/specials/SpecialAmbassadorProfile.php
===================================================================
--- trunk/extensions/EducationProgram/specials/SpecialAmbassadorProfile.php     
2012-02-21 02:14:36 UTC (rev 111987)
+++ trunk/extensions/EducationProgram/specials/SpecialAmbassadorProfile.php     
2012-02-21 02:48:03 UTC (rev 111988)
@@ -69,35 +69,12 @@
                        'id' => 'wpTextbox1',
                        'default' => $ambassador->getField( 'bio' ),
                );
-
-//             $lang = $this->getLanguage();
-//
-//             $prefix = $this->getMsgPrefix();
+               
+               // FIXME: ambassadorCommonsUrl is not getting passed, this 
looks like a bug or regression in HTMLForm since nothing else passes args to 
help-message.
                $fields['photo'] = array(
                        'type' => 'text',
                        'label-message' => $this->getMsgPrefix() . 
'profile-photo',
-//                     'validation-callback' => function ( $value, array 
$alldata = null ) use ( $lang, $prefix ) {
-//                             if ( trim( $value ) === '' ) {
-//                                     return true;
-//                             }
-//
-//                             $domains = EPSettings::get( 
'ambassadorPictureDomains' );
-//
-//                             foreach ( $domains as $domain ) {
-//                                     $pattern = 
'@^https?://(([a-z0-9]+)\.)?' . str_replace( '.', '\.', $domain ) . '/.*$@i';
-//
-//                                     if ( preg_match( $pattern, $value ) ) {
-//                                             return true;
-//                                     }
-//                             }
-//
-//                             return wfMsgExt(
-//                                     $prefix . 'profile-invalid-photo',
-//                                     'parsemag',
-//                                     $lang->listToText( $domains ),
-//                                     count( $domains )
-//                             );
-//                     },
+                       'help-message' => array( $this->getMsgPrefix() . 
'profile-photo-help', EPSettings::get( 'ambassadorCommonsUrl' ) ),
                        'default' => $ambassador->getField( 'photo' ),
                        'cssclass' => 'commons-input',
                );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to