]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19806 upgraded calls to print_table, print_single_button, print_user_picture...
authornicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:43:34 +0000 (08:43 +0000)
committernicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:43:34 +0000 (08:43 +0000)
mod/data/comment.php
mod/data/field.php
mod/data/index.php
mod/data/lib.php
mod/data/preset.php
mod/data/report.php
mod/data/view.php

index e211cbde5ce0da311f556b5f0b152e5a2422bc1c..1d65c6d2cfc9a17384cf86acb355f878673a6099 100755 (executable)
                 print_header();
                 data_print_comment($data, $comment, $page);
 
-                notice_yesno(get_string('deletecomment','data'),
-                  'comment.php?rid='.$record->id.'&amp;commentid='.$comment->id.'&amp;page='.$page.
-                              '&amp;sesskey='.sesskey().'&amp;mode=delete&amp;confirm=1',
-                  'view.php?rid='.$record->id.'&amp;page='.$page);
+                echo $OUTPUT->confirm(get_string('deletecomment','data'),
+                        'comment.php?rid='.$record->id.'&commentid='.$comment->id.'&page='.$page.'&mode=delete&confirm=1',
+                        'view.php?rid='.$record->id.'&page='.$page);
                 echo $OUTPUT->footer();
             }
             die;
index c42e9d989452465ffef7215d90ae00813d096c9a..0878ff474edcb5d85ce9ea218a88b4c48b16f617 100755 (executable)
                     // Print confirmation message.
                     $field = data_get_field_from_id($fid, $data);
 
-                    notice_yesno('<strong>'.$field->name().': '.$field->field->name.'</strong><br /><br />'. get_string('confirmdeletefield','data'),
-                                 'field.php?d='.$data->id.'&amp;mode=delete&amp;fid='.$fid.'&amp;sesskey='.sesskey().'&amp;confirm=1',
+                    echo $OUTPUT->confirm('<strong>'.$field->name().': '.$field->field->name.'</strong><br /><br />'. get_string('confirmdeletefield','data'),
+                                 'field.php?d='.$data->id.'&mode=delete&fid='.$fid.'&confirm=1',
                                  'field.php?d='.$data->id);
 
                     echo $OUTPUT->footer();
 
         } else {    //else print quiz style list of fields
 
+            $table = new html_table();
             $table->head = array(get_string('fieldname','data'), get_string('type','data'), get_string('fielddescription', 'data'), get_string('action','data'));
             $table->align = array('left','left','left', 'center');
             $table->wrap = array(false,false,false,false);
                     );
                 }
             }
-            print_table($table);
+            echo $OUTPUT->table($table);
         }
 
 
index 399f79624bb7d95f805b9e95a9cc5bc1d503f11a..12c4b8ae824fa3cfe53bb233f1d00db497d20518 100755 (executable)
@@ -61,6 +61,8 @@
     $strentries = get_string('entries', 'data');
     $strnumnotapproved = get_string('numnotapproved', 'data');
 
+    $table = new html_table();
+
     if ($course->format == 'weeks') {
         $table->head  = array ($strweek, $strname, $strdescription, $strentries, $strnumnotapproved);
         $table->align = array ('center', 'center', 'center', 'center', 'center');
     }
 
     echo "<br />";
-    print_table($table);
+    echo $OUTPUT->table($table);
     echo $OUTPUT->footer();
 
 ?>
