Index: trunk/extensions/EducationProgram/specials/SpecialCourse.php |
— | — | @@ -121,13 +121,13 @@ |
122 | 122 | ); |
123 | 123 | } |
124 | 124 | |
125 | | - $instructors = $course->getInstructors; |
| 125 | + $instructors = $course->getInstructors(); |
126 | 126 | |
127 | 127 | if ( count( $instructors ) > 0 ) { |
128 | 128 | $stats['instructors'] = '<ul>'; |
129 | 129 | |
130 | | - foreach ( $instructors as /* User */ $instructor ) { |
131 | | - // TODO |
| 130 | + foreach ( $instructors as /* EPInstructor */ $instructor ) { |
| 131 | + $instructor->getUserLink() . $instructor->getToolLinks( $this->getContext() ); |
132 | 132 | } |
133 | 133 | |
134 | 134 | $stats['instructors'] = '</ul>'; |
Index: trunk/extensions/EducationProgram/includes/EPDBObject.php |
— | — | @@ -560,6 +560,10 @@ |
561 | 561 | if ( is_string( $value ) ) { |
562 | 562 | $value = unserialize( $value ); |
563 | 563 | } |
| 564 | + |
| 565 | + if ( !is_array( $value ) ) { |
| 566 | + $value = array(); |
| 567 | + } |
564 | 568 | break; |
565 | 569 | case 'id': |
566 | 570 | if ( is_string( $value ) ) { |
Index: trunk/extensions/EducationProgram/includes/EPInstructor.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | ); |
133 | 133 | } |
134 | 134 | |
135 | | - return '<span class="mw-usertoollinks">(' . $context->getLanguage()->pipeList( $links ) . ')</span>'; |
| 135 | + return ' <span class="mw-usertoollinks">(' . $context->getLanguage()->pipeList( $links ) . ')</span>'; |
136 | 136 | } |
137 | 137 | |
138 | 138 | } |
Index: trunk/extensions/EducationProgram/includes/EPCourse.php |
— | — | @@ -23,10 +23,10 @@ |
24 | 24 | protected $org = false; |
25 | 25 | |
26 | 26 | /** |
27 | | - * Field for caching the instructors their user objects. |
| 27 | + * Field for caching the instructors. |
28 | 28 | * |
29 | 29 | * @since 0.1 |
30 | | - * @var {array of User}|false |
| 30 | + * @var {array of EPInstructor}|false |
31 | 31 | */ |
32 | 32 | protected $instructors = false; |
33 | 33 | |
— | — | @@ -339,18 +339,18 @@ |
340 | 340 | } |
341 | 341 | |
342 | 342 | /** |
343 | | - * Returns the instructors as a list of User objects. |
| 343 | + * Returns the instructors as a list of EPInstructor objects. |
344 | 344 | * |
345 | 345 | * @since 0.1 |
346 | 346 | * |
347 | | - * @return array of User |
| 347 | + * @return array of EPInstructor |
348 | 348 | */ |
349 | 349 | public function getInstructors() { |
350 | 350 | if ( $this->instructors === false ) { |
351 | 351 | $this->instructors = array(); |
352 | 352 | |
353 | 353 | foreach ( $this->getField( 'instructors' ) as $userId ) { |
354 | | - $this->instructors[] = User::newFromId( $userId ); |
| 354 | + $this->instructors[] = EPInstructor::newFromId( $userId ); |
355 | 355 | } |
356 | 356 | } |
357 | 357 | |
Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -188,15 +188,18 @@ |
189 | 189 | $wgLogHeaders['instructor'] = 'log-header-instructor'; |
190 | 190 | } |
191 | 191 | |
192 | | -$wgAvailableRights[] = 'ep-org'; // Manage orgs |
193 | | -$wgAvailableRights[] = 'ep-course'; // Manage courses |
194 | | -$wgAvailableRights[] = 'ep-term'; // Manage terms |
195 | | -$wgAvailableRights[] = 'ep-token'; // See enrollment tokens |
196 | | -$wgAvailableRights[] = 'ep-enroll'; // Enroll as a student |
197 | | -$wgAvailableRights[] = 'ep-remstudent'; // Dissasociate students from terms |
198 | | -$wgAvailableRights[] = 'ep-online'; // Add or remove online ambassadors from terms |
199 | | -$wgAvailableRights[] = 'ep-campus'; // Add or remove campus ambassadors from terms |
200 | | -$wgAvailableRights[] = 'ep-instructor'; // Add or remove instructors from courses |
| 192 | +$wgAvailableRights[] = 'ep-org'; // Manage orgs |
| 193 | +$wgAvailableRights[] = 'ep-course'; // Manage courses |
| 194 | +$wgAvailableRights[] = 'ep-term'; // Manage terms |
| 195 | +$wgAvailableRights[] = 'ep-token'; // See enrollment tokens |
| 196 | +$wgAvailableRights[] = 'ep-enroll'; // Enroll as a student |
| 197 | +$wgAvailableRights[] = 'ep-remstudent'; // Dissasociate students from terms |
| 198 | +$wgAvailableRights[] = 'ep-online'; // Add or remove online ambassadors from terms |
| 199 | +$wgAvailableRights[] = 'ep-campus'; // Add or remove campus ambassadors from terms |
| 200 | +$wgAvailableRights[] = 'ep-instructor'; // Add or remove instructors from courses |
| 201 | +$wgAvailableRights[] = 'ep-beonline'; // Add or remove yourself as online ambassador from terms |
| 202 | +$wgAvailableRights[] = 'ep-becampus'; // Add or remove yourself as campus ambassador from terms |
| 203 | +$wgAvailableRights[] = 'ep-beinstructor'; // Add or remove yourself as instructor from courses |
201 | 204 | |
202 | 205 | $wgGroupPermissions['*']['ep-enroll'] = true; |
203 | 206 | $wgGroupPermissions['*']['ep-org'] = false; |
— | — | @@ -207,6 +210,9 @@ |
208 | 211 | $wgGroupPermissions['*']['ep-online'] = false; |
209 | 212 | $wgGroupPermissions['*']['ep-campus'] = false; |
210 | 213 | $wgGroupPermissions['*']['ep-instructor'] = false; |
| 214 | +$wgGroupPermissions['*']['ep-beonline'] = false; |
| 215 | +$wgGroupPermissions['*']['ep-becampus'] = false; |
| 216 | +$wgGroupPermissions['*']['ep-beinstructor'] = false; |
211 | 217 | |
212 | 218 | $wgGroupPermissions['epstaff']['ep-org'] = true; |
213 | 219 | $wgGroupPermissions['epstaff']['ep-course'] = true; |
— | — | @@ -217,6 +223,9 @@ |
218 | 224 | $wgGroupPermissions['epstaff']['ep-online'] = true; |
219 | 225 | $wgGroupPermissions['epstaff']['ep-campus'] = true; |
220 | 226 | $wgGroupPermissions['epstaff']['ep-instructor'] = true; |
| 227 | +$wgGroupPermissions['epstaff']['ep-beonline'] = true; |
| 228 | +$wgGroupPermissions['epstaff']['ep-becampus'] = true; |
| 229 | +$wgGroupPermissions['epstaff']['ep-beinstructor'] = true; |
221 | 230 | |
222 | 231 | $wgGroupPermissions['epadmin']['ep-org'] = true; |
223 | 232 | $wgGroupPermissions['epadmin']['ep-course'] = true; |
— | — | @@ -227,16 +236,21 @@ |
228 | 237 | $wgGroupPermissions['epadmin']['ep-online'] = true; |
229 | 238 | $wgGroupPermissions['epadmin']['ep-campus'] = true; |
230 | 239 | $wgGroupPermissions['epadmin']['ep-instructor'] = true; |
| 240 | +$wgGroupPermissions['epadmin']['ep-beonline'] = true; |
| 241 | +$wgGroupPermissions['epadmin']['ep-becampus'] = true; |
| 242 | +$wgGroupPermissions['epadmin']['ep-beinstructor'] = true; |
231 | 243 | |
232 | 244 | $wgGroupPermissions['eponlineamb']['ep-org'] = true; |
233 | 245 | $wgGroupPermissions['eponlineamb']['ep-course'] = true; |
234 | 246 | $wgGroupPermissions['eponlineamb']['ep-term'] = true; |
235 | 247 | $wgGroupPermissions['eponlineamb']['ep-token'] = true; |
| 248 | +$wgGroupPermissions['eponlineamb']['ep-beonline'] = true; |
236 | 249 | |
237 | 250 | $wgGroupPermissions['epcampamb']['ep-org'] = true; |
238 | 251 | $wgGroupPermissions['epcampamb']['ep-course'] = true; |
239 | 252 | $wgGroupPermissions['epcampamb']['ep-term'] = true; |
240 | 253 | $wgGroupPermissions['epcampamb']['ep-token'] = true; |
| 254 | +$wgGroupPermissions['epcampamb']['ep-becampus'] = true; |
241 | 255 | |
242 | 256 | $wgGroupPermissions['epinstructor']['ep-org'] = true; |
243 | 257 | $wgGroupPermissions['epinstructor']['ep-course'] = true; |
— | — | @@ -245,6 +259,7 @@ |
246 | 260 | $wgGroupPermissions['epinstructor']['ep-remstudent'] = true; |
247 | 261 | $wgGroupPermissions['epinstructor']['ep-online'] = true; |
248 | 262 | $wgGroupPermissions['epinstructor']['ep-campus'] = true; |
| 263 | +$wgGroupPermissions['epinstructor']['ep-beinstructor'] = true; |
249 | 264 | |
250 | 265 | $wgGroupPermissions['epstaff']['userrights'] = false; |
251 | 266 | $wgAddGroups['epstaff'] = array( 'epstaff', 'epadmin', 'eponlineamb', 'epcampamb', 'epinstructor' ); |