Index: trunk/extensions/EducationProgram/includes/EPOrgPager.php |
— | — | @@ -60,9 +60,16 @@ |
61 | 61 | */ |
62 | 62 | public function formatValue( $name, $value ) { |
63 | 63 | switch ( $name ) { |
64 | | - case '': // TODO |
65 | | - $value = $value; |
| 64 | + case 'org_name': |
| 65 | + $value = Linker::linkKnown( |
| 66 | + SpecialPage::getTitleFor( 'Institution', $value ), |
| 67 | + $value |
| 68 | + ); |
66 | 69 | break; |
| 70 | + case 'org_country': |
| 71 | + $countries = array_flip( efEpGetCountryOptions() ); |
| 72 | + $value = $countries[$value]; |
| 73 | + break; |
67 | 74 | } |
68 | 75 | |
69 | 76 | return $value; |
Index: trunk/extensions/EducationProgram/includes/EPPager.php |
— | — | @@ -60,6 +60,8 @@ |
61 | 61 | else { |
62 | 62 | parent::__construct(); |
63 | 63 | } |
| 64 | + |
| 65 | + $this->context->getOutput()->addModules( 'ep.pager' ); |
64 | 66 | } |
65 | 67 | |
66 | 68 | /** |
— | — | @@ -242,11 +244,12 @@ |
243 | 245 | |
244 | 246 | return |
245 | 247 | '<fieldset>' . |
246 | | - '<legend>' . wfMsgHtml( 'educationprogram-pager-showonly' ) . '</legend>' . |
| 248 | + '<legend>' . wfMsgHtml( 'ep-pager-showonly' ) . '</legend>' . |
247 | 249 | '<form method="post" action="' . htmlspecialchars( $GLOBALS['wgScript'] . '?title=' . $title ) . '">' . |
248 | 250 | Html::hidden( 'title', $title ) . |
249 | 251 | implode( '', $controls ) . |
250 | | - ' <input type="submit" value="' . wfMsgHtml( 'reviews-reviews-go' ) . '">' . |
| 252 | + ' <input type="submit" class="ep-pager-go" value="' . wfMsgHtml( 'ep-pager-go' ) . '">' . |
| 253 | + ' <button class="ep-pager-clear">' . wfMsgHtml( 'ep-pager-clear' ) . '</button>' . |
251 | 254 | '</form>' . |
252 | 255 | '</fieldset>'; |
253 | 256 | } |
Index: trunk/extensions/EducationProgram/EducationProgram.i18n.php |
— | — | @@ -65,7 +65,9 @@ |
66 | 66 | 'ep-institutions-add' => 'Add institution', |
67 | 67 | |
68 | 68 | // Pager |
69 | | - 'educationprogram-pager-showonly' => 'Show only these items', |
| 69 | + 'ep-pager-showonly' => 'Show only items with', |
| 70 | + 'ep-pager-clear' => 'Clear filters', |
| 71 | + 'ep-pager-go' => 'Go', |
70 | 72 | |
71 | 73 | // Org pager |
72 | 74 | 'eporgpager-header-name' => 'Name', |
Index: trunk/extensions/EducationProgram/EducationProgram.php |
— | — | @@ -141,6 +141,12 @@ |
142 | 142 | 'remoteExtPath' => 'EducationProgram/resources' |
143 | 143 | ); |
144 | 144 | |
| 145 | +$wgResourceModules['ep.pager'] = $moduleTemplate + array( |
| 146 | + 'scripts' => array( |
| 147 | + 'ep.pager.js', |
| 148 | + ), |
| 149 | +); |
| 150 | + |
145 | 151 | unset( $moduleTemplate ); |
146 | 152 | |
147 | 153 | $egEPSettings = array(); |
Index: trunk/extensions/EducationProgram/resources/ep.pager.js |
— | — | @@ -0,0 +1,22 @@ |
| 2 | +/** |
| 3 | + * JavasSript for the Education Program MediaWiki extension. |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Education_Program |
| 5 | + * |
| 6 | + * @licence GNU GPL v3 or later |
| 7 | + * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
| 8 | + */ |
| 9 | + |
| 10 | +(function( $, mw ) { |
| 11 | + |
| 12 | + $( document ).ready( function() { |
| 13 | + |
| 14 | + $( '.ep-pager-clear' ).click( function() { |
| 15 | + var $form = $( this ).closest( 'form' ); |
| 16 | + $form.find( 'select' ).val( '' ); |
| 17 | + $form.submit(); |
| 18 | + return false; |
| 19 | + } ); |
| 20 | + |
| 21 | + } ); |
| 22 | + |
| 23 | +})( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |
Property changes on: trunk/extensions/EducationProgram/resources/ep.pager.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 24 | + native |