index 6a674619beaee0bb569ddcbd23231befecd37003..49568f5e0ec45ef2d0a32fa29ed3d2270c3e26f9 100755 (executable)
@@ -1505,7 +1505,7 @@ function data_print_ratings($data, $record) {
 
             if ($data->scale < 0) {
                 if ($scale = $DB->get_record('scale', array('id'=>abs($data->scale)))) {
-                    echo $OUTPUT->help_button(helpbutton::make_scale_menu($data->course, $scale));
+                    echo $OUTPUT->help_button(moodle_help_icon::make_scale_menu($data->course, $scale));
                 }
             }
 
@@ -1699,7 +1699,7 @@ function data_print_comments($data, $record, $page=0, $mform=false) {
  * @return void Output is echo'd
  */
 function data_print_comment($data, $comment, $page=0) {
-    global $USER, $CFG, $DB;
+    global $USER, $CFG, $DB, $OUTPUT;
 
     $cm = get_coursemodule_from_instance('data', $data->id);
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
@@ -1712,7 +1712,7 @@ function data_print_comment($data, $comment, $page=0) {
     echo '<table cellspacing="0" align="center" width="50%" class="datacomment forumpost">';
 
     echo '<tr class="header"><td class="picture left">';
-    print_user_picture($user, $data->course, $user->picture);
+    echo $OUTPUT->user_picture(moodle_user_picture::make($user, $data->course));
     echo '</td>';
 
     echo '<td class="topic starter" align="left"><div class="author">';
index 046ee51e579fa84b9fc15278cd63dec697d8a9dd..da735ec359a9f01db06d09f6652e06769016f10f 100644 (file)
@@ -91,15 +91,12 @@ switch ($action) {
         $strwarning = get_string('deletewarning', 'data').'<br />'.
                       data_preset_name($shortname, $path);
 
-        $options = new object();
-        $options->fullname = $userid.'/'.$shortname;
-        $options->action   = 'delete';
-        $options->d        = $data->id;
-        $options->sesskey  = sesskey();
-
-        $optionsno = new object();
-        $optionsno->d = $data->id;
-        notice_yesno($strwarning, 'preset.php', 'preset.php', $options, $optionsno, 'post', 'get');
+        $optionsyes = array('fullname' => $userid.'/'.$shortname,
+                         'action' => 'delete',
+                         'd' => $data->id);
+                         
+        $optionsno = array('d' => $data->id);
+        echo $OUTPUT->confirm($strwarning, new moodle_url('preset.php', $optionsyes), new moodle_url('preset.php', $optionsno));
         echo $OUTPUT->footer();
         exit(0);
         break;
@@ -302,7 +299,7 @@ $options = new object();
 $options->action = 'export';
 $options->d = $data->id;
 $options->sesskey = sesskey();
-print_single_button('preset.php', $options, $strexport, 'post');
+echo $OUTPUT->button(html_form::make_button('preset.php', $options, $strexport));
 echo '</td></tr>';
 
 echo '<tr><td><label>'.$strsaveaspreset.'</label>';
@@ -312,7 +309,7 @@ $options = new object();
 $options->action = 'save1';
 $options->d = $data->id;
 $options->sesskey = sesskey();
-print_single_button('preset.php', $options, $strsave, 'post');
+echo $OUTPUT->button(html_form::make_button('preset.php', $options, $strsave));
 echo '</td></tr>';
 echo '<tr><td valign="top" colspan="2" align="center"><h3>'.$strimport.'</h3></td></tr>';
 echo '<tr><td><label for="fromfile">'.$strfromfile.'</label>';
index a255b9e93e4d49aaf9ad3ac32a5864038d5d10aa..8ff382b4a639bf7bbee66bf55c0f7e64daf6ed17 100755 (executable)
                 echo '<tr class="forumpostheader">';
             }
             echo '<td class="picture">';
-            print_user_picture($rating->id, $data->course, $rating->picture, false, false, true);
+            $userpic = moodle_user_picture::make($rating, $data->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='.$data->course.'">'.fullname($rating).'</a></td>';
+            echo '<td class="author">' . $OUTPUT->link($CFG->wwwroot.'/user/view.php?id='.$rating->id.'&course='.$data->course, fullname($rating)) . '</td>';
             echo '<td style="white-space:nowrap" align="center" class="rating">'.$scalemenu[$rating->rating].'</td>';
             echo "</tr>\n";
         }
index 1c2db455cd96b50bd7d368216d70e02bea160139..09dbdfb20dd92e87b42060517a194d22542eccd4 100755 (executable)
         } else {   // Print a confirmation page
             if ($deleterecord = $DB->get_record('data_records', array('id'=>$delete))) {   // Need to check this is valid
                 if ($deleterecord->dataid == $data->id) {                       // Must be from this database
-                    notice_yesno(get_string('confirmdeleterecord','data'),
-                            'view.php?d='.$data->id.'&amp;delete='.$delete.'&amp;confirm=1&amp;sesskey='.sesskey(),
+                    echo $OUTPUT->confirm(get_string('confirmdeleterecord','data'),
+                            'view.php?d='.$data->id.'&delete='.$delete.'&confirm=1',
                             'view.php?d='.$data->id);
 
                     $records[] = $deleterecord;