r109660 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109659‎ | r109660 | r109661 >
Date:22:57, 20 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
follow up to r109656 - removing obsolete file, adding newly needed files and updating names on a bunch of places
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialAmbassador.php (deleted) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialAmbassadors.php (deleted) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialCA.php (added) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialCAs.php (added) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialOA.php (added) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialOAs.php (added) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/EducationProgram.i18n.alias.php
@@ -23,13 +23,15 @@
2424 'Students' => array( 'Students' ),
2525 'Course' => array( 'Course' ),
2626 'Courses' => array( 'Courses' ),
27 - 'Term' => array( 'Term' ),
28 - 'Terms' => array( 'Terms' ),
 27+ 'MasterCourse' => array( 'MasterCourse' ),
 28+ 'MasterCourses' => array( 'MasterCourses' ),
2929 'EducationProgram' => array( 'EducationProgram' ),
3030 'EditCourse' => array( 'EditCourse' ),
3131 'EditInstitution' => array( 'EditInstitution' ),
32 - 'EditTerm' => array( 'EditTerm' ),
 32+ 'EditMC' => array( 'EditMC' ),
3333 'Enroll' => array( 'Enroll' ),
34 - 'Ambassadors' => array( 'Ambassadors' ),
35 - 'Ambassador' => array( 'Ambassador' ),
 34+ 'CampusAmbassadors' => array( 'CampusAmbassadors' ),
 35+ 'OnlineAmbassadors' => array( 'OnlineAmbassadors' ),
 36+ 'CampusAmbassador' => array( 'CampusAmbassador' ),
 37+ 'OnlineAmbassador' => array( 'OnlineAmbassador' ),
