r112943 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112942‎ | r112943 | r112944 >
Date:12:07, 3 March 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.settings.php (modified) (history)
  • /trunk/extensions/EducationProgram/actions/EditOrgAction.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.settings.php
@@ -33,6 +33,7 @@
3434 'wikimedia.org'
3535 ),
3636 'ambassadorCommonsUrl' => 'https://commons.wikimedia.org/wiki/Special:UploadWizard',
 37+ 'citylessCountries' => array( 'BT', 'BV', 'IO', 'VG', 'TD', 'CX', 'CC', 'KM', 'DJ', 'GQ', 'FK', 'FX', 'TF', 'GW', 'HM', 'KI', 'YT', 'MS', 'NR', 'NU', 'NF', 'PN', 'SH', 'PM', 'WS', 'SC', 'GS', 'SJ', 'TK', 'TP', 'TV', 'UM', 'VU', 'EH' ),
3738 );
3839 }
3940
Index: trunk/extensions/EducationProgram/actions/EditOrgAction.php
@@ -16,7 +16,7 @@
1717
1818 /**
1919 * Constructor.
20 - *
 20+ *Re
2121 * @since 0.1
2222 *
2323 * @param Page $page
@@ -71,12 +71,15 @@
7272 $fields['city'] = array (
7373 'type' => 'text',
7474 'label-message' => 'educationprogram-org-edit-city',
75 - 'required' => true,
7675 'validation-callback' => function ( $value, array $alldata = null ) {
77 - return strlen( $value ) < 2 ? wfMsg( 'educationprogram-org-invalid-city' ) : true;
 76+ return $value !== '' && strlen( $value ) < 2 ? wfMsg( 'educationprogram-org-invalid-city' ) : true;
7877 } ,
7978 );
8079
 80+ if ( !in_array( $this->getRequest()->getText( 'wpitem-country', '' ), EPSettings::get( 'citylessCountries' ) ) ) {
 81+ $fields['city']['required'] = true;
 82+ }
 83+
8184 $fields['country'] = array (
8285 'type' => 'select',
8386 'label-message' => 'educationprogram-org-edit-country',
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -372,6 +372,10 @@
373373 'orgpage-edit-undelete-revisions' => 'This institution has been deleted. You can $1.',
374374 'orgpage-edit-undelete-link' => 'restore $1 {{PLURAL:$1|revision|revisions}}',
375375
 376+ 'educationprogram-org-invalid-name' => 'The name needs to be at least contain $1 {{PLURAL:$1|character|characters}}.',
 377+ 'educationprogram-org-invalid-city' => 'The city name needs to be at least contain $1 {{PLURAL:$1|character|characters}}.',
 378+ 'educationprogram-org-invalid-country' => 'This is not a valid country.',
 379+
376380 // Course editing
377381 'orgpage-edit-legend-add' => 'Add course',
378382 'orgpage-edit-legend-edit' => 'Edit course',

Status & tagging log