r107296 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107295‎ | r107296 | r107297 >
Date:22:38, 25 December 2011
Author:jeroendedauw
Status:deferred
Tags:educationprogram 
Comment:
work on special:course
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialCourse.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialCourse.php
@@ -55,8 +55,12 @@
5656 }
5757 }
5858 else {
59 - $this->displayInfo( $course );
 59+ $this->displaySummary( $course );
6060
 61+ $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-course-description' ) ) );
 62+
 63+ $out->addHTML( '<p>' . $this->getOutput()->parse( $course->getField( 'description' ) ) . '</p>' );
 64+
6165 $out->addHTML( Html::element( 'h2', array(), wfMsg( 'ep-course-terms' ) ) );
6266
6367 EPTerm::displayPager( $this->getContext(), array( 'course_id' => $course->getId() ) );
@@ -65,16 +69,21 @@
6670 }
6771
6872 /**
69 - * Display the course info.
70 - *
 73+ * Gets the summary data.
 74+ *
7175 * @since 0.1
72 - *
 76+ *
7377 * @param EPCourse $course
 78+ *
 79+ * @return array
7480 */
75 - protected function displayInfo( EPCourse $course ) {
76 - $out = $this->getOutput();
77 -
78 -
 81+ protected function getSummaryData( EPDBObject $course ) {
 82+ $stats = array();
 83+
 84+ $stats['name'] = $course->getField( 'name' );
 85+ $stats['org'] = EPOrg::selectFieldsRow( 'name', array( 'id' => $course->getField( 'org_id' ) ) );
 86+
 87+ return $stats;
7988 }
8089
8190 }
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -168,6 +168,9 @@
169169 'ep-course-terms' => 'Terms',
170170 'ep-course-none' => 'There is no course with name "$1". See [[Special:Courses|here]] for a list of courses.',
171171 'ep-course-create' => 'There is no course with name "$1" yet, but you can create it.',
 172+ 'specialcourse-summary-name' => 'Name',
 173+ 'specialcourse-summary-org' => 'Institution',
 174+ 'ep-course-description' => 'Description',
172175
173176 // Special:Term
174177 'ep-term-title' => 'Term: $1',

Status & tagging log