r107697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107696‎ | r107697 | r107698 >
Date:03:27, 31 December 2011
Author:jeroendedauw
Status:deferred
Tags:educationprogram 
Comment:
work on preferences and some cleanup
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.hooks.php (modified) (history)
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOrg.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPTerm.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialCourse.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialEnroll.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialInstitution.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialStudent.php (modified) (history)
  • /trunk/extensions/EducationProgram/specials/SpecialTerm.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/specials/SpecialInstitution.php
@@ -28,7 +28,7 @@
2929 *
3030 * @since 0.1
3131 *
32 - * @param string $arg
 32+ * @param string $subPage
3333 */
3434 public function execute( $subPage ) {
3535 parent::execute( $subPage );
Index: trunk/extensions/EducationProgram/specials/SpecialEnroll.php
@@ -188,8 +188,10 @@
189189
190190 $success = $student->writeToDB();
191191
192 - if ( $success ) {//q($this->term);
 192+ if ( $success ) {
193193 $success = $student->associateWithTerms( array( $this->term ) ) && $success;
 194+ $this->getUser()->setOption( 'ep_showtoplink', true );
 195+ $this->getUser()->saveSettings(); // TODO: can't we just save this single option instead of everything?
194196 }
195197
196198 if ( $success ) {
Index: trunk/extensions/EducationProgram/specials/SpecialCourse.php
@@ -28,7 +28,7 @@
2929 *
3030 * @since 0.1
3131 *
32 - * @param string $arg
 32+ * @param string $subPage
3333 */
3434 public function execute( $subPage ) {
3535 parent::execute( $subPage );
Index: trunk/extensions/EducationProgram/specials/SpecialTerm.php
@@ -28,7 +28,7 @@
2929 *
3030 * @since 0.1
3131 *
32 - * @param string $arg
 32+ * @param string $subPage
3333 */
3434 public function execute( $subPage ) {
3535 parent::execute( $subPage );
Index: trunk/extensions/EducationProgram/specials/SpecialStudent.php
@@ -27,7 +27,7 @@
2828 *
2929 * @since 0.1
3030 *
31 - * @param string $arg
 31+ * @param string $subPage
3232 */
3333 public function execute( $subPage ) {
3434 parent::execute( $subPage );
Index: trunk/extensions/EducationProgram/includes/EPOrg.php
@@ -197,7 +197,8 @@
198198 $pager->getFilterControl() .
199199 $pager->getNavigationBar() .
200200 $pager->getBody() .
201 - $pager->getNavigationBar()
 201+ $pager->getNavigationBar() .
 202+ $pager->getMultipleItemControl()
202203 );
203204 }
204205 else {
Index: trunk/extensions/EducationProgram/includes/EPTerm.php
@@ -155,7 +155,7 @@
156156
157157 /**
158158 * Adds a control to add a term org to the provided context.
159 - * Adittional arguments can be provided to set the default values for the control fields.
 159+ * Additional arguments can be provided to set the default values for the control fields.
160160 *
161161 * @since 0.1
162162 *
Index: trunk/extensions/EducationProgram/includes/EPCourse.php
@@ -149,7 +149,7 @@
150150
151151 /**
152152 * Adds a control to add a new course to the provided context.
153 - * Adittional arguments can be provided to set the default values for the control fields.
 153+ * Additional arguments can be provided to set the default values for the control fields.
154154 *
155155 * @since 0.1
156156 *
@@ -256,7 +256,8 @@
257257 $pager->getFilterControl() .
258258 $pager->getNavigationBar() .
259259 $pager->getBody() .
260 - $pager->getNavigationBar()
 260+ $pager->getNavigationBar() .
 261+ $pager->getMultipleItemControl()
261262 );
262263 }
263264 else {
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -24,6 +24,10 @@
2525 'ep-item-summary' => 'Summary',
2626 'ep-toplink' => 'My courses',
2727
 28+ // Preferences
 29+ 'prefs-education' => 'Education',
 30+ 'ep-prefs-showtoplink' => 'Show a link to [[Special:MyCourses|your courses]] at the top of every page.',
 31+
2832 // Rights
2933 'right-epadmin' => 'Manage the education program',
3034 'right-epstudent' => 'Enroll in the education program',
@@ -211,7 +215,8 @@
212216 'ep-enroll-legend' => 'Enroll',
213217
214218 // Special:MyCourses
215 - 'ep-mycourses-enrolled' => 'You have successfully enrolled for $1 at $2',
 219+ 'ep-mycourses-enrolled' => 'You have successfully enrolled for $1 at $2.',
 220+ 'ep-mycourses-not-enrolled' => 'You are not enrolled in any course. A list of courses can be found [[Special:Courses|here]].',
216221
217222 // Navigation links
218223 'ep-nav-orgs' => 'Institution list',
Index: trunk/extensions/EducationProgram/EducationProgram.hooks.php
@@ -96,6 +96,13 @@
9797 * @return true
9898 */
9999 public static function onGetPreferences( User $user, array &$preferences ) {
 100+ if ( EPSettings::get( 'enableTopLink' ) ) {
 101+ $preferences['ep_showtoplink'] = array(
 102+ 'type' => 'toggle',
 103+ 'label-message' => 'ep-prefs-showtoplink',
 104+ 'section' => 'education',
 105+ );
 106+ }
100107
101108 return true;
102109 }

Status & tagging log