Commit b4812741 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review
Browse files

Merge "Sort activities in mailboxes"

parents 05a208f9 abbdcc09
...@@ -35,9 +35,7 @@ $installedtypes = get_records_assoc( ...@@ -35,9 +35,7 @@ $installedtypes = get_records_assoc(
'name,admin,plugintype,pluginname' 'name,admin,plugintype,pluginname'
); );
$options = array( $options = array();
'all' => get_string('alltypes', 'activity'),
);
foreach ($installedtypes as &$t) { foreach ($installedtypes as &$t) {
if (!$t->admin) { if (!$t->admin) {
...@@ -50,6 +48,10 @@ if ($USER->get('admin')) { ...@@ -50,6 +48,10 @@ if ($USER->get('admin')) {
$options['adminmessages'] = get_string('typeadminmessages', 'activity'); $options['adminmessages'] = get_string('typeadminmessages', 'activity');
} }
// sort activitytypes now, when they have been translated
uasort($options, 'strcmp');
// ... and add the element for 'all types' to the beginning
$options = array_merge(array('all' => get_string('alltypes', 'activity')), $options);
$type = param_variable('type', 'all'); $type = param_variable('type', 'all');
if ($type == '') { if ($type == '') {
$type = 'all'; $type = 'all';
......
...@@ -34,10 +34,7 @@ $installedtypes = get_records_assoc( ...@@ -34,10 +34,7 @@ $installedtypes = get_records_assoc(
'name,admin,plugintype,pluginname' 'name,admin,plugintype,pluginname'
); );
$options = array( $options = array();
'all' => get_string('alltypes', 'activity'),
);
foreach ($installedtypes as &$t) { foreach ($installedtypes as &$t) {
// ignore activity type newpost, as each recipients notification appears // ignore activity type newpost, as each recipients notification appears
// as a single entry for the poster and thus floods his outbox // as a single entry for the poster and thus floods his outbox
...@@ -51,6 +48,10 @@ if ($USER->get('admin')) { ...@@ -51,6 +48,10 @@ if ($USER->get('admin')) {
$options['adminmessages'] = get_string('typeadminmessages', 'activity'); $options['adminmessages'] = get_string('typeadminmessages', 'activity');
} }
// sort activitytypes now, when they have been translated
uasort($options, 'strcmp');
// ... and add the element for 'all types' to the beginning
$options = array_merge(array('all' => get_string('alltypes', 'activity')), $options);
$type = param_variable('type', 'all'); $type = param_variable('type', 'all');
if ($type == '') { if ($type == '') {
$type = 'all'; $type = 'all';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment