]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19809 upgraded calls to print_table, print_single_button, print_user_picture...
authornicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:44:52 +0000 (08:44 +0000)
committernicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:44:52 +0000 (08:44 +0000)
mod/glossary/comment.php
mod/glossary/deleteentry.php
mod/glossary/editcategories.php
mod/glossary/exportentry.php
mod/glossary/formats/TEMPLATE/TEMPLATE_format.php
mod/glossary/formats/encyclopedia/encyclopedia_format.php
mod/glossary/formats/fullwithauthor/fullwithauthor_format.php
mod/glossary/index.php
mod/glossary/lib.php
mod/glossary/report.php
mod/glossary/view.php

index c917e3eef94304add708cec2d02e515af4a288b8..98fadf09085de40a7394267404046e824e59ae1d 100644 (file)
@@ -134,7 +134,7 @@ function glossary_comment_delete() {
 
         glossary_comment_print_header($course, $cm, $glossary, $entry, 'delete');
         glossary_print_comment($course, $cm, $glossary, $entry, $comment);
-        notice_yesno($strdeletewarning, $linkyes, $linkno, $optionsyes, $optionsno, 'post', 'get');
+        echo $OUTPUT->confirm($strdeletewarning, new moodle_url($linkyes, $optionsyes), new moodle_url($linkno, $optionsno));
         echo $OUTPUT->footer();
         die;
     }
index 6cf14a6b66ad3c7a089834b903cbbbbbcbe66db0..6a61cd21fab3e6757ab95571560118f04a593f43 100644 (file)
         $optionsyes = array('id'=>$cm->id, 'entry'=>$entry->id, 'confirm'=>1, 'sesskey'=>sesskey(), 'prevmode'=>$prevmode, 'hook'=>$hook);
         $optionsno  = array('id'=>$cm->id, 'mode'=>$prevmode, 'hook'=>$hook);
 
-        notice_yesno($areyousure, $linkyes, $linkno, $optionsyes, $optionsno, 'post', 'get');
+        echo $OUTPUT->confirm($areyousure, new moodle_url($linkyes, $optionsyes), new moodle_url($linkno, $optionsno));
 
         echo $OUTPUT->footer();
     }
index 6f8e56ffbbfeefc3a6d0c115d1b08847496b176f..4c63875c5db78b235d6e3349154ae38052a10a2b 100644 (file)
 <?php
                 unset($options);
                 $options = array ("id" => $id);
-                print_single_button("editcategories.php", $options, get_string("no") );
+                echo $OUTPUT->button(html_form::make_button("editcategories.php", $options, get_string("no")));
                 echo "</td></tr></table>";
                 echo "</div>";
                 echo $OUTPUT->box_end();
              $options['action'] = "add";
 
              echo "<table border=\"0\"><tr><td align=\"right\">";
-             echo print_single_button("editcategories.php", $options, get_string("add") . " " . get_string("category","glossary"), "get");
+             echo $OUTPUT->button(html_form::make_button("editcategories.php", $options, get_string("add") . " " . get_string("category","glossary")));
              echo "</td><td align=\"left\">";
              unset($options['action']);
              $options['mode'] = 'cat';
              $options['hook'] = $hook;
-             echo print_single_button("view.php", $options, get_string("back","glossary") );
+             echo $OUTPUT->button(html_form::make_button("view.php", $options, get_string("back","glossary")));
              echo "</td></tr>";
              echo "</table>";
 
index 6b436340e4dd0ce757aec94578e2d5c1916805e0..20e4d145a6253c8cfed0a623451f924b32ff485d 100644 (file)
@@ -80,7 +80,7 @@
         $optionsyes = array('id'=>$entry->id, 'confirm'=>1, 'sesskey'=>sesskey(), 'prevmode'=>$prevmode, 'hook'=>$hook);
         $optionsno  = array('id'=>$cm->id, 'mode'=>$prevmode, 'hook'=>$hook);
 
-        notice_yesno($areyousure, $linkyes, $linkno, $optionsyes, $optionsno, 'post', 'get');
+        echo $OUTPUT->confirm($areyousure, new moodle_url($linkyes, $optionsyes), new moodle_url($linkno, $optionsno));
         echo '</div>';
         echo $OUTPUT->footer();
         die;