3638 );
Index: trunk/extensions/EducationProgram/specials/SpecialAmbassadors.php
@@ -1,45 +0,0 @@
2 -<?php
3 -
4 -/**
5 - * Page listing all mentors in a pager with filter control.
6 - *
7 - * @since 0.1
8 - *
9 - * @file SpecialAmbassadors.php
10 - * @ingroup EducationProgram
11 - *
12 - * @licence GNU GPL v3 or later
13 - * @author Jeroen De Dauw < jeroendedauw@gmail.com >
14 - */
15 -class SpecialAmbassadors extends SpecialEPPage {
16 -
17 - /**
18 - * Constructor.
19 - *
20 - * @since 0.1
21 - */
22 - public function __construct() {
23 - parent::__construct( 'Ambassadors' );
24 - }
25 -
26 - /**
27 - * Main method.
28 - *
29 - * @since 0.1
30 - *
31 - * @param string|null $subPage
32 - */
33 - public function execute( $subPage ) {
34 - parent::execute( $subPage );
35 -
36 - if ( $this->subPage === '' ) {
37 - $this->displayNavigation();
38 - EPMentor::displayPager( $this->getContext() );
39 - }
40 - else {
41 - // TODO
42 - // $this->getOutput()->redirect( SpecialPage::getTitleFor( 'Institution', $this->subPage )->getLocalURL() );
43 - }
44 - }
45 -
46 -}
Index: trunk/extensions/EducationProgram/specials/SpecialAmbassador.php
@@ -1,82 +0,0 @@
2 -<?php
3 -
4 -/**
5 - * Shows the info for a single ambassador.
6 - *
7 - * @since 0.1
8 - *
9 - * @file SpecialAmbassador.php
10 - * @ingroup EducationProgram
11 - *
12 - * @licence GNU GPL v3 or later
13 - * @author Jeroen De Dauw < jeroendedauw@gmail.com >
14 - */
15 -class SpecialAmbassador extends SpecialEPPage {
16 -
17 - /**
18 - * Constructor.
19 - *
20 - * @since 0.1
21 - */
22 - public function __construct() {
23 - parent::__construct( 'Ambassador' );
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 - $out = $this->getOutput();
37 -
38 - if ( trim( $subPage ) === '' ) {
39 - $this->getOutput()->redirect( SpecialPage::getTitleFor( 'Ambassadors' )->getLocalURL() );
40 - }
41 - else {
42 - $out->setPageTitle( wfMsgExt( 'ep-ambassador-title', 'parsemag', $this->subPage ) );
43 -
44 - $this->displayNavigation();
45 -
46 - $mentor = false; // EPMentor::selectRow( null, array( 'id' => $this->subPage ) );
47 -
48 - if ( $mentor === false ) {
49 - $this->showWarning( wfMessage( 'ep-ambassador-does-not-exist', $this->subPage ) );
50 - }
51 - else {
52 - $this->displaySummary( $mentor );
53 - }
54 - }
55 - }
56 -
57 - /**
58 - * Gets the summary data.
59 - *
60 - * @since 0.1
61 - *
62 - * @param EPMentor $mentor
63 - *
64 - * @return array
65 - */
66 - protected function getSummaryData( EPDBObject $mentor ) {
67 - $stats = array();
68 -
69 - $orgs = array();
70 -
71 - foreach ( $mentor->getOrgs( 'name' ) as /* EPOrg */ $org ) {
72 - $orgs[] = Linker::linkKnown(
73 - SpecialPage::getTitleFor( 'Institution', $org->getField( 'name' ) ),
74 - htmlspecialchars( $org->getField( 'name' ) )
75 - );
76 - }
77 -
78 - $stats['orgs'] = $this->getLanguage()->pipeList( $orgs );
79 -
80 - return $stats;
81 - }
82 -
83 -}
Index: trunk/extensions/EducationProgram/specials/SpecialOA.php
@@ -0,0 +1,71 @@
 2+<?php
 3+
 4+/**
 5+ * Shows the info for a single online ambassador.
 6+ *
 7+ * @since 0.1
 8+ *
 9+ * @file SpecialOA.php
 10+ * @ingroup EducationProgram
 11+ *
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 14+ */
 15+class SpecialOA extends SpecialEPPage {
 16+
 17+ /**
 18+ * Constructor.
 19+ *
 20+ * @since 0.1
 21+ */
 22+ public function __construct() {
 23+ parent::__construct( 'OnlineAmbassador' );
 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+ $out = $this->getOutput();
 37+
 38+ if ( trim( $subPage ) === '' ) {
 39+ $this->getOutput()->redirect( SpecialPage::getTitleFor( 'OnlineAmbassadors' )->getLocalURL() );
 40+ }
 41+ else {
 42+ $out->setPageTitle( wfMsgExt( 'ep-oa-title', 'parsemag', $this->subPage ) );
 43+
 44+ $this->displayNavigation();
 45+
 46+ $oa = false; // TODO
 47+
 48+ if ( $oa === false ) {
 49+ $this->showWarning( wfMessage( 'ep-oa-does-not-exist', $this->subPage ) );
 50+ }
 51+ else {
 52+ $this->displaySummary( $oa );
 53+ }
 54+ }
 55+ }
 56+
 57+ /**
 58+ * Gets the summary data.
 59+ *
 60+ * @since 0.1
 61+ *
 62+ * @param EPOA $ca
 63+ *
 64+ * @return array
 65+ */
 66+ protected function getSummaryData( EPDBObject $oa ) {
 67+ $stats = array();
 68+
 69+ return $stats;
 70+ }
 71+
 72+}
Index: trunk/extensions/EducationProgram/specials/SpecialCAs.php
@@ -0,0 +1,46 @@
 2+<?php
 3+
 4+/**
 5+ * Page listing campus ambassadors in a pager with filter control.
 6+ *
 7+ * @since 0.1
 8+ *
 9+ * @file SpecialCAs.php
 10+ * @ingroup EducationProgram
 11+ *
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 14+ */
 15+class SpecialCAs extends SpecialEPPage {
 16+
 17+ /**
 18+ * Constructor.
 19+ *
 20+ * @since 0.1
 21+ */
 22+ public function __construct() {
 23+ parent::__construct( 'CampusAmbassadors' );
 24+ }
 25+
 26+ /**
 27+ * Main method.
 28+ *
 29+ * @since 0.1
 30+ *
 31+ * @param string|null $subPage
 32+ */
 33+ public function execute( $subPage ) {
 34+ parent::execute( $subPage );
 35+
 36+ if ( $this->subPage === '' ) {
 37+ $this->displayNavigation();
 38+ // TODO
 39+ // EPMentor::displayPager( $this->getContext() );
 40+ }
 41+ else {
 42+ // TODO
 43+ // $this->getOutput()->redirect( SpecialPage::getTitleFor( 'Institution', $this->subPage )->getLocalURL() );
 44+ }
 45+ }
 46+
 47+}
