diff --git a/tag/lib.php b/tag/lib.php
index d55bb79b1fd..c5e818c8452 100644
--- a/tag/lib.php
+++ b/tag/lib.php
@@ -1208,29 +1208,27 @@ function print_tag_management_box($tag_object, $return=false) {
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
- $addtaglink = '';
-
- if ( has_capability('moodle/tag:manage',$systemcontext) ) {
- $manage_link = "wwwroot}/tag/manage.php\">" . get_string('managetags', 'tag') . "" ;
- $output .= $manage_link .' | ';
- }
+ $links = array();
// if the user is not tagged with the $tag_object tag, a link "add blahblah to my interests" will appear
if( !is_item_tagged_with('user', $USER->id, $tag_object->id )) {
- $addtaglink = '';
- $addtaglink .= get_string('addtagtomyinterests','tag',$tagname). '';
- $output .= $addtaglink .' | ';
+ $links[] = ''.get_string('addtagtomyinterests','tag',$tagname). '';
}
// only people with moodle/tag:edit capability may edit the tag description
if ( has_capability('moodle/tag:edit',$systemcontext) && is_item_tagged_with('user', $USER->id, $tag_object->id ) ) {
- $output .= ' '.get_string('edittag', 'tag').' | ';
+ $links[] = ''.get_string('edittag', 'tag').'';
}
// flag as inappropriate link
- $flagtaglink = '';
- $flagtaglink .= get_string('flagasinappropriate','tag',$tagname). '';
- $output .= $flagtaglink;
+ $links[] = '' . get_string('flagasinappropriate','tag',$tagname). '';
+
+ // Manage all tags links
+ if ( has_capability('moodle/tag:manage',$systemcontext) ) {
+ $links[] = '' . get_string('managetags', 'tag') . '' ;
+ }
+
+ $output .= implode(' | ', $links);
$output .= print_box_end(true);
@@ -1238,12 +1236,10 @@ function print_tag_management_box($tag_object, $return=false) {
if ($return) {
return $output;
- }
- else {
+ } else {
echo $output;
}
-
}
/**