Index: trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | 'EducationProgram' => array( 'EducationProgram' ), |
30 | 30 | 'EditCourse' => array( 'EditCourse' ), |
31 | 31 | 'EditInstitution' => array( 'EditInstitution' ), |
32 | | - 'EditMC' => array( 'EditMC' ), |
| 32 | + 'EditMasterCourse' => array( 'EditMasterCourse' ), |
33 | 33 | 'Enroll' => array( 'Enroll' ), |
34 | 34 | 'CampusAmbassadors' => array( 'CampusAmbassadors' ), |
35 | 35 | 'OnlineAmbassadors' => array( 'OnlineAmbassadors' ), |
Index: trunk/extensions/EducationProgram/specials/SpecialEditCourse.php |
— | — | @@ -1,80 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -/** |
5 | | - * Addition and modification interface for master courses. |
6 | | - * |
7 | | - * @since 0.1 |
8 | | - * |
9 | | - * @file SpecialEditMasterCourse.php |
10 | | - * @ingroup EducationProgram |
11 | | - * |
12 | | - * @licence GNU GPL v3 or later |
13 | | - * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
14 | | - */ |
15 | | -class SpecialEditMasterCourse extends SpecialEPFormPage { |
16 | | - |
17 | | - /** |
18 | | - * Constructor. |
19 | | - * |
20 | | - * @since 0.1 |
21 | | - */ |
22 | | - public function __construct() { |
23 | | - parent::__construct( 'EditMasterCourse', 'ep-mc', 'EPMC', 'MasterCourses' ); |
24 | | - } |
25 | | - |
26 | | - /** |
27 | | - * (non-PHPdoc) |
28 | | - * @see SpecialEPFormPage::getFormFields() |
29 | | - * @return array |
30 | | - */ |
31 | | - protected function getFormFields() { |
32 | | - $fields = parent::getFormFields(); |
33 | | - |
34 | | - $fields['name'] = array ( |
35 | | - 'type' => 'text', |
36 | | - 'label-message' => 'ep-mc-edit-name', |
37 | | - 'maxlength' => 255, |
38 | | - 'required' => true, |
39 | | - 'validation-callback' => function ( $value, array $alldata = null ) { |
40 | | - return strlen( $value ) < 5 ? wfMsgExt( 'ep-mc-invalid-name', 'parsemag', 5 ) : true; |
41 | | - } , |
42 | | - ); |
43 | | - |
44 | | - $orgOptions = EPOrg::getOrgOptions(); |
45 | | - |
46 | | - $fields['org_id'] = array ( |
47 | | - 'type' => 'select', |
48 | | - 'label-message' => 'ep-mc-edit-org', |
49 | | - 'required' => true, |
50 | | - 'options' => $orgOptions, |
51 | | - 'validation-callback' => function ( $value, array $alldata = null ) use ( $orgOptions ) { |
52 | | - return in_array( (int)$value, array_values( $orgOptions ) ) ? true : wfMsg( 'ep-mc-invalid-org' ); |
53 | | - } , |
54 | | - ); |
55 | | - |
56 | | - $fields['description'] = array ( |
57 | | - 'type' => 'textarea', |
58 | | - 'label-message' => 'ep-mc-edit-description', |
59 | | - 'required' => true, |
60 | | - 'validation-callback' => function ( $value, array $alldata = null ) { |
61 | | - return strlen( $value ) < 10 ? wfMsgExt( 'ep-mc-invalid-description', 'parsemag', 10 ) : true; |
62 | | - } , |
63 | | - 'rows' => 10, |
64 | | - 'id' => 'wpTextbox1', |
65 | | - ); |
66 | | - |
67 | | - return $this->processFormFields( $fields ); |
68 | | - } |
69 | | - |
70 | | - /** |
71 | | - * (non-PHPdoc) |
72 | | - * @see SpecialEPFormPage::getNewData() |
73 | | - */ |
74 | | - protected function getNewData() { |
75 | | - return array( |
76 | | - 'org_id' => $this->getRequest()->getVal( 'neworg' ), |
77 | | - 'name' => $this->getRequest()->getVal( 'newname' ), |
78 | | - ); |
79 | | - } |
80 | | - |
81 | | -} |
Index: trunk/extensions/EducationProgram/specials/SpecialEditMasterCourse.php |
— | — | @@ -0,0 +1,80 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Addition and modification interface for master courses. |
| 6 | + * |
| 7 | + * @since 0.1 |
| 8 | + * |
| 9 | + * @file SpecialEditMasterCourse.php |
| 10 | + * @ingroup EducationProgram |
| 11 | + * |
| 12 | + * @licence GNU GPL v3 or later |
| 13 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
| 14 | + */ |
| 15 | +class SpecialEditMasterCourse extends SpecialEPFormPage { |
| 16 | + |
| 17 | + /** |
| 18 | + * Constructor. |
| 19 | + * |
| 20 | + * @since 0.1 |
| 21 | + */ |
| 22 | + public function __construct() { |
| 23 | + parent::__construct( 'EditMasterCourse', 'ep-mc', 'EPMC', 'MasterCourses' ); |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * (non-PHPdoc) |
| 28 | + * @see SpecialEPFormPage::getFormFields() |
| 29 | + * @return array |
| 30 | + */ |
| 31 | + protected function getFormFields() { |
| 32 | + $fields = parent::getFormFields(); |
| 33 | + |
| 34 | + $fields['name'] = array ( |
| 35 | + 'type' => 'text', |
| 36 | + 'label-message' => 'ep-mc-edit-name', |
| 37 | + 'maxlength' => 255, |
| 38 | + 'required' => true, |
| 39 | + 'validation-callback' => function ( $value, array $alldata = null ) { |
| 40 | + return strlen( $value ) < 5 ? wfMsgExt( 'ep-mc-invalid-name', 'parsemag', 5 ) : true; |
| 41 | + } , |
| 42 | + ); |
| 43 | + |
| 44 | + $orgOptions = EPOrg::getOrgOptions(); |
| 45 | + |
| 46 | + $fields['org_id'] = array ( |
| 47 | + 'type' => 'select', |
| 48 | + 'label-message' => 'ep-mc-edit-org', |
| 49 | + 'required' => true, |
| 50 | + 'options' => $orgOptions, |
| 51 | + 'validation-callback' => function ( $value, array $alldata = null ) use ( $orgOptions ) { |
| 52 | + return in_array( (int)$value, array_values( $orgOptions ) ) ? true : wfMsg( 'ep-mc-invalid-org' ); |
| 53 | + } , |
| 54 | + ); |
| 55 | + |
| 56 | + $fields['description'] = array ( |
| 57 | + 'type' => 'textarea', |
| 58 | + 'label-message' => 'ep-mc-edit-description', |
| 59 | + 'required' => true, |
| 60 | + 'validation-callback' => function ( $value, array $alldata = null ) { |
| 61 | + return strlen( $value ) < 10 ? wfMsgExt( 'ep-mc-invalid-description', 'parsemag', 10 ) : true; |
| 62 | + } , |
| 63 | + 'rows' => 10, |
| 64 | + 'id' => 'wpTextbox1', |
| 65 | + ); |
| 66 | + |
| 67 | + return $this->processFormFields( $fields ); |
| 68 | + } |
| 69 | + |
| 70 | + /** |
| 71 | + * (non-PHPdoc) |
| 72 | + * @see SpecialEPFormPage::getNewData() |
| 73 | + */ |
| 74 | + protected function getNewData() { |
| 75 | + return array( |
| 76 | + 'org_id' => $this->getRequest()->getVal( 'neworg' ), |
| 77 | + 'name' => $this->getRequest()->getVal( 'newname' ), |
| 78 | + ); |
| 79 | + } |
| 80 | + |
| 81 | +} |
Property changes on: trunk/extensions/EducationProgram/specials/SpecialEditMasterCourse.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 82 | + native |
Index: trunk/extensions/EducationProgram/includes/EPMC.php |
— | — | @@ -222,7 +222,7 @@ |
223 | 223 | * @return boolean |
224 | 224 | */ |
225 | 225 | public static function displayAddNewControl( IContextSource $context, array $args = array() ) { |
226 | | - if ( !$context->getUser()->isAllowed( 'ep-course' ) ) { |
| 226 | + if ( !$context->getUser()->isAllowed( 'ep-mc' ) ) { |
227 | 227 | return false; |
228 | 228 | } |
229 | 229 | |
— | — | @@ -232,17 +232,17 @@ |
233 | 233 | 'form', |
234 | 234 | array( |
235 | 235 | 'method' => 'post', |
236 | | - 'action' => SpecialPage::getTitleFor( 'EditCourse' )->getLocalURL(), |
| 236 | + 'action' => SpecialPage::getTitleFor( 'EditMasterCourse' )->getLocalURL(), |
237 | 237 | ) |
238 | 238 | ) ); |
239 | 239 | |
240 | 240 | $out->addHTML( '<fieldset>' ); |
241 | 241 | |
242 | | - $out->addHTML( '<legend>' . wfMsgHtml( 'ep-courses-addnew' ) . '</legend>' ); |
| 242 | + $out->addHTML( '<legend>' . wfMsgHtml( 'ep-mcs-addnew' ) . '</legend>' ); |
243 | 243 | |
244 | | - $out->addHTML( Html::element( 'p', array(), wfMsg( 'ep-courses-namedoc' ) ) ); |
| 244 | + $out->addHTML( Html::element( 'p', array(), wfMsg( 'ep-mcs-namedoc' ) ) ); |
245 | 245 | |
246 | | - $out->addHTML( Html::element( 'label', array( 'for' => 'neworg' ), wfMsg( 'ep-courses-neworg' ) ) ); |
| 246 | + $out->addHTML( Html::element( 'label', array( 'for' => 'neworg' ), wfMsg( 'ep-mcs-neworg' ) ) ); |
247 | 247 | |
248 | 248 | $out->addHTML( ' ' ); |
249 | 249 | |
— | — | @@ -258,7 +258,7 @@ |
259 | 259 | $out->addHTML( ' ' ); |
260 | 260 | |
261 | 261 | $out->addHTML( Xml::inputLabel( |
262 | | - wfMsg( 'ep-courses-newname' ), |
| 262 | + wfMsg( 'ep-mcs-newname' ), |
263 | 263 | 'newname', |
264 | 264 | 'newname', |
265 | 265 | false, |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | * @param array $conditions |
309 | 309 | */ |
310 | 310 | public static function displayPager( IContextSource $context, array $conditions = array() ) { |
311 | | - $pager = new EPCoursePager( $context, $conditions ); |
| 311 | + $pager = new EPMCPager( $context, $conditions ); |
312 | 312 | |
313 | 313 | if ( $pager->getNumRows() ) { |
314 | 314 | $context->getOutput()->addHTML( |
— | — | @@ -320,7 +320,7 @@ |
321 | 321 | } |
322 | 322 | else { |
323 | 323 | $context->getOutput()->addHTML( $pager->getFilterControl( true ) ); |
324 | | - $context->getOutput()->addWikiMsg( 'ep-mc-noresults' ); |
| 324 | + $context->getOutput()->addWikiMsg( 'ep-mcs-noresults' ); |
325 | 325 | } |
326 | 326 | } |
327 | 327 | |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -166,16 +166,16 @@ |
167 | 167 | 'ep-institutions-newname' => 'Institution name:', |
168 | 168 | 'ep-institutions-add' => 'Add institution', |
169 | 169 | |
170 | | - // Special:Courses |
171 | | - 'ep-courses-nosuchcourse' => 'There is no course with name "$1". Existing courses are listed below.', |
172 | | - 'ep-courses-noresults' => 'There are no courses to list.', |
173 | | - 'ep-courses-addnew' => 'Add a new course', |
174 | | - 'ep-courses-namedoc' => 'Enter the name for the new course (which should be unique) and hit the button.', |
175 | | - 'ep-courses-newname' => 'Course name:', |
176 | | - 'ep-courses-add' => 'Add course', |
177 | | - 'ep-courses-addorgfirst' => 'You need to [[Special:Institutions|add an institution]] before you can create any courses.', |
178 | | - 'ep-courses-noorgs' => 'You are not a mentor of any institutions yet, so cannot add any courses.', |
179 | | - 'ep-courses-neworg' => 'Institution', |
| 170 | + // Special:MasterCourses |
| 171 | + 'ep-mcs-nosuchcourse' => 'There is no master course with name "$1". Existing master courses are listed below.', |
| 172 | + 'ep-mcs-noresults' => 'There are no master courses to list.', |
| 173 | + 'ep-mcs-addnew' => 'Add a new master course', |
| 174 | + 'ep-mcs-namedoc' => 'Enter the name for the new course (which should be unique) and hit the button.', |
| 175 | + 'ep-mcs-newname' => 'Master course name:', |
| 176 | + 'ep-mcs-add' => 'Add master course', |
| 177 | + 'ep-mcs-addorgfirst' => 'You need to [[Special:Institutions|add an institution]] before you can create any master courses.', |
| 178 | + 'ep-mcs-noorgs' => 'You are not a mentor of any institutions yet, so cannot add any master courses.', |
| 179 | + 'ep-mcs-neworg' => 'Institution', |
180 | 180 | |
181 | 181 | // Special:Courses |
182 | 182 | 'ep-courses-nosuchcourse' => 'There is no course with id "$1". Existing courses are listed below.', |
Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | $wgAutoloadClasses['SpecialCourses'] = dirname( __FILE__ ) . '/specials/SpecialCourses.php'; |
87 | 87 | $wgAutoloadClasses['SpecialEditCourse'] = dirname( __FILE__ ) . '/specials/SpecialEditCourse.php'; |
88 | 88 | $wgAutoloadClasses['SpecialEditInstitution'] = dirname( __FILE__ ) . '/specials/SpecialEditInstitution.php'; |
89 | | -$wgAutoloadClasses['SpecialEditMC'] = dirname( __FILE__ ) . '/specials/SpecialEditMC.php'; |
| 89 | +$wgAutoloadClasses['SpecialEditMasterCourse'] = dirname( __FILE__ ) . '/specials/SpecialEditMasterCourse.php'; |
90 | 90 | $wgAutoloadClasses['SpecialEducationProgram'] = dirname( __FILE__ ) . '/specials/SpecialEducationProgram.php'; |
91 | 91 | $wgAutoloadClasses['SpecialEPFormPage'] = dirname( __FILE__ ) . '/specials/SpecialEPFormPage.php'; |
92 | 92 | $wgAutoloadClasses['SpecialEPPage'] = dirname( __FILE__ ) . '/specials/SpecialEPPage.php'; |
— | — | @@ -94,8 +94,8 @@ |
95 | 95 | $wgAutoloadClasses['SpecialMyCourses'] = dirname( __FILE__ ) . '/specials/SpecialMyCourses.php'; |
96 | 96 | $wgAutoloadClasses['SpecialStudent'] = dirname( __FILE__ ) . '/specials/SpecialStudent.php'; |
97 | 97 | $wgAutoloadClasses['SpecialStudents'] = dirname( __FILE__ ) . '/specials/SpecialStudents.php'; |
98 | | -$wgAutoloadClasses['SpecialMC'] = dirname( __FILE__ ) . '/specials/SpecialMC.php'; |
99 | | -$wgAutoloadClasses['SpecialMCs'] = dirname( __FILE__ ) . '/specials/SpecialMCs.php'; |
| 98 | +$wgAutoloadClasses['SpecialMasterCourse'] = dirname( __FILE__ ) . '/specials/SpecialMasterCourse.php'; |
| 99 | +$wgAutoloadClasses['SpecialMasterCourses'] = dirname( __FILE__ ) . '/specials/SpecialMasterCourses.php'; |
100 | 100 | $wgAutoloadClasses['SpecialEnroll'] = dirname( __FILE__ ) . '/specials/SpecialEnroll.php'; |
101 | 101 | $wgAutoloadClasses['SpecialCAs'] = dirname( __FILE__ ) . '/specials/SpecialCAs.php'; |
102 | 102 | $wgAutoloadClasses['SpecialOAs'] = dirname( __FILE__ ) . '/specials/SpecialOAs.php'; |
— | — | @@ -110,12 +110,12 @@ |
111 | 111 | $wgSpecialPages['Students'] = 'SpecialStudents'; |
112 | 112 | $wgSpecialPages['Course'] = 'SpecialCourse'; |
113 | 113 | $wgSpecialPages['Courses'] = 'SpecialCourses'; |
114 | | -$wgSpecialPages['MasterCourse'] = 'SpecialMC'; |
115 | | -$wgSpecialPages['MasterCourses'] = 'SpecialMCs'; |
| 114 | +$wgSpecialPages['MasterCourse'] = 'SpecialMasterCourse'; |
| 115 | +$wgSpecialPages['MasterCourses'] = 'SpecialMasterCourses'; |
116 | 116 | $wgSpecialPages['EducationProgram'] = 'SpecialEducationProgram'; |
117 | 117 | $wgSpecialPages['EditCourse'] = 'SpecialEditCourse'; |
118 | 118 | $wgSpecialPages['EditInstitution'] = 'SpecialEditInstitution'; |
119 | | -$wgSpecialPages['EditMasterCourse'] = 'SpecialEditMC'; |
| 119 | +$wgSpecialPages['EditMasterCourse'] = 'SpecialEditMasterCourse'; |
120 | 120 | $wgSpecialPages['Enroll'] = 'SpecialEnroll'; |
121 | 121 | $wgSpecialPages['CampusAmbassadors'] = 'SpecialCAs'; |
122 | 122 | $wgSpecialPages['OnlineAmbassadors'] = 'SpecialOAs'; |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | $wgSpecialPageGroups['EducationProgram'] = 'education'; |
136 | 136 | $wgSpecialPageGroups['EditCourse'] = 'education'; |
137 | 137 | $wgSpecialPageGroups['EditInstitution'] = 'education'; |
138 | | -$wgSpecialPageGroups['EditMC'] = 'education'; |
| 138 | +$wgSpecialPageGroups['EditMasterCourse'] = 'education'; |
139 | 139 | $wgSpecialPageGroups['CampusAmbassadors'] = 'education'; |
140 | 140 | $wgSpecialPageGroups['OnlineAmbassadors'] = 'education'; |
141 | 141 | $wgSpecialPageGroups['CampusAmbassador'] = 'education'; |