MDL-17521 shortcuts at top of tag page for each sort of thing that's been tagged

This commit is contained in:
jmg324 2008-12-16 16:33:30 +00:00
parent 6c59c9c76b
commit 3caea5dc63
2 changed files with 12 additions and 6 deletions

View file

@ -19,7 +19,7 @@ $string['flag'] = 'Flag';
$string['flagasinappropriate'] = 'Flag as inappropriate'; $string['flagasinappropriate'] = 'Flag as inappropriate';
$string['helprelatedtags'] = 'Comma separated related tags'; $string['helprelatedtags'] = 'Comma separated related tags';
$string['id'] = 'id'; $string['id'] = 'id';
$string['relatedblogs'] = 'Most recent blog entries tagged with \"$a\"'; $string['relatedblogs'] = 'Most recent blog entries';
$string['managetags'] = 'Manage tags'; $string['managetags'] = 'Manage tags';
$string['name'] = 'Tag name'; $string['name'] = 'Tag name';
$string['namesalreadybeeingused'] = 'Tag names already being used'; $string['namesalreadybeeingused'] = 'Tag names already being used';
@ -46,15 +46,14 @@ $string['tag'] = 'Tag';
$string['tagtype'] = 'Tag type'; $string['tagtype'] = 'Tag type';
$string['tagtype_official'] = 'Official'; $string['tagtype_official'] = 'Official';
$string['tagtype_default'] = 'Default'; $string['tagtype_default'] = 'Default';
$string['tagindex_coursetitle'] = 'Courses tagged with \"$a\"';
$string['tags'] = 'Tags'; $string['tags'] = 'Tags';
$string['taggedwith'] = 'tagged with \"$a\"';
$string['tagsaredisabled'] = 'Tags are disabled'; $string['tagsaredisabled'] = 'Tags are disabled';
$string['thingtaggedwith'] = '\"$a->name\" is used once'; $string['thingtaggedwith'] = '\"$a->name\" is used once';
$string['thingstaggedwith'] = '\"$a->name\" is used $a->count times'; $string['thingstaggedwith'] = '\"$a->name\" is used $a->count times';
$string['thistaghasnodesc'] = 'This tag currently has no description.'; $string['thistaghasnodesc'] = 'This tag currently has no description.';
$string['timemodified'] = 'Modified'; $string['timemodified'] = 'Modified';
$string['typechanged'] = 'Tag type changed'; $string['typechanged'] = 'Tag type changed';
$string['userstaggedwith'] = 'Users tagged with \"$a\"';
$string['updatetag'] = 'Update'; $string['updatetag'] = 'Update';
$string['updated'] = 'Updated'; $string['updated'] = 'Updated';
$string['withselectedtags'] = 'With selected tags...'; $string['withselectedtags'] = 'With selected tags...';

View file

@ -78,6 +78,10 @@ print_heading($tagname, '', 2, 'headingblock header tag-heading');
tag_print_management_box($tag); tag_print_management_box($tag);
tag_print_description_box($tag); tag_print_description_box($tag);
echo '<div style="text-align: center "><p><a href="#course">'.get_string('courses').
'</a> | <a href="#blog">'.get_string('relatedblogs', 'tag').
'</a> | <a href="#user">'.get_string('users').'</a></p></div>';
// Display courses tagged with the tag // Display courses tagged with the tag
require_once($CFG->dirroot.'/tag/coursetagslib.php'); require_once($CFG->dirroot.'/tag/coursetagslib.php');
if ($courses = coursetag_get_tagged_courses($tag->id)) { if ($courses = coursetag_get_tagged_courses($tag->id)) {
@ -85,7 +89,8 @@ if ($courses = coursetag_get_tagged_courses($tag->id)) {
$totalcount = count( $courses ); $totalcount = count( $courses );
print_box_start('generalbox', 'tag-blogs'); //could use an id separate from tag-blogs, but would have to copy the css style to make it look the same print_box_start('generalbox', 'tag-blogs'); //could use an id separate from tag-blogs, but would have to copy the css style to make it look the same
$heading = get_string('tagindex_coursetitle', 'tag', $tagname) .': '. $totalcount; $heading = get_string('courses') . ' ' . get_string('taggedwith', 'tag', $tagname) .': '. $totalcount;
echo "<a name='course'></a>";
print_heading($heading, '', 3); print_heading($heading, '', 3);
foreach ($courses as $course) { foreach ($courses as $course) {
@ -106,7 +111,8 @@ if (has_capability('moodle/blog:view', $systemcontext)) { // You have to see bl
if ($blogs = blog_fetch_entries('', $count, 0, 'site', '', $tag->id)) { if ($blogs = blog_fetch_entries('', $count, 0, 'site', '', $tag->id)) {
print_box_start('generalbox', 'tag-blogs'); print_box_start('generalbox', 'tag-blogs');
$heading = get_string('relatedblogs', 'tag', $tagname); $heading = get_string('relatedblogs', 'tag', $tagname). ' ' . get_string('taggedwith', 'tag', $tagname);
echo "<a name='blog'></a>";
print_heading($heading, '', 3); print_heading($heading, '', 3);
echo '<ul id="tagblogentries">'; echo '<ul id="tagblogentries">';
@ -141,7 +147,8 @@ if ($usercount > 0) {
//user table box //user table box
print_box_start('generalbox', 'tag-user-table'); print_box_start('generalbox', 'tag-user-table');
$heading = get_string('userstaggedwith', 'tag', $tagname) . ': ' . $usercount; $heading = get_string('users'). ' ' . get_string('taggedwith', 'tag', $tagname) . ': ' . $usercount;
echo "<a name='user'></a>";
print_heading($heading, '', 3); print_heading($heading, '', 3);
$baseurl = $CFG->wwwroot.'/tag/index.php?id=' . $tag->id; $baseurl = $CFG->wwwroot.'/tag/index.php?id=' . $tag->id;