Index: trunk/extensions/EducationProgram/specials/SpecialMyCourses.php |
— | — | @@ -104,9 +104,35 @@ |
105 | 105 | protected function displayCoursesList( array /* of EPCourse */ $courses ) { |
106 | 106 | $out = $this->getOutput(); |
107 | 107 | |
| 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 | + |
108 | 122 | foreach ( $courses as /* EPCourse */ $course ) { |
| 123 | + $fields = array(); |
109 | 124 | |
| 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>' ); |
110 | 133 | } |
| 134 | + |
| 135 | + $out->addHTML( '</tbody>' ); |
| 136 | + $out->addHTML( '</table>' ); |
111 | 137 | } |
112 | 138 | |
113 | 139 | /** |
Index: trunk/extensions/EducationProgram/includes/EPStudent.php |
— | — | @@ -126,8 +126,10 @@ |
127 | 127 | $this->getTerms( 'course_id', $termConditions ), |
128 | 128 | function( array $ids, EPTerm $term ) { |
129 | 129 | $ids[] = $term->getField( 'course_id' ); |
| 130 | + return $ids; |
130 | 131 | }, |
131 | | - array() ); |
| 132 | + array() |
| 133 | + ); |
132 | 134 | |
133 | 135 | if ( count( $courseIds ) < 1 ) { |
134 | 136 | return array(); |
— | — | @@ -135,7 +137,7 @@ |
136 | 138 | |
137 | 139 | $conditions['id'] = array_unique( $courseIds ); |
138 | 140 | |
139 | | - return EPCourse::select( $fields, array( 'id' => $conditions ) ); |
| 141 | + return EPCourse::select( $fields, $conditions ); |
140 | 142 | } |
141 | 143 | |
142 | 144 | /** |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -219,6 +219,8 @@ |
220 | 220 | 'ep-mycourses-not-enrolled' => 'You are not enrolled in any course. A list of courses can be found [[Special:Courses|here]].', |
221 | 221 | 'ep-mycourses-current' => 'Active courses', |
222 | 222 | 'ep-mycourses-passed' => 'Passed courses', |
| 223 | + 'ep-mycourses-header-name' => 'Name', |
| 224 | + 'ep-mycourses-header-institution' => 'Institution', |
223 | 225 | |
224 | 226 | // Navigation links |
225 | 227 | 'ep-nav-orgs' => 'Institution list', |