Make more fields sortable and one conditionally

Users can now sort filters by whether they are visible and which group
they belong to. Sorting by hit count is only possible if the user can
actually see it.

Change-Id: I516111f96b9ef0beaa0c04f902e03712591371d1
This commit is contained in:
Matěj Suchánek 2016-12-10 12:43:06 +00:00
parent 3e6605c94b
commit 95989575cc

View file

@ -359,11 +359,15 @@ class AbuseFilterPager extends TablePager {
$sortable_fields = array(
'af_id',
'af_enabled',
'af_hit_count',
'af_throttled',
'af_user_text',
'af_timestamp'
'af_timestamp',
'af_hidden',
'af_group',
);
if ( $this->mPage->getUser()->isAllowed( 'abusefilter-log-detail' ) ) {
$sortable_fields[] = 'af_hit_count';
}
return in_array( $name, $sortable_fields );
}
}