1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-25 02:16:06 +02:00

admins should see all tags

This commit is contained in:
toyomoyo 2007-08-31 02:17:42 +00:00
parent 84895c5321
commit 81c07f5ebf

@ -78,7 +78,11 @@ class block_blog_tags extends block_base {
$sql .= "FROM {$CFG->prefix}tag t, {$CFG->prefix}tag_instance ti, {$CFG->prefix}post p ";
$sql .= 'WHERE t.id = ti.tagid ';
$sql .= 'AND p.id = ti.itemid ';
$sql .= 'AND (p.publishstate = \'site\' or p.publishstate=\'public\') ';
// admins should be able to read all tags
if (!has_capability('moodle/user:readuserblogs', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
$sql .= 'AND (p.publishstate = \'site\' or p.publishstate=\'public\') ';
}
$sql .= "AND ti.timemodified > {$timewithin} ";
$sql .= 'GROUP BY t.id, t.tagtype, t.name ';
$sql .= 'ORDER BY ct DESC, t.name ASC';