https://www.mediawiki.org/wiki/Special:Code/MediaWiki/111977
Revision: 111977
Author: jeroendedauw
Date: 2012-02-20 23:12:45 +0000 (Mon, 20 Feb 2012)
Log Message:
-----------
fixed issue with table sort
Modified Paths:
--------------
trunk/extensions/EducationProgram/includes/EPPager.php
Modified: trunk/extensions/EducationProgram/includes/EPPager.php
===================================================================
--- trunk/extensions/EducationProgram/includes/EPPager.php 2012-02-20
22:53:32 UTC (rev 111976)
+++ trunk/extensions/EducationProgram/includes/EPPager.php 2012-02-20
23:12:45 UTC (rev 111977)
@@ -258,7 +258,7 @@
function isFieldSortable( $name ) {
return in_array(
$name,
- $this->table->getPrefixedFields(
$this->getSortableFields() )
+ $this->getSortableFields()
);
}
@@ -503,7 +503,6 @@
# Make table header
foreach ( $fields as $field => $name ) {
- $prefixedField = $this->table->getPrefixedField( $field
);
$name = $name === '' ? '' : $this->getMsg( 'header-' .
$name );
if ( $field === '_select' ) {
@@ -516,10 +515,10 @@
}
elseif ( strval( $name ) == '' ) {
$s .= "<th> </th>\n";
- } elseif ( $this->isFieldSortable( $prefixedField ) ) {
- $query = array( 'sort' => $prefixedField,
'limit' => $this->mLimit );
+ } elseif ( $this->isFieldSortable( $field ) ) {
+ $query = array( 'sort' => $field, 'limit' =>
$this->mLimit );
- if ( $prefixedField == $this->mSort ) {
+ if ( $field == $this->mSort ) {
# This is the sorted column
# Prepare a link that goes in the other
sort order
if ( $this->mDefaultDirection ) {
@@ -552,6 +551,14 @@
$s .= "</tr></thead><tbody>\n";
return $s;
}
+
+ /**
+ * (non-PHPdoc)
+ * @see IndexPager::getIndexField()
+ */
+ public function getIndexField() {
+ return $this->table->getPrefixedField( $this->mSort );
+ }
protected $instanceNumber = null;
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs