MDL-19815 upgraded calls to print_table, print_single_button, print_user_picture...
authornicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:46:03 +0000 (08:46 +0000)
committernicolasconnault <nicolasconnault>
Thu, 20 Aug 2009 08:46:03 +0000 (08:46 +0000)
mod/scorm/index.php
mod/scorm/report.php

index e14f23ef82d40ba6c6efb0de0e778df775f52913..3bc18e1e330b4720b2715619752e350fcb96ebe3 100755 (executable)
@@ -44,6 +44,8 @@
         exit;
     }
 
+    $table = new html_table();
+
     if ($course->format == "weeks") {
         $table->head  = array ($strweek, $strname, $strsummary, $strreport);
         $table->align = array ("center", "left", "left", "left");
@@ -94,7 +96,7 @@
 
     echo "<br />";
 
-    print_table($table);
+    echo $OUTPUT->table($table);
 
     echo $OUTPUT->footer();
 
index 2854f9321806869170b5670efc29bc32f356cbeb..c19f9cd9152559007eaab93ffce8a68898cdc819 100755 (executable)
             }
 
             if ($scousers=$DB->get_records_sql($sql, $params)) {
-                $table = new stdClass();
+                $table = new html_table();
                 $table->head = array();
                 $table->width = '100%';
                 if (has_capability('mod/scorm:deleteresponses',$contextmodule)) {
                         if (has_capability('mod/scorm:deleteresponses',$contextmodule)) {
                             $row[] = '<input type="checkbox" name="attemptid[]" value="'. $scouser->userid . ':' . $a . '" />';
                         }
-                        $row[] = print_user_picture($scouser->userid, $course->id, $userdata->picture, false, true);
+                        $userpic = moodle_user_picture::make($scouser->userid, $course->id);
+                        $userpic->image->src = $userdata->picture;
+                        $row[] = $OUTPUT->user_picture($userpic);
                         $row[] = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$scouser->userid.'&amp;course='.$course->id.'">'.
                                  fullname($userdata).'</a>';
                         $row[] = '<a href="report.php?a='.$scorm->id.'&amp;user='.$scouser->userid.'&amp;attempt='.$a.'">'.$a.'</a>';
                 if (has_capability('mod/scorm:deleteresponses',$contextmodule)) {
                     echo '<form id="attemptsform" method="post" action="'.$FULLSCRIPT.'" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \''.addslashes_js(get_string('deleteattemptcheck','quiz')).'\' : true);">';
                     echo '<input type="hidden" name="id" value="'.$id.'">';
-                    print_table($table);
+                    echo $OUTPUT->table($table);
                     echo '<a href="javascript:select_all_in(\'DIV\',null,\'scormtablecontainer\');">'.get_string('selectall', 'quiz').'</a> / ';
                     echo '<a href="javascript:deselect_all_in(\'DIV\',null,\'scormtablecontainer\');">'.get_string('selectnone', 'quiz').'</a> ';
                     echo '&nbsp;&nbsp;';
                     $PAGE->requires->js_function_call('hide_item', Array('noscriptmenuaction'));
                     echo '</form>';
                 } else {
-                    print_table($table);
+                    echo $OUTPUT->table($table);
                 }
                 echo '</div>';
             } else {
                     if (!empty($userdata)) {
                         echo $OUTPUT->box_start('generalbox boxaligncenter');
                         echo '<div class="mdl-align">'."\n";
-                        print_user_picture($user, $course->id, $userdata->picture, false, false);
+                        $userpic = moodle_user_picture::make($user, $course->id);
+                        $userpic->image->src = $userdata->picture;
+                        echo $OUTPUT->user_picture($userpic);
                         echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user&amp;course=$course->id\">".
                              "$userdata->firstname $userdata->lastname</a><br />";
                         echo get_string('attempt','scorm').': '.$attempt;
                         echo $OUTPUT->box_end();
 
                         // Print general score data
-                        $table = new stdClass();
+                        $table = new html_table();
                         $table->head = array(get_string('title','scorm'),
                                              get_string('status','scorm'),
                                              get_string('time','scorm'),
                             }
                             $table->data[] = $row;
                         }
-                        print_table($table);
+                        echo $OUTPUT->table($table);
                     }
                 }
             } else {
             //print_heading(format_string($sco->title));
             echo $OUTPUT->heading('<a href="'.$CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&amp;mode=browse&amp;scoid='.$sco->id.'" target="_new">'.format_string($sco->title).'</a>');
             echo '<div class="mdl-align">'."\n";
-            print_user_picture($user, $course->id, $userdata->picture, false, false);
+            $userpic = moodle_user_picture::make($user, $course->id);
+            $userpic->image->src = $userdata->picture;
+            echo $OUTPUT->user_picture($userpic);
             echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user&amp;course=$course->id\">".
                  "$userdata->firstname $userdata->lastname</a><br />";
             $scoreview = '';
             echo '<hr /><h2>'.get_string('details','scorm').'</h2>';
 
             // Print general score data
-            $table = new stdClass();
+            $table = new html_table();
             $table->head = array(get_string('element','scorm'), get_string('value','scorm'));
             $table->align = array('left', 'left');
             $table->wrap = array('nowrap', 'nowrap');
             }
             if ($existelements) {
                 echo '<h3>'.get_string('general','scorm').'</h3>';
-                print_table($table);
+                echo $OUTPUT->table($table);
             }
 
             // Print Interactions data
-            $table = new stdClass();
+            $table = new html_table();
             $table->head = array(get_string('identifier','scorm'),
                                  get_string('type','scorm'),
                                  get_string('result','scorm'),
             }
             if ($existinteraction) {
                 echo '<h3>'.get_string('interactions','scorm').'</h3>';
-                print_table($table);
+                echo $OUTPUT->table($table);
             }
 
             // Print Objectives data
-            $table = new stdClass();
+            $table = new html_table();
             $table->head = array(get_string('identifier','scorm'),
                                  get_string('status','scorm'),
                                  get_string('raw','scorm'),
             }
             if ($existobjective) {
                 echo '<h3>'.get_string('objectives','scorm').'</h3>';
-                print_table($table);
+                echo $OUTPUT->table($table);
             }
-            $table = new stdClass();
+            $table = new html_table();
             $table->head = array(get_string('element','scorm'), get_string('value','scorm'));
             $table->align = array('left', 'left');
             $table->wrap = array('nowrap', 'wrap');
             }
             if ($existelements) {
                 echo '<h3>'.get_string('othertracks','scorm').'</h3>';
-                print_table($table);
+                echo $OUTPUT->table($table);
             }
             echo $OUTPUT->box_end();
         } else {