print_header();
data_print_comment($data, $comment, $page);
- notice_yesno(get_string('deletecomment','data'),
- 'comment.php?rid='.$record->id.'&commentid='.$comment->id.'&page='.$page.
- '&sesskey='.sesskey().'&mode=delete&confirm=1',
- 'view.php?rid='.$record->id.'&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;
// 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.'&mode=delete&fid='.$fid.'&sesskey='.sesskey().'&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);
}
$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();
?>
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));
}
}
* @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);
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">';
$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;
$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>';
$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>';
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.'&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";
}
} 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.'&delete='.$delete.'&confirm=1&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;