r107754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107753‎ | r107754 | r107755 >
Date:22:48, 31 December 2011
Author:jeroendedauw
Status:deferred
Tags:educationprogram 
Comment:
work on mycourses
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPStudent.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialMyCourses.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialMyCourses.php
@@ -104,9 +104,35 @@
105105 protected function displayCoursesList( array /* of EPCourse */ $courses ) {
106106 $out = $this->getOutput();
107107
 108+ $out->addHTML( Xml::openElement(
 109+ 'table',
 110+ array( 'class' => 'wikitable sortable' )
 111+ ) );
 112+
 113+ $headers = array(
 114+ Html::element( 'th', array(), wfMsg( 'ep-mycourses-header-name' ) ),
 115+ Html::element( 'th', array(), wfMsg( 'ep-mycourses-header-institution' ) ),
 116+ );
 117+
 118+ $out->addHTML( '<thead><tr>' . implode( '', $headers ) . '</tr></thead>' );
 119+
 120+ $out->addHTML( '<tbody>' );
 121+
108122 foreach ( $courses as /* EPCourse */ $course ) {
 123+ $fields = array();
109124
 125+ $fields[] = $course->getField( 'name' );
 126+ $fields[] = $course->getOrg()->getField( 'name' );
 127+
 128+ foreach ( $fields as &$field ) {
 129+ $field = Html::rawElement( 'td', array(), $field );
 130+ }
 131+
 132+ $out->addHTML( '<tr>' . implode( '', $fields ) . '</tr>' );
110133 }
 134+
 135+ $out->addHTML( '</tbody>' );
 136+ $out->addHTML( '</table>' );
111137 }
112138
113139 /**
Index: trunk/extensions/EducationProgram/includes/EPStudent.php
@@ -126,8 +126,10 @@
127127 $this->getTerms( 'course_id', $termConditions ),
128128 function( array $ids, EPTerm $term ) {
129129 $ids[] = $term->getField( 'course_id' );
 130+ return $ids;
130131 },
131 - array() );
 132+ array()
 133+ );
132134
133135 if ( count( $courseIds ) < 1 ) {
134136 return array();
@@ -135,7 +137,7 @@
136138
137139 $conditions['id'] = array_unique( $courseIds );
138140
139 - return EPCourse::select( $fields, array( 'id' => $conditions ) );
 141+ return EPCourse::select( $fields, $conditions );
140142 }
141143
142144 /**
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -219,6 +219,8 @@
220220 'ep-mycourses-not-enrolled' => 'You are not enrolled in any course. A list of courses can be found [[Special:Courses|here]].',
221221 'ep-mycourses-current' => 'Active courses',
222222 'ep-mycourses-passed' => 'Passed courses',
 223+ 'ep-mycourses-header-name' => 'Name',
 224+ 'ep-mycourses-header-institution' => 'Institution',
223225
224226 // Navigation links
225227 'ep-nav-orgs' => 'Institution list',

Status & tagging log