Commit ec8193bb authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Allowing admin users see all activity filter types in inbox/outbox"

parents 0aa571a2 1e39fa77
......@@ -36,9 +36,15 @@ $installedtypes = get_records_assoc(
);
$options = array();
// check if user is an admin in at least one group and if so they can see group admin filter options
$groupadmin = false;
$grouproles = $USER->get('grouproles');
if (array_search('admin', $grouproles) !== false) {
$groupadmin = true;
}
foreach ($installedtypes as &$t) {
if (!$t->admin) {
foreach ($installedtypes as $t) {
if (!$t->admin || $USER->get('admin') || ($groupadmin && $t->pluginname == 'forum')) {
$section = $t->pluginname ? "{$t->plugintype}.{$t->pluginname}" : 'activity';
$options[$t->name] = get_string('type' . $t->name, $section);
}
......
......@@ -35,10 +35,10 @@ $installedtypes = get_records_assoc(
);
$options = array();
foreach ($installedtypes as &$t) {
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
if ((!$t->admin) && ('newpost' !== $t->name)) {
if ((!$t->admin || $USER->get('admin')) && ('newpost' !== $t->name)) {
$section = $t->pluginname ? "{$t->plugintype}.{$t->pluginname}" : 'activity';
$options[$t->name] = get_string('type' . $t->name, $section);
}
......
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