Index: trunk/extensions/EducationProgram/specials/SpecialOAs.php
@@ -0,0 +1,46 @@
 2+<?php
 3+
 4+/**
 5+ * Page listing online ambassadors in a pager with filter control.
 6+ *
 7+ * @since 0.1
 8+ *
 9+ * @file SpecialOAs.php
 10+ * @ingroup EducationProgram
 11+ *
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 14+ */
 15+class SpecialOAs extends SpecialEPPage {
 16+
 17+ /**
 18+ * Constructor.
 19+ *
 20+ * @since 0.1
 21+ */
 22+ public function __construct() {
 23+ parent::__construct( 'OnlineAmbassadors' );
 24+ }
 25+
 26+ /**
 27+ * Main method.
 28+ *
 29+ * @since 0.1
 30+ *
 31+ * @param string|null $subPage
 32+ */
 33+ public function execute( $subPage ) {
 34+ parent::execute( $subPage );
 35+
 36+ if ( $this->subPage === '' ) {
 37+ $this->displayNavigation();
 38+ // TODO
 39+ // EPMentor::displayPager( $this->getContext() );
 40+ }
 41+ else {
 42+ // TODO
 43+ // $this->getOutput()->redirect( SpecialPage::getTitleFor( 'Institution', $this->subPage )->getLocalURL() );
 44+ }
 45+ }
 46+
 47+}
Index: trunk/extensions/EducationProgram/specials/SpecialCA.php
@@ -0,0 +1,71 @@
 2+<?php
 3+
 4+/**
 5+ * Shows the info for a single campus ambassador.
 6+ *
 7+ * @since 0.1
 8+ *
 9+ * @file SpecialCA.php
 10+ * @ingroup EducationProgram
 11+ *
 12+ * @licence GNU GPL v3 or later
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 14+ */
 15+class SpecialCA extends SpecialEPPage {
 16+
 17+ /**
 18+ * Constructor.
 19+ *
 20+ * @since 0.1
 21+ */
 22+ public function __construct() {
 23+ parent::__construct( 'CampusAmbassador' );
 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+ $out = $this->getOutput();
 37+
 38+ if ( trim( $subPage ) === '' ) {
 39+ $this->getOutput()->redirect( SpecialPage::getTitleFor( 'CampusAmbassadors' )->getLocalURL() );
 40+ }
 41+ else {
 42+ $out->setPageTitle( wfMsgExt( 'ep-ca-title', 'parsemag', $this->subPage ) );
 43+
 44+ $this->displayNavigation();
 45+
 46+ $ca = false; // TODO
 47+
 48+ if ( $ca === false ) {
 49+ $this->showWarning( wfMessage( 'ep-ca-does-not-exist', $this->subPage ) );
 50+ }
 51+ else {
 52+ $this->displaySummary( $ca );
 53+ }
 54+ }
 55+ }
 56+
 57+ /**
 58+ * Gets the summary data.
 59+ *
 60+ * @since 0.1
 61+ *
 62+ * @param EPCA $ca
 63+ *
 64+ * @return array
 65+ */
 66+ protected function getSummaryData( EPDBObject $ca ) {
 67+ $stats = array();
 68+
 69+ return $stats;
 70+ }
 71+
 72+}
Index: trunk/extensions/EducationProgram/EducationProgram.php
@@ -9,7 +9,9 @@
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
13 - * * Mentor instead of Ambassador
 13+ * * MC for master course
 14+ * * CA for campus ambassador
 15+ * * OA for online ambassador
1416 *
1517 * @file EducationProgram.php
1618 * @ingroup EducationProgram
@@ -63,11 +65,11 @@
6466
6567 $wgAutoloadClasses['EPCourse'] = dirname( __FILE__ ) . '/includes/EPCourse.php';
6668 $wgAutoloadClasses['EPCoursePager'] = dirname( __FILE__ ) . '/includes/EPCoursePager.php';
 69+$wgAutoloadClasses['EPMC'] = dirname( __FILE__ ) . '/includes/EPMC.php';
 70+$wgAutoloadClasses['EPMCPager'] = dirname( __FILE__ ) . '/includes/EPMCPager.php';
