Index: trunk/extensions/EducationProgram/specials/SpecialStudents.php |
— | — | @@ -34,11 +34,22 @@ |
35 | 35 | |
36 | 36 | if ( $this->subPage === '' ) { |
37 | 37 | $this->displayNavigation(); |
38 | | - EPStudent::displayPager( $this->getContext() ); |
| 38 | + |
| 39 | + $this->startCache( 3600 ); |
| 40 | + $this->addCachedHTML( 'EPStudent::getPager', $this->getContext() ); |
| 41 | + $this->saveCache(); |
39 | 42 | } |
40 | 43 | else { |
41 | 44 | $this->getOutput()->redirect( SpecialPage::getTitleFor( 'Student', $this->subPage )->getLocalURL() ); |
42 | 45 | } |
43 | 46 | } |
44 | 47 | |
| 48 | + /** |
| 49 | + * @see SpecialCachedPage::getCacheKey |
| 50 | + * @return array |
| 51 | + */ |
| 52 | + protected function getCacheKey() { |
| 53 | + return array_merge( $this->getRequest()->getValues(), parent::getCacheKey() ); |
| 54 | + } |
| 55 | + |
45 | 56 | } |
Index: trunk/extensions/EducationProgram/specials/SpecialOAs.php |
— | — | @@ -34,7 +34,10 @@ |
35 | 35 | |
36 | 36 | if ( $this->subPage === '' ) { |
37 | 37 | $this->displayNavigation(); |
38 | | - EPOA::displayPager( $this->getContext() ); |
| 38 | + |
| 39 | + $this->startCache( 3600 ); |
| 40 | + $this->addCachedHTML( 'EPOA::getPager', $this->getContext() ); |
| 41 | + $this->saveCache(); |
39 | 42 | } |
40 | 43 | else { |
41 | 44 | $this->getOutput()->redirect( SpecialPage::getTitleFor( 'OnlineAmbassador', $this->subPage )->getLocalURL() ); |
Index: trunk/extensions/EducationProgram/specials/SpecialCAs.php |
— | — | @@ -34,7 +34,10 @@ |
35 | 35 | |
36 | 36 | if ( $this->subPage === '' ) { |
37 | 37 | $this->displayNavigation(); |
38 | | - EPCA::displayPager( $this->getContext() ); |
| 38 | + |
| 39 | + $this->startCache( 3600 ); |
| 40 | + $this->addCachedHTML( 'EPCA::getPager', $this->getContext() ); |
| 41 | + $this->saveCache(); |
39 | 42 | } |
40 | 43 | else { |
41 | 44 | $this->getOutput()->redirect( SpecialPage::getTitleFor( 'CampusAmbassador', $this->subPage )->getLocalURL() ); |
Index: trunk/extensions/EducationProgram/includes/EPCA.php |
— | — | @@ -20,22 +20,23 @@ |
21 | 21 | * |
22 | 22 | * @param IContextSource $context |
23 | 23 | * @param array $conditions |
| 24 | + * |
| 25 | + * @return string |
24 | 26 | */ |
25 | | - public static function displayPager( IContextSource $context, array $conditions = array() ) { |
| 27 | + public static function getPager( IContextSource $context, array $conditions = array() ) { |
26 | 28 | $pager = new EPCAPager( $context, $conditions ); |
27 | 29 | |
28 | 30 | if ( $pager->getNumRows() ) { |
29 | | - $context->getOutput()->addHTML( |
| 31 | + return |
30 | 32 | $pager->getFilterControl() . |
31 | | - $pager->getNavigationBar() . |
32 | | - $pager->getBody() . |
33 | | - $pager->getNavigationBar() . |
34 | | - $pager->getMultipleItemControl() |
35 | | - ); |
| 33 | + $pager->getNavigationBar() . |
| 34 | + $pager->getBody() . |
| 35 | + $pager->getNavigationBar() . |
| 36 | + $pager->getMultipleItemControl(); |
36 | 37 | } |
37 | 38 | else { |
38 | | - $context->getOutput()->addHTML( $pager->getFilterControl( true ) ); |
39 | | - $context->getOutput()->addWikiMsg( 'ep-ca-noresults' ); |
| 39 | + return $pager->getFilterControl( true ) . |
| 40 | + $context->msg( 'ep-ca-noresults' )->escaped(); |
40 | 41 | } |
41 | 42 | } |
42 | 43 | |
Index: trunk/extensions/EducationProgram/includes/EPOA.php |
— | — | @@ -20,22 +20,23 @@ |
21 | 21 | * |
22 | 22 | * @param IContextSource $context |
23 | 23 | * @param array $conditions |
| 24 | + * |
| 25 | + * @return string |
24 | 26 | */ |
25 | | - public static function displayPager( IContextSource $context, array $conditions = array() ) { |
| 27 | + public static function getPager( IContextSource $context, array $conditions = array() ) { |
26 | 28 | $pager = new EPOAPager( $context, $conditions ); |
27 | 29 | |
28 | 30 | if ( $pager->getNumRows() ) { |
29 | | - $context->getOutput()->addHTML( |
| 31 | + return |
30 | 32 | $pager->getFilterControl() . |
31 | | - $pager->getNavigationBar() . |
32 | | - $pager->getBody() . |
33 | | - $pager->getNavigationBar() . |
34 | | - $pager->getMultipleItemControl() |
35 | | - ); |
| 33 | + $pager->getNavigationBar() . |
| 34 | + $pager->getBody() . |
| 35 | + $pager->getNavigationBar() . |
| 36 | + $pager->getMultipleItemControl(); |
36 | 37 | } |
37 | 38 | else { |
38 | | - $context->getOutput()->addHTML( $pager->getFilterControl( true ) ); |
39 | | - $context->getOutput()->addWikiMsg( 'ep-oa-noresults' ); |
| 39 | + return $pager->getFilterControl( true ) . |
| 40 | + $context->msg( 'ep-oa-noresults' )->escaped(); |
40 | 41 | } |
41 | 42 | } |
42 | 43 | |
Index: trunk/extensions/EducationProgram/includes/EPStudent.php |
— | — | @@ -20,22 +20,23 @@ |
21 | 21 | * |
22 | 22 | * @param IContextSource $context |
23 | 23 | * @param array $conditions |
| 24 | + * |
| 25 | + * @return string |
24 | 26 | */ |
25 | | - public static function displayPager( IContextSource $context, array $conditions = array() ) { |
| 27 | + public static function getPager( IContextSource $context, array $conditions = array() ) { |
26 | 28 | $pager = new EPStudentPager( $context, $conditions ); |
27 | 29 | |
28 | 30 | if ( $pager->getNumRows() ) { |
29 | | - $context->getOutput()->addHTML( |
| 31 | + return |
30 | 32 | $pager->getFilterControl() . |
31 | | - $pager->getNavigationBar() . |
32 | | - $pager->getBody() . |
33 | | - $pager->getNavigationBar() . |
34 | | - $pager->getMultipleItemControl() |
35 | | - ); |
| 33 | + $pager->getNavigationBar() . |
| 34 | + $pager->getBody() . |
| 35 | + $pager->getNavigationBar() . |
| 36 | + $pager->getMultipleItemControl(); |
36 | 37 | } |
37 | 38 | else { |
38 | | - $context->getOutput()->addHTML( $pager->getFilterControl( true ) ); |
39 | | - $context->getOutput()->addWikiMsg( 'ep-students-noresults' ); |
| 39 | + return $pager->getFilterControl( true ) . |
| 40 | + $context->msg( 'ep-students-noresults' )->escaped(); |
40 | 41 | } |
41 | 42 | } |
42 | 43 | |