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(
'name,admin,plugintype,pluginname'
);
$options = array(
'all' => get_string('alltypes', 'activity'),
);
$options = array();
foreach ($installedtypes as &$t) {
if (!$t->admin) {
......@@ -50,6 +48,10 @@ if ($USER->get('admin')) {
$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');
if ($type == '') {
$type = 'all';
......
......@@ -34,10 +34,7 @@ $installedtypes = get_records_assoc(
'name,admin,plugintype,pluginname'
);
$options = array(
'all' => get_string('alltypes', 'activity'),
);
$options = array();
foreach ($installedtypes as &$t) {
// ignore activity type newpost, as each recipients notification appears
// as a single entry for the poster and thus floods his outbox
......@@ -51,6 +48,10 @@ if ($USER->get('admin')) {
$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');
if ($type == '') {
$type = 'all';
......
Markdown is supported
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