]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19823 Converted print_box* to $OUTPUT->box*
authornicolasconnault <nicolasconnault>
Mon, 10 Aug 2009 05:49:45 +0000 (05:49 +0000)
committernicolasconnault <nicolasconnault>
Mon, 10 Aug 2009 05:49:45 +0000 (05:49 +0000)
tag/index.php
tag/locallib.php
tag/search.php

index 334ae57bac1d3c58d59b401aec846130b6ad20e8..9ff6e0c5469a20a3bc530ed3480ae0329651652b 100644 (file)
@@ -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 "<a name='course'></a>";
@@ -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 "<a name='blog'></a>";
         echo $OUTPUT->heading($heading, 3);
@@ -129,7 +129,7 @@ if (has_capability('moodle/blog:view', $systemcontext)) {  // You have to see bl
 
         echo '<p class="moreblogs"><a href="'.$CFG->wwwroot.'/blog/index.php?filtertype=site&amp;filterselect=0&amp;tagid='.$tag->id.'">'.get_string('seeallblogs', 'tag', $tagname).'</a></p>';
 
-        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 "<a name='user'></a>";
@@ -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();
index ac58e3b9c9c8bf1f59f8883ad12be3a6a757e2d8..f7892c741bcdec8322ae631a20ca3bf649ff0a4b 100644 (file)
@@ -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[] = '<a href="'. $CFG->wwwroot .'/tag/user.php?action=removeinterest&amp;sesskey='. sesskey() .'&amp;tag='. rawurlencode($tag_object->name) .'">'. get_string('removetagfrommyinterests', 'tag', $tagname) .'</a>';
@@ -171,13 +171,13 @@ function tag_print_management_box($tag_object, $return=false) {
         $links[] = '<a href="'. $CFG->wwwroot .'/tag/user.php?action=flaginappropriate&amp;sesskey='. sesskey() .'&amp;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) {
@@ -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 .= '<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;
@@ -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 .= '<img alt="'. $alt .'" class="user-image" src="'. $CFG->wwwroot .'/pix/u/f1.png" />';
     }
-    
+
     $output .= '<br />';
 
     if (!empty($profilelink)) {
@@ -354,7 +354,7 @@ function tag_print_user_box($user, $return=false) {
     }
 
     $output .= '<strong>'. $fullname .'</strong>';
-    $output .= print_box_end(true);
+    $output .= $OUTPUT->box_end();
 
     if ($return) {
         return $output;
index a7b0e8019da94a46f55516e5b99d36198ebfc6bb..a509676ac864e122dc8df9b55c55b090fac28474 100644 (file)
@@ -50,9 +50,9 @@ if(!empty($query)) {
 
 echo '<br/><br/>';
 
-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();