r106950 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106949‎ | r106950 | r106951 >
Date:15:56, 21 December 2011
Author:jeroendedauw
Status:deferred
Tags:educationprogram 
Comment:
work on editing of stuff
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPCoursePager.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOrg.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPTerm.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEditCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEditTerm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php
@@ -17,8 +17,8 @@
1818 /** English (English) */
1919 $specialPageAliases['en'] = array(
2020 'MyCourses' => array( 'MyCourses' ),
21 - 'Institution' => array( 'Institution' ),
22 - 'Institutions' => array( 'Institutions' ),
 21+ 'Institution' => array( 'Institution', 'Org' ),
 22+ 'Institutions' => array( 'Institutions', 'Orgs' ),
2323 'Student' => array( 'Student' ),
2424 'Students' => array( 'Students' ),
2525 'Course' => array( 'Course' ),
Index: trunk/extensions/EducationProgram/specials/SpecialEditTerm.php
@@ -42,7 +42,6 @@
4343 'validation-callback' => function ( $value, array $alldata = null ) use ( $courseOptions ) {
4444 return in_array( (int)$value, array_values( $courseOptions ) ) ? true : wfMsg( 'ep-term-invalid-course' );
4545 },
46 - 'default' => array_shift( $courseOptions )
4746 );
4847
4948 $fields['year'] = array (
@@ -71,22 +70,6 @@
7271
7372 /**
7473 * (non-PHPdoc)
75 - * @see SpecialEPFormPage::getDefaultFromItem()
76 - */
77 - protected function getDefaultFromItem( EPDBObject $item, $name ) {
78 - $default = $item->getField( $name );
79 -
80 - if ( in_array( $name, array( 'start', 'end' ) ) ) {
81 - $default = wfTimestamp( TS_ISO_8601, $default );
82 - $default = explode( 'T', $default );
83 - $default = $default[0];
84 - }
85 -
86 - return $default;
87 - }
88 -
89 - /**
90 - * (non-PHPdoc)
9174 * @see SpecialEPFormPage::getTitleConditions()
9275 */
9376 protected function getTitleConditions() {
@@ -132,6 +115,11 @@
133116 : 20;
134117 }
135118
 119+ function getInputHTML( $value ) {
 120+ $value = explode( 'T', wfTimestamp( TS_ISO_8601, $value ) );
 121+ return parent::getInputHTML( $value[0] );
 122+ }
 123+
136124 function validate( $value, $alldata ) {
137125 $p = parent::validate( $value, $alldata );
138126
Index: trunk/extensions/EducationProgram/specials/SpecialEditCourse.php
@@ -49,7 +49,6 @@
5050 'validation-callback' => function ( $value, array $alldata = null ) use ( $orgOptions ) {
5151 return in_array( (int)$value, array_values( $orgOptions ) ) ? true : wfMsg( 'ep-course-invalid-org' );
5252 },
53 - 'default' => array_shift( $orgOptions )
5453 );
5554
5655 $fields['description'] = array (
@@ -59,8 +58,7 @@
6059 'validation-callback' => function ( $value, array $alldata = null ) {
6160 return strlen( $value ) < 10 ? wfMsgExt( 'ep-course-invalid-description', 'parsemag', 10 ) : true;
6261 },
63 - 'default' => '',
64 - 'rows' => 5
 62+ 'rows' => 10
6563 );
6664
6765 return $this->processFormFields( $fields );
Index: trunk/extensions/EducationProgram/includes/EPOrg.php
@@ -29,7 +29,11 @@
3030 'country' => 'str',
3131 );
3232 }
33 -
 33+
 34+ /**
 35+ * (non-PHPdoc)
 36+ * @see EPDBObject::getDefaults()
 37+ */
3438 public static function getDefaults() {
3539 return array(
3640 'name' => '',
Index: trunk/extensions/EducationProgram/includes/EPTerm.php
@@ -31,5 +31,17 @@
3232 'end' => 'str', // TS_MW
3333 );
3434 }
 35+
 36+ /**
 37+ * (non-PHPdoc)
 38+ * @see EPDBObject::getDefaults()
 39+ */
 40+ public static function getDefaults() {
 41+ return array(
 42+ 'year' => substr( wfTimestamp( TS_MW ), 0, 4 ),
 43+ 'start' => wfTimestamp( TS_MW ),
 44+ 'end' => wfTimestamp( TS_MW ),
 45+ );
 46+ }
3547
3648 }
Index: trunk/extensions/EducationProgram/includes/EPCoursePager.php
@@ -32,8 +32,8 @@
3333 */
3434 public function getFieldNames() {
3535 return parent::getFieldNameList( array(
 36+ 'name',
3637 'org_id',
37 - 'name',
3838 ) );
3939 }
4040
Index: trunk/extensions/EducationProgram/includes/EPCourse.php
@@ -32,6 +32,16 @@
3333 }
3434
3535 /**
 36+ * (non-PHPdoc)
 37+ * @see EPDBObject::getDefaults()
 38+ */
 39+ public static function getDefaults() {
 40+ return array(
 41+ 'description' => '',
 42+ );
 43+ }
 44+
 45+ /**
3646 * Returns a list of courses in an array that can be fed to select inputs.
3747 *
3848 * @since 0.1

Status & tagging log