From: nicolasconnault Date: Mon, 10 Aug 2009 05:49:45 +0000 (+0000) Subject: MDL-19823 Converted print_box* to $OUTPUT->box* X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=456d32fd29d1f0803345b2e56f39f86889ec664c;p=moodle.git MDL-19823 Converted print_box* to $OUTPUT->box* --- diff --git a/tag/index.php b/tag/index.php index 334ae57bac..9ff6e0c546 100644 --- a/tag/index.php +++ b/tag/index.php @@ -79,7 +79,7 @@ require_once($CFG->dirroot.'/tag/coursetagslib.php'); 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 ""; @@ -89,7 +89,7 @@ if ($courses = coursetag_get_tagged_courses($tag->id)) { print_course($course); } - print_box_end(); + echo $OUTPUT->box_end(); } // Print up to 10 previous blogs entries @@ -102,7 +102,7 @@ if (has_capability('moodle/blog:view', $systemcontext)) { // You have to see bl $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 ""; echo $OUTPUT->heading($heading, 3); @@ -129,7 +129,7 @@ if (has_capability('moodle/blog:view', $systemcontext)) { // You have to see bl echo '

'.get_string('seeallblogs', 'tag', $tagname).'

'; - print_box_end(); + echo $OUTPUT->box_end(); } } @@ -137,7 +137,7 @@ $usercount = tag_record_count('user', $tag->id); 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 ""; @@ -148,7 +148,7 @@ if ($usercount > 0) { $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(); diff --git a/tag/locallib.php b/tag/locallib.php index ac58e3b9c9..f7892c741b 100644 --- a/tag/locallib.php +++ b/tag/locallib.php @@ -19,7 +19,7 @@ require_once('lib.php'); */ 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 @@ -69,7 +69,7 @@ function tag_print_cloud($nr_of_tags=150, $return=false) { } /** - * 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(). */ @@ -99,7 +99,7 @@ function tag_cloud_sort($a, $b) { */ 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 @@ -110,7 +110,7 @@ function tag_print_description_box($tag_object, $return=false) { $output = ''; if ($content) { - $output .= print_box_start('generalbox', 'tag-description', true); + $output .= $OUTPUT->box_start('generalbox', 'tag-description'); } if (!empty($tag_object->description)) { @@ -132,7 +132,7 @@ function tag_print_description_box($tag_object, $return=false) { } if ($content) { - $output .= print_box_end(true); + $output .= $OUTPUT->box_end(); } if ($return) { @@ -150,16 +150,16 @@ function tag_print_description_box($tag_object, $return=false) { */ 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[] = ''. get_string('removetagfrommyinterests', 'tag', $tagname) .''; @@ -171,13 +171,13 @@ function tag_print_management_box($tag_object, $return=false) { $links[] = ''. get_string('flagasinappropriate', 'tag', rawurlencode($tagname)) .''; // 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[] = ''. get_string('edittag', 'tag') .''; } $output .= implode(' | ', $links); - $output .= print_box_end(true); + $output .= $OUTPUT->box_end(); } if ($return) { @@ -193,16 +193,16 @@ function tag_print_management_box($tag_object, $return=false) { * @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 .= '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; $output .= '
'; - $output .= print_box_end(true); + $output .= $OUTPUT->box_end(); if ($return) { return $output; @@ -248,7 +248,7 @@ function tag_print_search_results($query, $page, $perpage, $return=false) { //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; @@ -273,7 +273,7 @@ function tag_print_search_results($query, $page, $perpage, $return=false) { //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'); } } @@ -316,7 +316,7 @@ function tag_print_tagged_users_table($tag_object, $limitfrom='' , $limitnum='', * @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); @@ -326,7 +326,7 @@ function tag_print_user_box($user, $return=false) { $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 = ''; @@ -341,7 +341,7 @@ function tag_print_user_box($user, $return=false) { } else { $output .= ''. $alt .''; } - + $output .= '
'; if (!empty($profilelink)) { @@ -354,7 +354,7 @@ function tag_print_user_box($user, $return=false) { } $output .= ''. $fullname .''; - $output .= print_box_end(true); + $output .= $OUTPUT->box_end(); if ($return) { return $output; diff --git a/tag/search.php b/tag/search.php index a7b0e8019d..a509676ac8 100644 --- a/tag/search.php +++ b/tag/search.php @@ -50,9 +50,9 @@ if(!empty($query)) { echo '

'; -print_box_start('generalbox', 'big-tag-cloud-box'); +echo $OUTPUT->box_start('generalbox', 'big-tag-cloud-box'); tag_print_cloud(150); -print_box_end(); +echo $OUTPUT->box_end(); echo $OUTPUT->footer();