Index: trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php |
— | — | @@ -35,6 +35,8 @@ |
36 | 36 | 'CampusAmbassador' => array( 'CampusAmbassador' ), |
37 | 37 | 'OnlineAmbassador' => array( 'OnlineAmbassador' ), |
38 | 38 | 'CourseHistory' => array( 'CourseHistory' ), |
| 39 | + 'MasterCourseHistory' => array( 'MasterCourseHistory' ), |
| 40 | + 'InstitutionHistory' => array( 'InstitutionHistory' ), |
39 | 41 | ); |
40 | 42 | |
41 | 43 | /** Dutch (Nederlands) */ |
Index: trunk/extensions/EducationProgram/specials/SpecialMasterCourseHistory.php |
— | — | @@ -0,0 +1,47 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Special page for listing the history of a master course. |
| 6 | + * |
| 7 | + * @since 0.1 |
| 8 | + * |
| 9 | + * @file SpecialMasterCourseHistory.php |
| 10 | + * @ingroup EducationProgram |
| 11 | + * |
| 12 | + * @licence GNU GPL v3 or later |
| 13 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
| 14 | + */ |
| 15 | +class SpecialMasterCourseHistory extends SpecialEPHistory { |
| 16 | + |
| 17 | + /** |
| 18 | + * Constructor. |
| 19 | + * |
| 20 | + * @since 0.1 |
| 21 | + */ |
| 22 | + public function __construct() { |
| 23 | + parent::__construct( 'MasterCourseHistory', '', false ); |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * Main method. |
| 28 | + * |
| 29 | + * @since 0.1 |
| 30 | + * |
| 31 | + * @param string $subPage |
| 32 | + */ |
| 33 | + public function execute( $subPage ) { |
| 34 | + parent::execute( $subPage ); |
| 35 | + |
| 36 | + $course = EPMC::selectRow( null, array( 'name' => $subPage ) ); |
| 37 | + |
| 38 | + if ( $course === false ) { |
| 39 | + // TODO |
| 40 | + } |
| 41 | + else { |
| 42 | + $this->displayRevisions( $course ); |
| 43 | + } |
| 44 | + } |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +} |
Index: trunk/extensions/EducationProgram/specials/SpecialInstitutionHistory.php |
— | — | @@ -0,0 +1,47 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Special page for listing the history of an institution. |
| 6 | + * |
| 7 | + * @since 0.1 |
| 8 | + * |
| 9 | + * @file SpecialInstitutionHistory.php |
| 10 | + * @ingroup EducationProgram |
| 11 | + * |
| 12 | + * @licence GNU GPL v3 or later |
| 13 | + * @author Jeroen De Dauw < jeroendedauw@gmail.com > |
| 14 | + */ |
| 15 | +class SpecialInstitutionHistory extends SpecialEPHistory { |
| 16 | + |
| 17 | + /** |
| 18 | + * Constructor. |
| 19 | + * |
| 20 | + * @since 0.1 |
| 21 | + */ |
| 22 | + public function __construct() { |
| 23 | + parent::__construct( 'InstitutionHistory', '', false ); |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * Main method. |
| 28 | + * |
| 29 | + * @since 0.1 |
| 30 | + * |
| 31 | + * @param string $subPage |
| 32 | + */ |
| 33 | + public function execute( $subPage ) { |
| 34 | + parent::execute( $subPage ); |
| 35 | + |
| 36 | + $org = EPOrg::selectRow( null, array( 'name' => $subPage ) ); |
| 37 | + |
| 38 | + if ( $org === false ) { |
| 39 | + // TODO |
| 40 | + } |
| 41 | + else { |
| 42 | + $this->displayRevisions( $org ); |
| 43 | + } |
| 44 | + } |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +} |
Index: trunk/extensions/EducationProgram/includes/EPOrgPager.php |
— | — | @@ -76,6 +76,10 @@ |
77 | 77 | $value = htmlspecialchars( $this->getLanguage()->formatNum( $value ) ); |
78 | 78 | |
79 | 79 | if ( $rawValue > 0 && in_array( $name, array( 'mcs', 'courses' ) ) ) { |
| 80 | + if ( $name == 'mcs' ) { |
| 81 | + $name = 'MasterCourses'; |
| 82 | + } |
| 83 | + |
80 | 84 | $value = Linker::linkKnown( |
81 | 85 | SpecialPage::getTitleFor( $this->getLanguage()->ucfirst( $name ) ), |
82 | 86 | $value, |
Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | $wgAutoloadClasses['EPCA'] = dirname( __FILE__ ) . '/includes/EPCA.php'; |
83 | 83 | $wgAutoloadClasses['EPCAPager'] = dirname( __FILE__ ) . '/includes/EPCAPager.php'; |
84 | 84 | $wgAutoloadClasses['EPHTMLDateField'] = dirname( __FILE__ ) . '/includes/EPHTMLDateField.php'; |
85 | | -$wgAutoloadClasses['EPRevision'] = dirname( __FILE__ ) . '/includes/EPRevision.php'; |
| 85 | +$wgAutoloadClasses['EPRevision'] = dirname( __FILE__ ) . '/includes/EPRevision.php'; |
86 | 86 | |
87 | 87 | $wgAutoloadClasses['SpecialCourse'] = dirname( __FILE__ ) . '/specials/SpecialCourse.php'; |
88 | 88 | $wgAutoloadClasses['SpecialCourses'] = dirname( __FILE__ ) . '/specials/SpecialCourses.php'; |
— | — | @@ -125,7 +125,9 @@ |
126 | 126 | $wgSpecialPages['OnlineAmbassadors'] = 'SpecialOAs'; |
127 | 127 | $wgSpecialPages['CampusAmbassador'] = 'SpecialCA'; |
128 | 128 | $wgSpecialPages['OnlineAmbassador'] = 'SpecialOA'; |
129 | | -$wgSpecialPages['CourseHistory'] = 'SpecialCourseHistory'; |
| 129 | +$wgSpecialPages['CourseHistory'] = 'SpecialCourseHistory'; |
| 130 | +$wgSpecialPages['MasterCourseHistory'] = 'SpecialMasterCourseHistory'; |
| 131 | +$wgSpecialPages['InstitutionHistory'] = 'SpecialInstitutionHistory'; |
130 | 132 | |
131 | 133 | $wgSpecialPageGroups['MyCourses'] = 'education'; |
132 | 134 | $wgSpecialPageGroups['Institution'] = 'education'; |
— | — | @@ -144,7 +146,9 @@ |
145 | 147 | $wgSpecialPageGroups['OnlineAmbassadors'] = 'education'; |
146 | 148 | $wgSpecialPageGroups['CampusAmbassador'] = 'education'; |
147 | 149 | $wgSpecialPageGroups['OnlineAmbassador'] = 'education'; |
148 | | -$wgSpecialPageGroups['CourseHistory'] = 'education'; |
| 150 | +$wgSpecialPageGroups['CourseHistory'] = 'education'; |
| 151 | +$wgSpecialPageGroups['MasterCourseHistory'] = 'education'; |
| 152 | +$wgSpecialPageGroups['InstitutionHistory'] = 'education'; |
149 | 153 | |
150 | 154 | // DB object classes |
151 | 155 | $egEPDBObjects = array(); |
Index: trunk/extensions/EducationProgram/EducationProgram.hooks.php |
— | — | @@ -177,12 +177,12 @@ |
178 | 178 | array( |
179 | 179 | 'view' => 'Institution', |
180 | 180 | 'edit' => 'EditInstitution', |
181 | | - //'history' => 'InstitutionHistory', |
| 181 | + 'history' => 'InstitutionHistory', |
182 | 182 | ), |
183 | 183 | array( |
184 | 184 | 'view' => 'MasterCourse', |
185 | 185 | 'edit' => 'EditMasterCourse', |
186 | | - //'history' => 'MasterCourseHistory', |
| 186 | + 'history' => 'MasterCourseHistory', |
187 | 187 | ), |
188 | 188 | array( |
189 | 189 | 'view' => 'Course', |