index 4ffa8d102080bff6570f983e5d96221513c66db3..683f482e062f03bdb3ff5487295493aeb6c4468f 100755 (executable)
@@ -1,7 +1,7 @@
 <?php  // $Id$
 
 function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='', $hook='', $printicons=1, $ratings=NULL, $aliases=true) {
-    global $CFG, $USER, $DB;
+    global $CFG, $USER, $DB, $OUTPUT;
     
 
     $user = $DB->get_record('user', array('id'=>$entry->userid));
@@ -15,7 +15,7 @@ function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='',
 
         //Use this function to show author's image
         //Comments: Configuration not supported
-        print_user_picture($user, $course->id, $user->picture);
+        echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
 
         //Line separator to show this template fine. :-)
         echo '<br />';
index f96e4e9171edf2552e1c2c5498318d83e10c8371..0fa353312033b1f107b4e04440babd27d9c015e3 100644 (file)
@@ -1,7 +1,7 @@
 <?php  // $Id$
 
 function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode='',$hook='',$printicons=1,$ratings=NULL, $aliases=true) {
-    global $CFG, $USER, $DB;
+    global $CFG, $USER, $DB, $OUTPUT;
 
 
     $user = $DB->get_record('user', array('id'=>$entry->userid));
@@ -13,7 +13,7 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode
         echo '<tr valign="top">';
         echo '<td class="left picture">';
         
-        print_user_picture($user, $course->id, $user->picture);
+        echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
     
         echo '</td>';
         echo '<th class="entryheader">';
index fff7d40b06349633e4d22504f52bc5594db98ec0..33a8c09effaf7bb2d2d97db8ff5cf56c284a6f66 100644 (file)
@@ -1,7 +1,7 @@
 <?php  // $Id$
 
 function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mode="", $hook="", $printicons=1, $ratings=NULL, $aliases=true) {
-    global $CFG, $USER, $DB;
+    global $CFG, $USER, $DB, $OUTPUT;
 
 
     $user = $DB->get_record('user', array('id'=>$entry->userid));
@@ -13,7 +13,7 @@ function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mo
         echo '<tr valign="top">';
         
         echo '<td class="picture">';
-        print_user_picture($user, $course->id, $user->picture);
+        echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
         echo '</td>';
         
         echo '<th class="entryheader">';
index 7a59cd719324a5b7d0d75dac698131b82ff80b6b..2a2be4e195543243ab7df421a483dd2b524f9bcb 100644 (file)
@@ -49,6 +49,8 @@
     $strtopic  = get_string("topic");
     $strentries  = get_string("entries", "glossary");
 
+    $table = new html_table();
+
     if ($course->format == "weeks") {
         $table->head  = array ($strweek, $strname, $strentries);
         $table->align = array ("CENTER", "LEFT", "CENTER");
 
     echo "<br />";
 
-    print_table($table);
+    echo $OUTPUT->table($table);
 
 /// Finish the page
 
index b2e6986cf709f7f3b1c8563f34d317cd9db2f777..66830765db86321d7c2e0896cb88ecd309160b4e 100644 (file)
@@ -1478,7 +1478,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
              $options['id'] = $cm->id;
              $options['mode'] = 'cat';
              $options['hook'] = $hook;
-             echo print_single_button("editcategories.php", $options, get_string("editcategories","glossary"), "get");
+             echo $OUTPUT->button(html_form::make_button("editcategories.php", $options, get_string("editcategories","glossary"), "get"));
      }
      echo '</td>';
 
@@ -1743,7 +1743,7 @@ function glossary_print_comment($course, $cm, $glossary, $entry, $comment) {
     echo '<table class="glossarycomment" cellspacing="0">';
     echo '<tr valign="top">';
     echo '<td class="left picture">';
-    print_user_picture($user, $course->id, $user->picture);
+    echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
     echo '</td>';
     echo '<td class="entryheader">';
 
index 511466b0301be142df50504a061c01f3640816c1..2dc173449a36ac041da22988e750160c1fdab422 100644 (file)
@@ -68,7 +68,9 @@
                 echo '<tr>';
             }
             echo '<td class="picture">';
-            print_user_picture($rating->id, $glossary->course, $rating->picture, false, false, true);
+            $userpic = moodle_user_picture::make($rating, $glossary->course);
+            $userpic->link = true;
+            echo $OUTPUT->user_picture($userpic);
             echo '</td>';
             echo '<td class="author"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$rating->id.'&amp;course='.$glossary->course.'">'.fullname($rating).'</a></td>';
             echo '<td style="white-space:nowrap" align="center" class="rating">'.$scalemenu[$rating->rating].'</td>';
index 885ee6f350864133f68e7adf8448e5b0bfb19ce8..b272382aae5d4b320e1bb924e5589be5085118e0 100644 (file)
                         echo '<th align="left">';
 
                         $user = $DB->get_record("user", array("id"=>$entry->userid));
-                        print_user_picture($user, $course->id, $user->picture);
+                        echo $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id));
                         $pivottoshow = fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
                     } else {
                         echo '<th >';