if ($courses = coursetag_get_tagged_courses($tag->id)) {
$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
+ echo $OUTPUT->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('courses') . ' ' . get_string('taggedwith', 'tag', $tagname) .': '. $totalcount;
echo "<a name='course'></a>";
print_course($course);
}
- print_box_end();
+ echo $OUTPUT->box_end();
}
// Print up to 10 previous blogs entries
$count = 10;
if ($blogs = blog_fetch_entries('', $count, 0, 'site', '', $tag->id)) {
- print_box_start('generalbox', 'tag-blogs');
+ echo $OUTPUT->box_start('generalbox', 'tag-blogs');
$heading = get_string('relatedblogs', 'tag', $tagname). ' ' . get_string('taggedwith', 'tag', $tagname);
echo "<a name='blog'></a>";
echo $OUTPUT->heading($heading, 3);
echo '<p class="moreblogs"><a href="'.$CFG->wwwroot.'/blog/index.php?filtertype=site&filterselect=0&tagid='.$tag->id.'">'.get_string('seeallblogs', 'tag', $tagname).'</a></p>';
- print_box_end();
+ echo $OUTPUT->box_end();
}
}
if ($usercount > 0) {
//user table box
- print_box_start('generalbox', 'tag-user-table');
+ echo $OUTPUT->box_start('generalbox', 'tag-user-table');
$heading = get_string('users'). ' ' . get_string('taggedwith', 'tag', $tagname) . ': ' . $usercount;
echo "<a name='user'></a>";
$pagingbar->pagevar = 'userpage';
echo $OUTPUT->paging_bar($pagingbar);
tag_print_tagged_users_table($tag, $userpage * $perpage, $perpage);
- print_box_end();
+ echo $OUTPUT->box_end();
}
echo $OUTPUT->footer();
*/
function tag_print_cloud($nr_of_tags=150, $return=false) {
global $CFG, $DB;
-
+
$can_manage_tags = has_capability('moodle/tag:manage', get_context_instance(CONTEXT_SYSTEM));
if ( !$tagsincloud = $DB->get_records_sql('SELECT tg.rawname, tg.id, tg.name, tg.tagtype, COUNT(ti.id) AS count, tg.flag
}
/**
- * This function is used by print_tag_cloud, to usort() the tags in the cloud.
+ * This function is used by print_tag_cloud, to usort() the tags in the cloud.
* See php.net/usort for the parameters documentation. This was originally in
* blocks/blog_tags/block_blog_tags.php, named blog_tags_sort().
*/
*/
function tag_print_description_box($tag_object, $return=false) {
- global $USER, $CFG;
+ global $USER, $CFG, $OUTPUT;
$max_tags_displayed = 10; // todo: turn this into a system setting
$output = '';
if ($content) {
- $output .= print_box_start('generalbox', 'tag-description', true);
+ $output .= $OUTPUT->box_start('generalbox', 'tag-description');
}
if (!empty($tag_object->description)) {
}
if ($content) {
- $output .= print_box_end(true);
+ $output .= $OUTPUT->box_end();
}
if ($return) {
*/
function tag_print_management_box($tag_object, $return=false) {
- global $USER, $CFG;
+ global $USER, $CFG, $OUTPUT;
$tagname = tag_display_name($tag_object);
$output = '';
if (!isguestuser()) {
- $output .= print_box_start('box','tag-management-box', true);
+ $output .= $OUTPUT->box_start('box','tag-management-box');
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$links = array();
-
+
// Add a link for users to add/remove this from their interests
if (tag_record_tagged_with('user', $USER->id, $tag_object->name)) {
$links[] = '<a href="'. $CFG->wwwroot .'/tag/user.php?action=removeinterest&sesskey='. sesskey() .'&tag='. rawurlencode($tag_object->name) .'">'. get_string('removetagfrommyinterests', 'tag', $tagname) .'</a>';
$links[] = '<a href="'. $CFG->wwwroot .'/tag/user.php?action=flaginappropriate&sesskey='. sesskey() .'&tag='. rawurlencode($tag_object->name) .'">'. get_string('flagasinappropriate', 'tag', rawurlencode($tagname)) .'</a>';
// Edit tag: Only people with moodle/tag:edit capability who either have it as an interest or can manage tags
- if (has_capability('moodle/tag:edit', $systemcontext) ||
+ if (has_capability('moodle/tag:edit', $systemcontext) ||
has_capability('moodle/tag:manage', $systemcontext)) {
$links[] = '<a href="'. $CFG->wwwroot .'/tag/edit.php?tag='. rawurlencode($tag_object->name) .'">'. get_string('edittag', 'tag') .'</a>';
}
$output .= implode(' | ', $links);
- $output .= print_box_end(true);
+ $output .= $OUTPUT->box_end();
}
if ($return) {
* @param bool $return if true return html string
*/
function tag_print_search_box($return=false) {
- global $CFG;
+ global $CFG, $OUTPUT;
- $output = print_box_start('','tag-search-box', true);
+ $output = $OUTPUT->box_start('','tag-search-box');
$output .= '<form action="'.$CFG->wwwroot.'/tag/search.php" style="display:inline">';
$output .= '<div>';
$output .= '<input id="searchform_search" name="query" type="text" size="40" />';
$output .= '<button id="searchform_button" type="submit">'. get_string('search', 'tag') .'</button><br />';
$output .= '</div>';
$output .= '</form>';
- $output .= print_box_end(true);
+ $output .= $OUTPUT->box_end();
if ($return) {
return $output;
//print a link "Add $query to my interests"
if (!empty($addtaglink)) {
- $output .= print_box($addtaglink, 'box', 'tag-management-box', true);
+ $output .= $OUTPUT->box($addtaglink, 'box', 'tag-management-box');
}
$nr_of_lis_per_ul = 6;
//print a link "Add $query to my interests"
if (!empty($addtaglink)) {
- $output .= print_box($addtaglink, 'box', 'tag-management-box', true);
+ $output .= $OUTPUT->box($addtaglink, 'box', 'tag-management-box');
}
}
* @param $return if true return html string
*/
function tag_print_user_box($user, $return=false) {
- global $CFG;
+ global $CFG, $OUTPUT;
$textlib = textlib_get_instance();
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
$profilelink = $CFG->wwwroot .'/user/view.php?id='. $user->id;
}
- $output = print_box_start('user-box', 'user'. $user->id, true);
+ $output = $OUTPUT->box_start('user-box', 'user'. $user->id);
$fullname = fullname($user);
$alt = '';
} else {
$output .= '<img alt="'. $alt .'" class="user-image" src="'. $CFG->wwwroot .'/pix/u/f1.png" />';
}
-
+
$output .= '<br />';
if (!empty($profilelink)) {
}
$output .= '<strong>'. $fullname .'</strong>';
- $output .= print_box_end(true);
+ $output .= $OUTPUT->box_end();
if ($return) {
return $output;