r109697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109696‎ | r109697 | r109698 >
Date:22:15, 21 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r109656 - renaming
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPMC.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEditCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEditTerm.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialInstitution.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialInstitution.php
@@ -69,12 +69,12 @@
7070
7171 $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-courses' ) ) );
7272
73 - EPCourse::displayPager( $this->getContext(), array( 'org_id' => $org->getId() ) );
 73+ EPMC::displayPager( $this->getContext(), array( 'org_id' => $org->getId() ) );
7474
7575 if ( $this->getUser()->isAllowed( 'ep-course' ) ) {
7676 $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-institution-add-course' ) ) );
7777
78 - EPCourse::displayAddNewControl( $this->getContext(), array( 'org' => $org->getId() ) );
 78+ EPMC::displayAddNewControl( $this->getContext(), array( 'org' => $org->getId() ) );
7979 }
8080 }
8181 }
Index: trunk/extensions/EducationProgram/specials/SpecialEditCourse.php
@@ -1,17 +1,17 @@
22 <?php
33
44 /**
5 - * Adittion and modification interface for courses.
 5+ * Addition and modification interface for master courses.
66 *
77 * @since 0.1
88 *
9 - * @file SpecialEditCourse.php
 9+ * @file SpecialEditMasterCourse.php
1010 * @ingroup EducationProgram
1111 *
1212 * @licence GNU GPL v3 or later
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
15 -class SpecialEditCourse extends SpecialEPFormPage {
 15+class SpecialEditMasterCourse extends SpecialEPFormPage {
1616
1717 /**
1818 * Constructor.
@@ -19,7 +19,7 @@
2020 * @since 0.1
2121 */
2222 public function __construct() {
23 - parent::__construct( 'EditCourse', 'ep-course', 'EPCourse', 'Courses' );
 23+ parent::__construct( 'EditMasterCourse', 'ep-mc', 'EPMC', 'MasterCourses' );
2424 }
2525
2626 /**
@@ -32,11 +32,11 @@
3333
3434 $fields['name'] = array (
3535 'type' => 'text',
36 - 'label-message' => 'ep-course-edit-name',
 36+ 'label-message' => 'ep-mc-edit-name',
3737 'maxlength' => 255,
3838 'required' => true,
3939 'validation-callback' => function ( $value, array $alldata = null ) {
40 - return strlen( $value ) < 5 ? wfMsgExt( 'ep-course-invalid-name', 'parsemag', 5 ) : true;
 40+ return strlen( $value ) < 5 ? wfMsgExt( 'ep-mc-invalid-name', 'parsemag', 5 ) : true;
4141 } ,
4242 );
4343
@@ -44,20 +44,20 @@
4545
4646 $fields['org_id'] = array (
4747 'type' => 'select',
48 - 'label-message' => 'ep-course-edit-org',
 48+ 'label-message' => 'ep-mc-edit-org',
4949 'required' => true,
5050 'options' => $orgOptions,
5151 'validation-callback' => function ( $value, array $alldata = null ) use ( $orgOptions ) {
52 - return in_array( (int)$value, array_values( $orgOptions ) ) ? true : wfMsg( 'ep-course-invalid-org' );
 52+ return in_array( (int)$value, array_values( $orgOptions ) ) ? true : wfMsg( 'ep-mc-invalid-org' );
5353 } ,
5454 );
5555
5656 $fields['description'] = array (
5757 'type' => 'textarea',
58 - 'label-message' => 'ep-course-edit-description',
 58+ 'label-message' => 'ep-mc-edit-description',
5959 'required' => true,
6060 'validation-callback' => function ( $value, array $alldata = null ) {
61 - return strlen( $value ) < 10 ? wfMsgExt( 'ep-course-invalid-description', 'parsemag', 10 ) : true;
 61+ return strlen( $value ) < 10 ? wfMsgExt( 'ep-mc-invalid-description', 'parsemag', 10 ) : true;
6262 } ,
6363 'rows' => 10,
6464 'id' => 'wpTextbox1',
Index: trunk/extensions/EducationProgram/specials/SpecialEditTerm.php
@@ -1,17 +1,17 @@
22 <?php
33
44 /**
5 - * Adittion and modification interface for terms.
 5+ * Addition and modification interface for courses.
66 *
77 * @since 0.1
88 *
9 - * @file SpecialEditTerm.php
 9+ * @file SpecialEditCourse.php
1010 * @ingroup EducationProgram
1111 *
1212 * @licence GNU GPL v3 or later
1313 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
1414 */
15 -class SpecialEditTerm extends SpecialEPFormPage {
 15+class SpecialEditCourse extends SpecialEPFormPage {
1616
1717 /**
1818 * Constructor.
@@ -19,7 +19,7 @@
2020 * @since 0.1
2121 */
2222 public function __construct() {
23 - parent::__construct( 'EditCourse', 'ep-term', 'EPCourse', 'Courses' );
 23+ parent::__construct( 'EditCourse', 'ep-course', 'EPCourse', 'Courses' );
2424
2525 $this->getOutput()->addModules( 'ep.datepicker' );
2626 }
@@ -32,33 +32,33 @@
3333 protected function getFormFields() {
3434 $fields = parent::getFormFields();
3535
36 - $courseOptions = EPCourse::getCourseOptions();
 36+ $courseOptions = EPMC::getMasterCourseOptions();
3737
38 - $fields['course_id'] = array (
 38+ $fields['mc_id'] = array (
3939 'type' => 'select',
40 - 'label-message' => 'ep-term-edit-course',
 40+ 'label-message' => 'ep-course-edit-mastercourse',
4141 'required' => true,
4242 'options' => $courseOptions,
4343 'validation-callback' => function ( $value, array $alldata = null ) use ( $courseOptions ) {
44 - return in_array( (int)$value, array_values( $courseOptions ) ) ? true : wfMsg( 'ep-term-invalid-course' );
 44+ return in_array( (int)$value, array_values( $courseOptions ) ) ? true : wfMsg( 'ep-course-invalid-course' );
4545 },
4646 );
4747
4848 $fields['token'] = array (
4949 'type' => 'text',
50 - 'label-message' => 'ep-term-edit-token',
 50+ 'label-message' => 'ep-course-edit-token',
5151 'maxlength' => 255,
5252 'required' => true,
5353 'size' => 20,
5454 'validation-callback' => function ( $value, array $alldata = null ) {
5555 $strLen = strlen( $value );
56 - return ( $strLen !== 0 && $strLen < 2 ) ? wfMsgExt( 'ep-term-invalid-token', 'parsemag', 2 ) : true;
 56+ return ( $strLen !== 0 && $strLen < 2 ) ? wfMsgExt( 'ep-course-invalid-token', 'parsemag', 2 ) : true;
5757 } ,
5858 );
5959
6060 $fields['year'] = array (
6161 'type' => 'int',
62 - 'label-message' => 'ep-term-edit-year',
 62+ 'label-message' => 'ep-course-edit-year',
6363 'required' => true,
6464 'min' => 2000,
6565 'max' => 9001,
@@ -67,22 +67,22 @@
6868
6969 $fields['start'] = array (
7070 'class' => 'EPHTMLDateField',
71 - 'label-message' => 'ep-term-edit-start',
 71+ 'label-message' => 'ep-course-edit-start',
7272 'required' => true,
7373 );
7474
7575 $fields['end'] = array (
7676 'class' => 'EPHTMLDateField',
77 - 'label-message' => 'ep-term-edit-end',
 77+ 'label-message' => 'ep-course-edit-end',
7878 'required' => true,
7979 );
8080
8181 $fields['description'] = array (
8282 'type' => 'textarea',
83 - 'label-message' => 'ep-term-edit-description',
 83+ 'label-message' => 'ep-course-edit-description',
8484 'required' => true,
8585 'validation-callback' => function ( $value, array $alldata = null ) {
86 - return strlen( $value ) < 10 ? wfMsgExt( 'ep-term-invalid-description', 'parsemag', 10 ) : true;
 86+ return strlen( $value ) < 10 ? wfMsgExt( 'ep-course-invalid-description', 'parsemag', 10 ) : true;
8787 } ,
8888 'rows' => 10,
8989 'id' => 'wpTextbox1',
@@ -105,7 +105,7 @@
106106 */
107107 protected function getNewData() {
108108 return array(
109 - 'course_id' => $this->getRequest()->getVal( 'newcourse' ),
 109+ 'mc_id' => $this->getRequest()->getVal( 'newmc' ),
110110 'year' => $this->getRequest()->getVal( 'newyear' ),
111111 );
112112 }
Index: trunk/extensions/EducationProgram/includes/EPMC.php
@@ -320,7 +320,7 @@
321321 }
322322 else {
323323 $context->getOutput()->addHTML( $pager->getFilterControl( true ) );
324 - $context->getOutput()->addWikiMsg( 'ep-courses-noresults' );
 324+ $context->getOutput()->addWikiMsg( 'ep-mc-noresults' );
325325 }
326326 }
327327
Index: trunk/extensions/EducationProgram/includes/EPCourse.php
@@ -337,7 +337,7 @@
338338 }
339339 else {
340340 $context->getOutput()->addHTML( $pager->getFilterControl( true ) );
341 - $context->getOutput()->addWikiMsg( 'ep-terms-noresults' );
 341+ $context->getOutput()->addWikiMsg( 'ep-courses-noresults' );
342342 }
343343 }
344344
@@ -369,25 +369,25 @@
370370
371371 $out->addHTML( '<fieldset>' );
372372
373 - $out->addHTML( '<legend>' . wfMsgHtml( 'ep-terms-addnew' ) . '</legend>' );
 373+ $out->addHTML( '<legend>' . wfMsgHtml( 'ep-courses-addnew' ) . '</legend>' );
374374
375 - $out->addHTML( Html::element( 'p', array(), wfMsg( 'ep-terms-namedoc' ) ) );
 375+ $out->addHTML( Html::element( 'p', array(), wfMsg( 'ep-courses-namedoc' ) ) );
376376
377 - $out->addHTML( Html::element( 'label', array( 'for' => 'newcourse' ), wfMsg( 'ep-terms-newcourse' ) ) );
 377+ $out->addHTML( Html::element( 'label', array( 'for' => 'newmc' ), wfMsg( 'ep-courses-newmastercourse' ) ) );
378378
379379 $select = new XmlSelect(
380 - 'newcourse',
381 - 'newcourse',
382 - array_key_exists( 'course', $args ) ? $args['course'] : false
 380+ 'newmc',
 381+ 'newmc',
 382+ array_key_exists( 'mc', $args ) ? $args['mc'] : false
383383 );
384384
385385 $select->addOptions( EPCourse::getCourseOptions() );
386386 $out->addHTML( $select->getHTML() );
387387
388 - $out->addHTML( '&#160;' . Xml::inputLabel( wfMsg( 'ep-terms-newyear' ), 'newyear', 'newyear', 10 ) );
 388+ $out->addHTML( '&#160;' . Xml::inputLabel( wfMsg( 'ep-courses-newyear' ), 'newyear', 'newyear', 10 ) );
389389
390390 $out->addHTML( '&#160;' . Html::input(
391 - 'addnewterm',
 391+ 'addnewcourse',
392392 wfMsg( 'ep-terms-add' ),
393393 'submit'
394394 ) );
@@ -413,7 +413,7 @@
414414 EPCourse::displayAddNewControl( $context, $args );
415415 }
416416 elseif ( $context->getUser()->isAllowed( 'ep-course' ) ) {
417 - $context->getOutput()->addWikiMsg( 'ep-terms-addcoursefirst' );
 417+ $context->getOutput()->addWikiMsg( 'ep-courses-addcoursefirst' );
418418 }
419419 }
420420
@@ -442,7 +442,7 @@
443443 }
444444
445445 /**
446 - * Returns the status of the term.
 446+ * Returns the status of the course.
447447 *
448448 * @since 0.1
449449 *
@@ -463,7 +463,7 @@
464464 }
465465
466466 /**
467 - * Get a link to Special:Term/id.
 467+ * Get a link to Special:Course/id.
468468 *
469469 * @since 0.1
470470 *
@@ -471,7 +471,7 @@
472472 */
473473 public function getLink() {
474474 return Linker::linkKnown(
475 - SpecialPage::getTitleFor( 'Term', $this->getId() ),
 475+ SpecialPage::getTitleFor( 'Course', $this->getId() ),
476476 htmlspecialchars( $this->getId() )
477477 );
478478 }
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -230,7 +230,7 @@
231231 'epcoursepager-header-year' => 'Year',
232232 'epcoursepager-header-start' => 'Start',
233233 'epcoursepager-header-end' => 'End',
234 - 'epcoursepager-filter-course-id' => 'Master course',
 234+ 'epcoursepager-filter-mc-id' => 'Master course',