6771 $wgAutoloadClasses['EPDBObject'] = dirname( __FILE__ ) . '/includes/EPDBObject.php';
6872 $wgAutoloadClasses['EPInstructor'] = dirname( __FILE__ ) . '/includes/EPInstructor.php';
6973 $wgAutoloadClasses['EPLogFormatter'] = dirname( __FILE__ ) . '/includes/EPLogFormatter.php';
70 -$wgAutoloadClasses['EPMentor'] = dirname( __FILE__ ) . '/includes/EPMentor.php';
71 -$wgAutoloadClasses['EPMentorPager'] = dirname( __FILE__ ) . '/includes/EPMentorPager.php';
7274 $wgAutoloadClasses['EPOrg'] = dirname( __FILE__ ) . '/includes/EPOrg.php';
7375 $wgAutoloadClasses['EPOrgPager'] = dirname( __FILE__ ) . '/includes/EPOrgPager.php';
7476 $wgAutoloadClasses['EPPager'] = dirname( __FILE__ ) . '/includes/EPPager.php';
@@ -76,12 +78,16 @@
7779 $wgAutoloadClasses['EPTerm'] = dirname( __FILE__ ) . '/includes/EPTerm.php';
7880 $wgAutoloadClasses['EPTermPager'] = dirname( __FILE__ ) . '/includes/EPTermPager.php';
7981 $wgAutoloadClasses['EPUtils'] = dirname( __FILE__ ) . '/includes/EPUtils.php';
 82+$wgAutoloadClasses['EPOA'] = dirname( __FILE__ ) . '/includes/EPOA.php';
 83+$wgAutoloadClasses['EPOAPager'] = dirname( __FILE__ ) . '/includes/EPOAPager.php';
 84+$wgAutoloadClasses['EPCA'] = dirname( __FILE__ ) . '/includes/EPCA.php';
 85+$wgAutoloadClasses['EPCAPager'] = dirname( __FILE__ ) . '/includes/EPCAPager.php';
8086
8187 $wgAutoloadClasses['SpecialCourse'] = dirname( __FILE__ ) . '/specials/SpecialCourse.php';
8288 $wgAutoloadClasses['SpecialCourses'] = dirname( __FILE__ ) . '/specials/SpecialCourses.php';
8389 $wgAutoloadClasses['SpecialEditCourse'] = dirname( __FILE__ ) . '/specials/SpecialEditCourse.php';
8490 $wgAutoloadClasses['SpecialEditInstitution'] = dirname( __FILE__ ) . '/specials/SpecialEditInstitution.php';
85 -$wgAutoloadClasses['SpecialEditTerm'] = dirname( __FILE__ ) . '/specials/SpecialEditTerm.php';
 91+$wgAutoloadClasses['SpecialEditMC'] = dirname( __FILE__ ) . '/specials/SpecialEditMC.php';
8692 $wgAutoloadClasses['SpecialEducationProgram'] = dirname( __FILE__ ) . '/specials/SpecialEducationProgram.php';
8793 $wgAutoloadClasses['SpecialEPFormPage'] = dirname( __FILE__ ) . '/specials/SpecialEPFormPage.php';
8894 $wgAutoloadClasses['SpecialEPPage'] = dirname( __FILE__ ) . '/specials/SpecialEPPage.php';
@@ -90,11 +96,13 @@
9197 $wgAutoloadClasses['SpecialMyCourses'] = dirname( __FILE__ ) . '/specials/SpecialMyCourses.php';
9298 $wgAutoloadClasses['SpecialStudent'] = dirname( __FILE__ ) . '/specials/SpecialStudent.php';
9399 $wgAutoloadClasses['SpecialStudents'] = dirname( __FILE__ ) . '/specials/SpecialStudents.php';
94 -$wgAutoloadClasses['SpecialTerm'] = dirname( __FILE__ ) . '/specials/SpecialTerm.php';
95 -$wgAutoloadClasses['SpecialTerms'] = dirname( __FILE__ ) . '/specials/SpecialTerms.php';
 100+$wgAutoloadClasses['SpecialMC'] = dirname( __FILE__ ) . '/specials/SpecialMC.php';
 101+$wgAutoloadClasses['SpecialMCs'] = dirname( __FILE__ ) . '/specials/SpecialMCs.php';
96102 $wgAutoloadClasses['SpecialEnroll'] = dirname( __FILE__ ) . '/specials/SpecialEnroll.php';
97 -$wgAutoloadClasses['SpecialAmbassadors'] = dirname( __FILE__ ) . '/specials/SpecialAmbassadors.php';
98 -$wgAutoloadClasses['SpecialAmbassador'] = dirname( __FILE__ ) . '/specials/SpecialAmbassador.php';
 103+$wgAutoloadClasses['SpecialCAs'] = dirname( __FILE__ ) . '/specials/SpecialCAs.php';
 104+$wgAutoloadClasses['SpecialOAs'] = dirname( __FILE__ ) . '/specials/SpecialOAs.php';
 105+$wgAutoloadClasses['SpecialCA'] = dirname( __FILE__ ) . '/specials/SpecialCA.php';
 106+$wgAutoloadClasses['SpecialOA'] = dirname( __FILE__ ) . '/specials/SpecialOA.php';
