r109704 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109703‎ | r109704 | r109705 >
Date:00:13, 22 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r109656 - renaming, also split off date input class
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPHTMLDateField.php (added) (history)
  • /trunk/extensions/EducationProgram/includes/EPMCPager.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEditCourse.php (added) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEditTerm.php (deleted) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialMasterCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/sql/EducationProgram.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/sql/EducationProgram.sql
@@ -51,6 +51,7 @@
5252 course_id INT unsigned NOT NULL auto_increment PRIMARY KEY,
5353
5454 course_mc_id INT unsigned NOT NULL, -- Foreign key on ep_mcs.mc_id
 55+ course_name VARCHAR(255) NOT NULL, -- Name of the course
5556 course_org_id INT unsigned NOT NULL, -- Foreign key on ep_orgs.org_id. Helper field, not strictly needed.
5657 course_year SMALLINT unsigned NOT NULL, -- Year in which the course takes place
5758 course_start varbinary(14) NOT NULL, -- Start time of the course
Index: trunk/extensions/EducationProgram/specials/SpecialEditTerm.php
@@ -1,159 +0,0 @@
2 -<?php
3 -
4 -/**
5 - * Addition and modification interface for courses.
6 - *
7 - * @since 0.1
8 - *
9 - * @file SpecialEditCourse.php
10 - * @ingroup EducationProgram
11 - *
12 - * @licence GNU GPL v3 or later
13 - * @author Jeroen De Dauw < jeroendedauw@gmail.com >
14 - */
15 -class SpecialEditCourse extends SpecialEPFormPage {
16 -
17 - /**
18 - * Constructor.
19 - *
20 - * @since 0.1
21 - */
22 - public function __construct() {
23 - parent::__construct( 'EditCourse', 'ep-course', 'EPCourse', 'Courses' );
24 -
25 - $this->getOutput()->addModules( 'ep.datepicker' );
26 - }
27 -
28 - /**
29 - * (non-PHPdoc)
30 - * @see SpecialEPFormPage::getFormFields()
31 - * @return array
32 - */
33 - protected function getFormFields() {
34 - $fields = parent::getFormFields();
35 -
36 - $courseOptions = EPMC::getMasterCourseOptions();
37 -
38 - $fields['mc_id'] = array (
39 - 'type' => 'select',
40 - 'label-message' => 'ep-course-edit-mastercourse',
41 - 'required' => true,
42 - 'options' => $courseOptions,
43 - 'validation-callback' => function ( $value, array $alldata = null ) use ( $courseOptions ) {
44 - return in_array( (int)$value, array_values( $courseOptions ) ) ? true : wfMsg( 'ep-course-invalid-course' );
45 - },
46 - );
47 -
48 - $fields['token'] = array (
49 - 'type' => 'text',
50 - 'label-message' => 'ep-course-edit-token',
51 - 'maxlength' => 255,
52 - 'required' => true,
53 - 'size' => 20,
54 - 'validation-callback' => function ( $value, array $alldata = null ) {
55 - $strLen = strlen( $value );
56 - return ( $strLen !== 0 && $strLen < 2 ) ? wfMsgExt( 'ep-course-invalid-token', 'parsemag', 2 ) : true;
57 - } ,
58 - );
59 -
60 - $fields['year'] = array (
61 - 'type' => 'int',
62 - 'label-message' => 'ep-course-edit-year',
63 - 'required' => true,
64 - 'min' => 2000,
65 - 'max' => 9001,
66 - 'size' => 15,
67 - );
68 -
69 - $fields['start'] = array (
70 - 'class' => 'EPHTMLDateField',
71 - 'label-message' => 'ep-course-edit-start',
72 - 'required' => true,
73 - );
74 -
75 - $fields['end'] = array (
76 - 'class' => 'EPHTMLDateField',
77 - 'label-message' => 'ep-course-edit-end',
78 - 'required' => true,
79 - );
80 -
81 - $fields['description'] = array (
82 - 'type' => 'textarea',
83 - 'label-message' => 'ep-course-edit-description',
84 - 'required' => true,
85 - 'validation-callback' => function ( $value, array $alldata = null ) {
86 - return strlen( $value ) < 10 ? wfMsgExt( 'ep-course-invalid-description', 'parsemag', 10 ) : true;
87 - } ,
88 - 'rows' => 10,
89 - 'id' => 'wpTextbox1',
90 - );
91 -
92 - return $this->processFormFields( $fields );
93 - }
94 -
95 - /**
96 - * (non-PHPdoc)
97 - * @see SpecialEPFormPage::getTitleConditions()
98 - */
99 - protected function getTitleConditions() {
100 - return array( 'id' => $this->subPage );
101 - }
102 -
103 - /**
104 - * (non-PHPdoc)
105 - * @see SpecialEPFormPage::getNewData()
106 - */
107 - protected function getNewData() {
108 - return array(
109 - 'mc_id' => $this->getRequest()->getVal( 'newmc' ),
110 - 'year' => $this->getRequest()->getVal( 'newyear' ),
111 - );
112 - }
113 -
114 - /**
115 - * (non-PHPdoc)
116 - * @see SpecialEPFormPage::handleKnownField()
117 - */
118 - protected function handleKnownField( $name, $value ) {
119 - if ( in_array( $name, array( 'end', 'start' ) ) ) {
120 - $value = wfTimestamp( TS_MW, strtotime( $value ) );
121 - }
122 -
123 - return $value;
124 - }
125 -
126 -}
127 -
128 -class EPHTMLDateField extends HTMLTextField {
129 -
130 - public function __construct( $params ) {
131 - parent::__construct( $params );
132 -
133 - $this->mClass .= " ep-datepicker-tr";
134 - }
135 -
136 - function getSize() {
137 - return isset( $this->mParams['size'] )
138 - ? $this->mParams['size']
139 - : 20;
140 - }
141 -
142 - function getInputHTML( $value ) {
143 - $value = explode( 'T', wfTimestamp( TS_ISO_8601, strtotime( $value ) ) );
144 - return parent::getInputHTML( $value[0] );
145 - }
146 -
147 - function validate( $value, $alldata ) {
148 - $p = parent::validate( $value, $alldata );
149 -
150 - if ( $p !== true ) {
151 - return $p;
152 - }
153 -
154 - $value = trim( $value );
155 -
156 - // TODO: further validation
157 -
158 - return true;
159 - }
160 -}
Index: trunk/extensions/EducationProgram/specials/SpecialEditCourse.php
@@ -0,0 +1,125 @@
 2+<?php
 3+
 4+/**
 5+ * Addition and modification interface for courses.
 6+ *
 7+ * @since 0.1
 8+ *
 9+ * @file SpecialEditCourse.php
 10+ * @ingroup EducationProgram
 11+ *
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 14+ */
 15+class SpecialEditCourse extends SpecialEPFormPage {
 16+
 17+ /**
 18+ * Constructor.
 19+ *
 20+ * @since 0.1
 21+ */
 22+ public function __construct() {
 23+ parent::__construct( 'EditCourse', 'ep-course', 'EPCourse', 'Courses' );
 24+
 25+ $this->getOutput()->addModules( 'ep.datepicker' );
 26+ }
 27+
 28+ /**
 29+ * (non-PHPdoc)
 30+ * @see SpecialEPFormPage::getFormFields()
 31+ * @return array
 32+ */
 33+ protected function getFormFields() {
 34+ $fields = parent::getFormFields();
 35+
 36+ $courseOptions = EPMC::getMasterCourseOptions();
 37+
 38+ $fields['mc_id'] = array (
 39+ 'type' => 'select',
 40+ 'label-message' => 'ep-course-edit-mastercourse',
 41+ 'required' => true,
 42+ 'options' => $courseOptions,
 43+ 'validation-callback' => function ( $value, array $alldata = null ) use ( $courseOptions ) {
 44+ return in_array( (int)$value, array_values( $courseOptions ) ) ? true : wfMsg( 'ep-course-invalid-course' );
 45+ },
 46+ );
 47+
 48+ $fields['token'] = array (
 49+ 'type' => 'text',
 50+ 'label-message' => 'ep-course-edit-token',
 51+ 'maxlength' => 255,
 52+ 'required' => true,
 53+ 'size' => 20,
 54+ 'validation-callback' => function ( $value, array $alldata = null ) {
 55+ $strLen = strlen( $value );
 56+ return ( $strLen !== 0 && $strLen < 2 ) ? wfMsgExt( 'ep-course-invalid-token', 'parsemag', 2 ) : true;
 57+ } ,
 58+ );
 59+
 60+ $fields['year'] = array (
 61+ 'type' => 'int',
 62+ 'label-message' => 'ep-course-edit-year',
 63+ 'required' => true,
 64+ 'min' => 2000,
 65+ 'max' => 9001,
 66+ 'size' => 15,
 67+ );
 68+
 69+ $fields['start'] = array (
 70+ 'class' => 'EPHTMLDateField',
 71+ 'label-message' => 'ep-course-edit-start',
 72+ 'required' => true,
 73+ );
 74+
 75+ $fields['end'] = array (
 76+ 'class' => 'EPHTMLDateField',
 77+ 'label-message' => 'ep-course-edit-end',
 78+ 'required' => true,
 79+ );
 80+
 81+ $fields['description'] = array (
 82+ 'type' => 'textarea',
 83+ 'label-message' => 'ep-course-edit-description',
 84+ 'required' => true,
 85+ 'validation-callback' => function ( $value, array $alldata = null ) {
 86+ return strlen( $value ) < 10 ? wfMsgExt( 'ep-course-invalid-description', 'parsemag', 10 ) : true;
 87+ } ,
 88+ 'rows' => 10,
 89+ 'id' => 'wpTextbox1',
 90+ );
 91+
 92+ return $this->processFormFields( $fields );
 93+ }
 94+
 95+ /**
 96+ * (non-PHPdoc)
 97+ * @see SpecialEPFormPage::getTitleConditions()
 98+ */
 99+ protected function getTitleConditions() {
 100+ return array( 'id' => $this->subPage );
 101+ }
 102+
 103+ /**
 104+ * (non-PHPdoc)
 105+ * @see SpecialEPFormPage::getNewData()
 106+ */
 107+ protected function getNewData() {
 108+ return array(
 109+ 'mc_id' => $this->getRequest()->getVal( 'newmc' ),
 110+ 'year' => $this->getRequest()->getVal( 'newyear' ),
 111+ );
 112+ }
 113+
 114+ /**
 115+ * (non-PHPdoc)
 116+ * @see SpecialEPFormPage::handleKnownField()
 117+ */
 118+ protected function handleKnownField( $name, $value ) {
 119+ if ( in_array( $name, array( 'end', 'start' ) ) ) {
 120+ $value = wfTimestamp( TS_MW, strtotime( $value ) );
 121+ }
 122+
 123+ return $value;
 124+ }
 125+
 126+}
