r108348 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108347‎ | r108348 | r108349 >
Date:06:12, 8 January 2012
Author:jeroendedauw
Status:deferred
Tags:
Comment:
work on org and term pagers
Modified paths:
  • /trunk/extensions/EducationProgram/EducationProgram.i18n.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPOrgPager.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPPager.php (modified) (history)
  • /trunk/extensions/EducationProgram/includes/EPTermPager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EducationProgram/includes/EPOrgPager.php
@@ -72,7 +72,18 @@
7373 $value = htmlspecialchars( $countries[$value] );
7474 break;
7575 case 'courses': case 'mentors': case 'students': case 'terms':
 76+ $rawValue = $value;
7677 $value = htmlspecialchars( $this->getLanguage()->formatNum( $value ) );
 78+
 79+ if ( $rawValue > 0 && in_array( $name, array( 'terms', 'courses' ) ) ) {
 80+ $value = Linker::linkKnown(
 81+ SpecialPage::getTitleFor( $this->getLanguage()->ucfirst( $name ) ),
 82+ $value,
 83+ array(),
 84+ array( 'org_id' => $this->currentObject->getId() )
 85+ );
 86+ }
 87+
7788 break;
7889 }
7990
Index: trunk/extensions/EducationProgram/includes/EPTermPager.php
@@ -116,6 +116,15 @@
117117 'value' => '',
118118 'datatype' => 'int',
119119 ),
 120+ 'org_id' => array(
 121+ 'type' => 'select',
 122+ 'options' => array_merge(
 123+ array( '' => '' ),
 124+ EPOrg::getOrgOptions( EPOrg::select( array( 'name', 'id' ) ) )
 125+ ),
 126+ 'value' => '',
 127+ 'datatype' => 'int',
 128+ ),
120129 'year' => array(
121130 'type' => 'select',
122131 'options' => $years,
Index: trunk/extensions/EducationProgram/includes/EPPager.php
@@ -441,7 +441,7 @@
442442 protected function addFilterValues( array &$filterOptions, $cast = true ) {
443443 $req = $this->getRequest();
444444 $changed = false;
445 -
 445+
446446 foreach ( $filterOptions as $optionName => &$optionData ) {
447447 if ( $req->getCheck( $optionName ) ) {
448448 $optionData['value'] = $req->getVal( $optionName );
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php
@@ -147,6 +147,7 @@
148148 'eptermpager-header-end' => 'End',
149149 'eptermpager-filter-course-id' => 'Course',
150150 'eptermpager-filter-year' => 'Year',
 151+ 'eptermpager-filter-org-id' => 'Institution',
151152
152153 // Student pager
153154 'epstudentpager-header-user-id' => 'User',

Status & tagging log