99107
100108 // Special pages
101109 $wgSpecialPages['MyCourses'] = 'SpecialMyCourses';
@@ -104,15 +112,17 @@
105113 $wgSpecialPages['Students'] = 'SpecialStudents';
106114 $wgSpecialPages['Course'] = 'SpecialCourse';
107115 $wgSpecialPages['Courses'] = 'SpecialCourses';
108 -$wgSpecialPages['Term'] = 'SpecialTerm';
109 -$wgSpecialPages['Terms'] = 'SpecialTerms';
 116+$wgSpecialPages['MasterCourse'] = 'SpecialMC';
 117+$wgSpecialPages['MasterCourses'] = 'SpecialMCs';
110118 $wgSpecialPages['EducationProgram'] = 'SpecialEducationProgram';
111119 $wgSpecialPages['EditCourse'] = 'SpecialEditCourse';
112120 $wgSpecialPages['EditInstitution'] = 'SpecialEditInstitution';
113 -$wgSpecialPages['EditTerm'] = 'SpecialEditTerm';
 121+$wgSpecialPages['EditMC'] = 'SpecialEditMC';
114122 $wgSpecialPages['Enroll'] = 'SpecialEnroll';
115 -$wgSpecialPages['Ambassadors'] = 'SpecialAmbassadors';
116 -$wgSpecialPages['Ambassador'] = 'SpecialAmbassador';
 123+$wgSpecialPages['CampusAmbassadors'] = 'SpecialCAs';
 124+$wgSpecialPages['OnlineAmbassadors'] = 'SpecialOAs';
 125+$wgSpecialPages['CampusAmbassador'] = 'SpecialCA';
 126+$wgSpecialPages['OnlineAmbassador'] = 'SpecialOA';
117127
118128 $wgSpecialPageGroups['MyCourses'] = 'education';
119129 $wgSpecialPageGroups['Institution'] = 'education';
@@ -121,21 +131,22 @@
122132 $wgSpecialPageGroups['Students'] = 'education';
123133 $wgSpecialPageGroups['Course'] = 'education';
124134 $wgSpecialPageGroups['Courses'] = 'education';
125 -$wgSpecialPageGroups['Term'] = 'education';
126 -$wgSpecialPageGroups['Terms'] = 'education';
 135+$wgSpecialPageGroups['MasterCourse'] = 'education';
 136+$wgSpecialPageGroups['MasterCourses'] = 'education';
127137 $wgSpecialPageGroups['EducationProgram'] = 'education';
128138 $wgSpecialPageGroups['EditCourse'] = 'education';
129139 $wgSpecialPageGroups['EditInstitution'] = 'education';
130 -$wgSpecialPageGroups['EditTerm'] = 'education';
131 -$wgSpecialPageGroups['Ambassadors'] = 'education';
132 -$wgSpecialPageGroups['Ambassador'] = 'education';
 140+$wgSpecialPageGroups['EditMC'] = 'education';
 141+$wgSpecialPageGroups['CampusAmbassadors'] = 'education';
 142+$wgSpecialPageGroups['OnlineAmbassadors'] = 'education';
 143+$wgSpecialPageGroups['CampusAmbassador'] = 'education';
 144+$wgSpecialPageGroups['OnlineAmbassador'] = 'education';
133145
134146 // DB object classes
135147 $egEPDBObjects = array();
136148 $egEPDBObjects['EPOrg'] = array( 'table' => 'ep_orgs', 'prefix' => 'org_' );
 149+$egEPDBObjects['EPMC'] = array( 'table' => 'ep_mcs', 'prefix' => 'mc_' );
137150 $egEPDBObjects['EPCourse'] = array( 'table' => 'ep_courses', 'prefix' => 'course_' );
138 -$egEPDBObjects['EPTerm'] = array( 'table' => 'ep_terms', 'prefix' => 'term_' );
139 -$egEPDBObjects['EPMentor'] = array( 'table' => 'ep_mentors', 'prefix' => 'mentor_' );
140151 $egEPDBObjects['EPStudent'] = array( 'table' => 'ep_students', 'prefix' => 'student_' );
141152 $egEPDBObjects[] = array( 'table' => 'ep_students_per_term', 'prefix' => 'spt_' );
142153

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