r109876 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109875‎ | r109876 | r109877 >
Date:23:58, 23 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r109872; added extra special pages
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.hooks.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOrgPager.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialInstitutionHistory.php (added) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialMasterCourseHistory.php (added) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php
@@ -35,6 +35,8 @@
3636 'CampusAmbassador' => array( 'CampusAmbassador' ),
3737 'OnlineAmbassador' => array( 'OnlineAmbassador' ),
3838 'CourseHistory' => array( 'CourseHistory' ),
 39+ 'MasterCourseHistory' => array( 'MasterCourseHistory' ),
 40+ 'InstitutionHistory' => array( 'InstitutionHistory' ),
3941 );
4042
4143 /** 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 @@
7777 $value = htmlspecialchars( $this->getLanguage()->formatNum( $value ) );
7878
7979 if ( $rawValue > 0 && in_array( $name, array( 'mcs', 'courses' ) ) ) {
 80+ if ( $name == 'mcs' ) {
 81+ $name = 'MasterCourses';
 82+ }
 83+
8084 $value = Linker::linkKnown(
8185 SpecialPage::getTitleFor( $this->getLanguage()->ucfirst( $name ) ),
8286 $value,
Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -81,7 +81,7 @@
8282 $wgAutoloadClasses['EPCA'] = dirname( __FILE__ ) . '/includes/EPCA.php';
8383 $wgAutoloadClasses['EPCAPager'] = dirname( __FILE__ ) . '/includes/EPCAPager.php';
8484 $wgAutoloadClasses['EPHTMLDateField'] = dirname( __FILE__ ) . '/includes/EPHTMLDateField.php';
85 -$wgAutoloadClasses['EPRevision'] = dirname( __FILE__ ) . '/includes/EPRevision.php';
 85+$wgAutoloadClasses['EPRevision'] = dirname( __FILE__ ) . '/includes/EPRevision.php';
8686
8787 $wgAutoloadClasses['SpecialCourse'] = dirname( __FILE__ ) . '/specials/SpecialCourse.php';
8888 $wgAutoloadClasses['SpecialCourses'] = dirname( __FILE__ ) . '/specials/SpecialCourses.php';
@@ -125,7 +125,9 @@
126126 $wgSpecialPages['OnlineAmbassadors'] = 'SpecialOAs';
127127 $wgSpecialPages['CampusAmbassador'] = 'SpecialCA';
128128 $wgSpecialPages['OnlineAmbassador'] = 'SpecialOA';
129 -$wgSpecialPages['CourseHistory'] = 'SpecialCourseHistory';
 129+$wgSpecialPages['CourseHistory'] = 'SpecialCourseHistory';
 130+$wgSpecialPages['MasterCourseHistory'] = 'SpecialMasterCourseHistory';
 131+$wgSpecialPages['InstitutionHistory'] = 'SpecialInstitutionHistory';
130132
131133 $wgSpecialPageGroups['MyCourses'] = 'education';
132134 $wgSpecialPageGroups['Institution'] = 'education';
@@ -144,7 +146,9 @@
145147 $wgSpecialPageGroups['OnlineAmbassadors'] = 'education';
146148 $wgSpecialPageGroups['CampusAmbassador'] = 'education';
147149 $wgSpecialPageGroups['OnlineAmbassador'] = 'education';
148 -$wgSpecialPageGroups['CourseHistory'] = 'education';
 150+$wgSpecialPageGroups['CourseHistory'] = 'education';
 151+$wgSpecialPageGroups['MasterCourseHistory'] = 'education';
 152+$wgSpecialPageGroups['InstitutionHistory'] = 'education';
149153
150154 // DB object classes
151155 $egEPDBObjects = array();
Index: trunk/extensions/EducationProgram/EducationProgram.hooks.php
@@ -177,12 +177,12 @@
178178 array(
179179 'view' => 'Institution',
180180 'edit' => 'EditInstitution',
181 - //'history' => 'InstitutionHistory',
 181+ 'history' => 'InstitutionHistory',
182182 ),
183183 array(
184184 'view' => 'MasterCourse',
185185 'edit' => 'EditMasterCourse',
186 - //'history' => 'MasterCourseHistory',
 186+ 'history' => 'MasterCourseHistory',
187187 ),
188188 array(
189189 'view' => 'Course',

Follow-up revisions

RevisionCommit summaryAuthorDate
r109890Follow up to r109872; r109876; make use of chronological pager to list revsjeroendedauw01:16, 24 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109872some initial work on revision supportjeroendedauw23:35, 23 January 2012

Status & tagging log