235235 'epcoursepager-filter-year' => 'Year',
236236 'epcoursepager-filter-org-id' => 'Institution',
237237 'epcoursepager-header-status' => 'Status',
@@ -257,16 +257,16 @@
258258 'educationprogram-org-edit-country' => 'Country',
259259 'educationprogram-org-submit' => 'Submit',
260260
261 - // Special:EditCourse
262 - 'editcourse-add-legend' => 'Add course',
263 - 'editcourse-edit-legend' => 'Edit course',
264 - 'ep-course-edit-name' => 'Name',
265 - 'ep-course-edit-org' => 'Institution',
266 - 'ep-course-edit-description' => 'Description',
 261+ // Special:EditMasterCourse
 262+ 'editmastercourse-add-legend' => 'Add master course',
 263+ 'editmastercourse-edit-legend' => 'Edit master course',
 264+ 'ep-mc-edit-name' => 'Name',
 265+ 'ep-mc-edit-org' => 'Institution',
 266+ 'ep-mc-edit-description' => 'Description',
267267
268 - 'ep-course-invalid-name' => 'This name is to short. It needs to be at least contain $1 {{PLURAL:$1|character|characters}}.',
269 - 'ep-course-invalid-description' => 'This description is to short. It needs to be at least contain $1 {{PLURAL:$1|character|characters}}.',
270 - 'ep-course-invalid-org' => 'This institution does not exist',
 268+ 'ep-mc-invalid-name' => 'This name is to short. It needs to be at least contain $1 {{PLURAL:$1|character|characters}}.',
 269+ 'ep-mc-invalid-description' => 'This description is to short. It needs to be at least contain $1 {{PLURAL:$1|character|characters}}.',
 270+ 'ep-mc-invalid-org' => 'This institution does not exist',
271271
272272 // Special:EditCourse
273273 'editcourse-add-legend' => 'Add course',
@@ -298,7 +298,7 @@
299299 'specialinstitution-summary-country' => 'Country',
300300 'specialinstitution-summary-status' => 'Status',
301301 'specialinstitution-summary-courses' => 'Course count',
302 - 'specialinstitution-summary-terms' => 'Term count',
 302+ 'specialinstitution-summary-mcs' => 'Master course count',
303303 'specialinstitution-summary-students' => 'Student count',
304304 'ep-institution-nav-edit' => 'Edit this institution',
305305 'ep-institution-add-course' => 'Add a course',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109656schema changes currently completely breaking the extension and added hook to ...jeroendedauw22:24, 20 January 2012

Status & tagging log