Property changes on: trunk/extensions/EducationProgram/specials/SpecialEditCourse.php
___________________________________________________________________
Added: svn:eol-style
1127 + native
Index: trunk/extensions/EducationProgram/specials/SpecialMasterCourse.php
@@ -41,14 +41,14 @@
4242 else {
4343 $out->setPageTitle( wfMsgExt( 'ep-mc-title', 'parsemag', $this->subPage ) );
4444
45 - $masterCourse = EPCourse::selectRow( null, array( 'name' => $this->subPage ) );
 45+ $masterCourse = EPMC::selectRow( null, array( 'name' => $this->subPage ) );
4646
4747 if ( $masterCourse === false ) {
4848 $this->displayNavigation();
4949
5050 if ( $this->getUser()->isAllowed( 'ep-mc' ) ) {
5151 $out->addWikiMsg( 'ep-mc-create', $this->subPage );
52 - EPCourse::displayAddNewRegion( $this->getContext(), array( 'name' => $this->subPage ) );
 52+ EPMC::displayAddNewRegion( $this->getContext(), array( 'name' => $this->subPage ) );
5353 }
5454 else {
5555 $out->addWikiMsg( 'ep-mc-none', $this->subPage );
@@ -73,12 +73,12 @@
7474
7575 $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-mc-courses' ) ) );
7676
77 - EPCourse::displayPager( $this->getContext(), array( 'mc_id' => $masterCourse->getId() ) );
 77+ EPMC::displayPager( $this->getContext(), array( 'id' => $masterCourse->getId() ) );
7878
7979 if ( $this->getUser()->isAllowed( 'ep-mc' ) ) {
8080 $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-mc-add-term' ) ) );
8181
82 - EPCourse::displayAddNewControl( $this->getContext(), array( 'mc' => $masterCourse->getId() ) );
 82+ EPMC::displayAddNewControl( $this->getContext(), array( 'mc' => $masterCourse->getId() ) );
8383 }
8484 }
8585 }
Index: trunk/extensions/EducationProgram/includes/EPHTMLDateField.php
@@ -0,0 +1,47 @@
 2+<?php
 3+
 4+/**
 5+ * HTMLForm date field input.
 6+ *
 7+ * @since 0.1
 8+ *
 9+ * @file EPHTMLDateField.php
 10+ * @ingroup EducationProgram
 11+ *
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 14+ */
 15+class EPHTMLDateField extends HTMLTextField {
 16+
 17+ public function __construct( $params ) {
 18+ parent::__construct( $params );
 19+
 20+ $this->mClass .= " ep-datepicker-tr";
 21+ }
 22+
 23+ function getSize() {
 24+ return isset( $this->mParams['size'] )
 25+ ? $this->mParams['size']
 26+ : 20;
 27+ }
 28+
 29+ function getInputHTML( $value ) {
 30+ $value = explode( 'T', wfTimestamp( TS_ISO_8601, strtotime( $value ) ) );
 31+ return parent::getInputHTML( $value[0] );
 32+ }
 33+
 34+ function validate( $value, $alldata ) {
 35+ $p = parent::validate( $value, $alldata );
 36+
 37+ if ( $p !== true ) {
 38+ return $p;
 39+ }
 40+
 41+ $value = trim( $value );
 42+
 43+ // TODO: further validation
 44+
 45+ return true;
 46+ }
 47+
 48+}
Index: trunk/extensions/EducationProgram/includes/EPMCPager.php
@@ -60,7 +60,7 @@
6161 switch ( $name ) {
6262 case 'name':
6363 $value = Linker::linkKnown(
64 - SpecialPage::getTitleFor( 'Course', $value ),
 64+ SpecialPage::getTitleFor( 'MasterCourse', $value ),
6565 htmlspecialchars( $value )
6666 );
6767 break;
@@ -76,7 +76,7 @@
7777 $value = htmlspecialchars( $this->getLanguage()->formatNum( $value ) );
7878 break;
7979 case 'active':
80 - $value = wfMsgHtml( 'epcoursepager-' . ( $value == '1' ? 'yes' : 'no' ) );
 80+ $value = wfMsgHtml( 'epmcpager-' . ( $value == '1' ? 'yes' : 'no' ) );
8181 break;
8282 }
8383
@@ -135,13 +135,13 @@
136136 $links = parent::getControlLinks( $item );
137137
138138 $links[] = $value = Linker::linkKnown(
139 - SpecialPage::getTitleFor( 'Course', $item->getField( 'name' ) ),
 139+ SpecialPage::getTitleFor( 'MasterCourse', $item->getField( 'name' ) ),
140140 wfMsgHtml( 'view' )
141141 );
142142
143 - if ( $this->getUser()->isAllowed( 'ep-course' ) ) {
 143+ if ( $this->getUser()->isAllowed( 'ep-mc' ) ) {
144144 $links[] = $value = Linker::linkKnown(
145 - SpecialPage::getTitleFor( 'EditCourse', $item->getField( 'name' ) ),
 145+ SpecialPage::getTitleFor( 'EditMasterCourse', $item->getField( 'name' ) ),
146146 wfMsgHtml( 'edit' )
147147 );
148148
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -143,8 +143,8 @@
144144 'special-editinstitution-edit' => 'Edit institution',
145145 'special-mastercourses' => 'Master courses',
146146 'special-mastercourse' => 'Master course',
147 - 'special-editmc-add' => 'Add master course',
148 - 'special-editmc-edit' => 'Edit master course',
 147+ 'special-editmastercourse-add' => 'Add master course',
 148+ 'special-editmastercourse-edit' => 'Edit master course',
149149 'special-editcourse-add' => 'Add course',
150150 'special-editcourse-edit' => 'Edit course',
151151 'special-enroll' => 'Enroll',
@@ -305,25 +305,25 @@
306306 'ep-institution-inactive' => 'Inactive',
307307 'ep-institution-active' => 'Active',
308308
309 - // Special:Course
310 - 'ep-course-title' => 'Course: $1',
311 - 'ep-course-terms' => 'Terms',
312 - 'ep-course-none' => 'There is no course with name "$1". See [[Special:Courses|here]] for a list of courses.',
313 - 'ep-course-create' => 'There is no course with name "$1" yet, but you can create it.',
314 - 'specialcourse-summary-name' => 'Name',
315 - 'specialcourse-summary-org' => 'Institution',
316 - 'specialcourse-summary-students' => 'Student count',
317 - 'specialcourse-summary-status' => 'Status',
318 - 'ep-course-description' => 'Description',
319 - 'ep-course-nav-edit' => 'Edit this course',
320 - 'ep-course-add-term' => 'Add a term',
321 - 'ep-course-inactive' => 'Inactive',
322 - 'ep-course-active' => 'Active',
323 - 'specialcourse-summary-terms' => 'Term count',
324 - 'specialcourse-summary-instructors' => 'Instructors',
325 - 'ep-course-no-instructors' => 'There are no instructors for this course.',
326 - 'ep-course-become-instructor' => 'Become instructor',
327 - 'ep-course-add-instructor' => 'Add an instructor',
 309+ // Special:MasterCourse
 310+ 'ep-mc-title' => 'Master course: $1',
 311+ 'ep-mc-courses' => 'Courses',
 312+ 'ep-mc-none' => 'There is no master course with name "$1". See [[Special:MasterCourses|here]] for a list of master courses.',
 313+ 'ep-mc-create' => 'There is no master course with name "$1" yet, but you can create it.',
 314+ 'specialmastercourse-summary-name' => 'Name',
 315+ 'specialmastercourse-summary-org' => 'Institution',
 316+ 'specialmastercourse-summary-students' => 'Student count',
 317+ 'specialmastercourse-summary-status' => 'Status',
 318+ 'ep-mc-description' => 'Description',
 319+ 'ep-mc-nav-edit' => 'Edit this master course',
 320+ 'ep-mc-add-course' => 'Add a course',
 321+ 'ep-mc-inactive' => 'Inactive',
 322+ 'ep-mc-active' => 'Active',
 323+ 'specialmastercourse-summary-courses' => 'Course count',
 324+ 'specialmastercourse-summary-instructors' => 'Instructors',
 325+ 'ep-mc-no-instructors' => 'There are no instructors for this master course.',
 326+ 'ep-mc-become-instructor' => 'Become instructor',
 327+ 'ep-mc-add-instructor' => 'Add an instructor',
328328
329329 // Special:Course
330330 'ep-course-title' => 'Course: $1',
Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -5,7 +5,7 @@
66 *
77 * Documentation: https://www.mediawiki.org/wiki/Extension:Education_Program
88 * Support https://www.mediawiki.org/wiki/Extension_talk:Education_Program
9 - * Source code: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/EducationProgram
 9+ * Source code: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/EducationProgram
1010 *
1111 * The source code makes use of a number of terms different from but corresponding to those in the UI:
1212 * * Org instead of Institution
@@ -65,8 +65,8 @@
6666
6767 $wgAutoloadClasses['EPCourse'] = dirname( __FILE__ ) . '/includes/EPCourse.php';
6868 $wgAutoloadClasses['EPCoursePager'] = dirname( __FILE__ ) . '/includes/EPCoursePager.php';
69 -$wgAutoloadClasses['EPMC'] = dirname( __FILE__ ) . '/includes/EPMC.php';
70 -$wgAutoloadClasses['EPMCPager'] = dirname( __FILE__ ) . '/includes/EPMCPager.php';
 69+$wgAutoloadClasses['EPMC'] = dirname( __FILE__ ) . '/includes/EPMC.php';
 70+$wgAutoloadClasses['EPMCPager'] = dirname( __FILE__ ) . '/includes/EPMCPager.php';
7171 $wgAutoloadClasses['EPDBObject'] = dirname( __FILE__ ) . '/includes/EPDBObject.php';
7272 $wgAutoloadClasses['EPInstructor'] = dirname( __FILE__ ) . '/includes/EPInstructor.php';
7373 $wgAutoloadClasses['EPLogFormatter'] = dirname( __FILE__ ) . '/includes/EPLogFormatter.php';
@@ -76,10 +76,11 @@
7777 $wgAutoloadClasses['EPStudent'] = dirname( __FILE__ ) . '/includes/EPStudent.php';
7878 $wgAutoloadClasses['EPStudentPager'] = dirname( __FILE__ ) . '/includes/EPStudentPager.php';
7979 $wgAutoloadClasses['EPUtils'] = dirname( __FILE__ ) . '/includes/EPUtils.php';
80 -$wgAutoloadClasses['EPOA'] = dirname( __FILE__ ) . '/includes/EPOA.php';
81 -$wgAutoloadClasses['EPOAPager'] = dirname( __FILE__ ) . '/includes/EPOAPager.php';
82 -$wgAutoloadClasses['EPCA'] = dirname( __FILE__ ) . '/includes/EPCA.php';
83 -$wgAutoloadClasses['EPCAPager'] = dirname( __FILE__ ) . '/includes/EPCAPager.php';
 80+$wgAutoloadClasses['EPOA'] = dirname( __FILE__ ) . '/includes/EPOA.php';
 81+$wgAutoloadClasses['EPOAPager'] = dirname( __FILE__ ) . '/includes/EPOAPager.php';
 82+$wgAutoloadClasses['EPCA'] = dirname( __FILE__ ) . '/includes/EPCA.php';
 83+$wgAutoloadClasses['EPCAPager'] = dirname( __FILE__ ) . '/includes/EPCAPager.php';
 84+$wgAutoloadClasses['EPHTMLDateField'] = dirname( __FILE__ ) . '/includes/EPHTMLDateField.php';
8485
8586 $wgAutoloadClasses['SpecialCourse'] = dirname( __FILE__ ) . '/specials/SpecialCourse.php';
8687 $wgAutoloadClasses['SpecialCourses'] = dirname( __FILE__ ) . '/specials/SpecialCourses.php';
@@ -97,10 +98,10 @@
9899 $wgAutoloadClasses['SpecialMasterCourse'] = dirname( __FILE__ ) . '/specials/SpecialMasterCourse.php';
99100 $wgAutoloadClasses['SpecialMasterCourses'] = dirname( __FILE__ ) . '/specials/SpecialMasterCourses.php';
100101 $wgAutoloadClasses['SpecialEnroll'] = dirname( __FILE__ ) . '/specials/SpecialEnroll.php';
101 -$wgAutoloadClasses['SpecialCAs'] = dirname( __FILE__ ) . '/specials/SpecialCAs.php';
102 -$wgAutoloadClasses['SpecialOAs'] = dirname( __FILE__ ) . '/specials/SpecialOAs.php';
103 -$wgAutoloadClasses['SpecialCA'] = dirname( __FILE__ ) . '/specials/SpecialCA.php';
104 -$wgAutoloadClasses['SpecialOA'] = dirname( __FILE__ ) . '/specials/SpecialOA.php';
 102+$wgAutoloadClasses['SpecialCAs'] = dirname( __FILE__ ) . '/specials/SpecialCAs.php';
 103+$wgAutoloadClasses['SpecialOAs'] = dirname( __FILE__ ) . '/specials/SpecialOAs.php';
 104+$wgAutoloadClasses['SpecialCA'] = dirname( __FILE__ ) . '/specials/SpecialCA.php';
 105+$wgAutoloadClasses['SpecialOA'] = dirname( __FILE__ ) . '/specials/SpecialOA.php';
105106
106107 // Special pages
107108 $wgSpecialPages['MyCourses'] = 'SpecialMyCourses';
@@ -115,12 +116,12 @@
116117 $wgSpecialPages['EducationProgram'] = 'SpecialEducationProgram';
117118 $wgSpecialPages['EditCourse'] = 'SpecialEditCourse';
118119 $wgSpecialPages['EditInstitution'] = 'SpecialEditInstitution';
119 -$wgSpecialPages['EditMasterCourse'] = 'SpecialEditMasterCourse';
120 -$wgSpecialPages['Enroll'] = 'SpecialEnroll';
121 -$wgSpecialPages['CampusAmbassadors'] = 'SpecialCAs';
122 -$wgSpecialPages['OnlineAmbassadors'] = 'SpecialOAs';
123 -$wgSpecialPages['CampusAmbassador'] = 'SpecialCA';
124 -$wgSpecialPages['OnlineAmbassador'] = 'SpecialOA';
 120+$wgSpecialPages['EditMasterCourse'] = 'SpecialEditMasterCourse';
 121+$wgSpecialPages['Enroll'] = 'SpecialEnroll';
 122+$wgSpecialPages['CampusAmbassadors'] = 'SpecialCAs';
 123+$wgSpecialPages['OnlineAmbassadors'] = 'SpecialOAs';
 124+$wgSpecialPages['CampusAmbassador'] = 'SpecialCA';
 125+$wgSpecialPages['OnlineAmbassador'] = 'SpecialOA';
125126
126127 $wgSpecialPageGroups['MyCourses'] = 'education';
127128 $wgSpecialPageGroups['Institution'] = 'education';
@@ -151,15 +152,15 @@
152153 $egEPDBObjects[] = array( 'table' => 'ep_students_per_course', 'prefix' => 'spc_' );
153154
154155 // API
155 -$wgAPIModules['deleteeducation'] = 'ApiDeleteEducation';
156 -$wgAPIModules['instructor'] = 'ApiInstructor';
157 -$wgAPIModules['refresheducation'] = 'ApiRefreshEducation';
 156+$wgAPIModules['deleteeducation'] = 'ApiDeleteEducation';
 157+$wgAPIModules['instructor'] = 'ApiInstructor';
 158+$wgAPIModules['refresheducation'] = 'ApiRefreshEducation';
158159
159160 // Hooks
160 -$wgHooks['LoadExtensionSchemaUpdates'][] = 'EPHooks::onSchemaUpdate';
161 -$wgHooks['UnitTestsList'][] = 'EPHooks::registerUnitTests';
162 -$wgHooks['PersonalUrls'][] = 'EPHooks::onPersonalUrls';
163 -$wgHooks['GetPreferences'][] = 'EPHooks::onGetPreferences';
 161+$wgHooks['LoadExtensionSchemaUpdates'][] = 'EPHooks::onSchemaUpdate';
 162+$wgHooks['UnitTestsList'][] = 'EPHooks::registerUnitTests';
 163+$wgHooks['PersonalUrls'][] = 'EPHooks::onPersonalUrls';
 164+$wgHooks['GetPreferences'][] = 'EPHooks::onGetPreferences';
164165 $wgHooks['SkinTemplateNavigation::SpecialPage'][] = 'EPHooks::onSpecialPageTabs';
165166
166167 // Logging
@@ -215,7 +216,7 @@
216217 // Rights
217218 $wgAvailableRights[] = 'ep-org'; // Manage orgs
218219 $wgAvailableRights[] = 'ep-course'; // Manage courses
219 -$wgAvailableRights[] = 'ep-mc'; // Manage master courses
 220+$wgAvailableRights[] = 'ep-mc'; // Manage master courses
220221 $wgAvailableRights[] = 'ep-token'; // See enrollment tokens
221222 $wgAvailableRights[] = 'ep-enroll'; // Enroll as a student
222223 $wgAvailableRights[] = 'ep-remstudent'; // Disassociate students from terms

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