MDL-19806 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno

This commit is contained in:
nicolasconnault 2009-08-20 08:43:34 +00:00
parent d3fd549372
commit cd6137d707
7 changed files with 27 additions and 26 deletions

View File

@ -113,10 +113,9 @@
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;

View File

@ -184,8 +184,8 @@
// 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();
@ -246,6 +246,7 @@
} 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);
@ -273,7 +274,7 @@
);
}
}
print_table($table);
echo $OUTPUT->table($table);
}

View File

@ -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');
@ -137,7 +139,7 @@
}
echo "<br />";
print_table($table);
echo $OUTPUT->table($table);
echo $OUTPUT->footer();
?>

View File

@ -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">';

View 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>';

View File

@ -66,9 +66,11 @@
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";
}

View File

@ -338,8 +338,8 @@
} 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;