$max = $boundary - 0.01;
}
-$table = new object();
+$table = new html_table();
$table->head = array(get_string('max', 'grades'), get_string('min', 'grades'), get_string('letter', 'grades'));
$table->size = array('30%', '30%', '40%');
$table->align = array('left', 'left', 'left');
$table->width = '30%';
$table->data = $data;
-print_table($table);
+echo $OUTPUT->table($table);
echo $OUTPUT->footer();
}
if (!grade_scale::fetch_all_local($courseid) && !grade_scale::fetch_all_global()) {
- notice_yesno(get_string('noscales', 'grades'), $CFG->wwwroot.'/grade/edit/scale/edit.php?courseid='.$courseid, $returnurl);
+ echo $OUTPUT->confirm(get_string('noscales', 'grades'), $CFG->wwwroot.'/grade/edit/scale/edit.php?courseid='.$courseid, $returnurl);
echo $OUTPUT->footer();
die();
}
if ($error) {
echo $OUTPUT->box_start('generalbox importoutcomenofile');
echo get_string('importoutcomenofile', 'grades', $line);
- echo print_single_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get', '_self', true);
+ echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get'));
echo $OUTPUT->box_end();
$fatal_error = true;
break;
if ( count($csv_data) != count($file_headers) ) {
echo $OUTPUT->box_start('generalbox importoutcomenofile');
echo get_string('importoutcomenofile', 'grades', $line);
- echo print_single_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get', '_self', true);
+ echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get'));
echo $OUTPUT->box_end();
$fatal_error = true;
//echo $OUTPUT->box(var_export($csv_data, true) ."<br />". var_export($header, true));
if ($csv_data[$imported_headers[$header]] == '') {
echo $OUTPUT->box_start('generalbox importoutcomenofile');
echo get_string('importoutcomenofile', 'grades', $line);
- echo print_single_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get', '_self', true);
+ echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get'));
echo $OUTPUT->box_end();
$fatal_error = true;
break;
if(!$deleteconfirmed){
print_header(get_string('outcomedelete', 'grades'));
- notice_yesno(get_string('outcomeconfirmdelete', 'grades', $outcome->fullname),
- "index.php?id={$courseid}", "index.php?id={$courseid}",
- array('outcomeid' => $outcome->id,
- 'action'=> 'delete',
- 'sesskey' => sesskey(),
- 'deleteconfirmed'=> 1)
- );
+ $confirmurl = new moodle_url('index.php', array(
+ 'id' => $courseid, 'outcomeid' => $outcome->id,
+ 'action'=> 'delete',
+ 'sesskey' => sesskey(),
+ 'deleteconfirmed'=> 1));
+
+ echo $OUTPUT->confirm(get_string('outcomeconfirmdelete', 'grades', $outcome->fullname), $confirmurl, "index.php?id={$courseid}");
echo $OUTPUT->footer();
die;
}else{
$data[] = $line;
}
- $table = new object();
+ $table = new html_table();
$table->head = array($strfullname, $strshortname, $strscale, $stritems, $stredit);
$table->size = array('30%', '20%', '20%', '20%', '10%' );
$table->align = array('left', 'left', 'left', 'center', 'center');
$table->width = '90%';
$table->data = $data;
- $return .= print_table($table, true);
+ $return .= $OUTPUT->table($table);
$outcomes_tables[] = $return;
}
$data[] = $line;
}
- $table = new object();
+ $table = new html_table();
$table->head = array($strfullname, $strshortname, $strscale, $strcourses, $stritems, $stredit);
$table->size = array('30%', '20%', '20%', '10%', '10%', '10%');
$table->align = array('left', 'left', 'left', 'center', 'center', 'center');
$table->width = '90%';
$table->data = $data;
- $return .= print_table($table, true);
+ $return .= $OUTPUT->table($table);
$outcomes_tables[] = $return;
}
print($table);
}
-echo '<div class="buttons">';
-print_single_button('edit.php', array('courseid'=>$courseid), $strcreatenewoutcome);
+echo $OUTPUT->container_start('buttons');
+echo $OUTPUT->button(html_form::make_button('edit.php', array('courseid'=>$courseid), $strcreatenewoutcome));
if ( !empty($outcomes_tables) ) {
- print_single_button('export.php', array('id'=>$courseid, 'sesskey'=>sesskey()), get_string('exportalloutcomes', 'grades'));
+ echo $OUTPUT->button(html_form::make_button('export.php', array('id'=>$courseid, 'sesskey'=>sesskey()), get_string('exportalloutcomes', 'grades')));
}
-echo '</div>';
+echo $OUTPUT->container_end();
$upload_form->display();
admin_externalpage_print_header();
}
-$table = new stdClass();
-$table2 = new stdClass();
+$table = new html_table();
+$table2 = new html_table();
$heading = '';
if ($courseid and $scales = grade_scale::fetch_all_local($courseid)) {
}
echo $OUTPUT->heading($strcustomscales, 3, 'main');
-print_table($table);
+echo $OUTPUT->table($table);
echo $OUTPUT->heading($strstandardscale, 3, 'main');
-print_table($table2);
-echo '<div class="buttons">';
-print_single_button('edit.php', array('courseid'=>$courseid), $srtcreatenewscale);
-echo '</div>';
-
+echo $OUTPUT->table($table2);
+echo $OUTPUT->container_start('buttons');
+echo $OUTPUT->button(html_form::make_button('edit.php', array('courseid'=>$courseid), $srtcreatenewscale));
+echo $OUTPUT->container_end();
echo $OUTPUT->footer();
$strdeletecheckfull = get_string('deletecheck', '', $object->get_name());
$optionsyes = array('eid'=>$eid, 'confirm'=>1, 'sesskey'=>sesskey(), 'id'=>$course->id, 'action'=>'delete');
$optionsno = array('id'=>$course->id);
- notice_yesno($strdeletecheckfull, 'index.php', 'index.php', $optionsyes, $optionsno, 'post', 'get');
+ $formcontinue = html_form::make_button('index.php', $optionsyes, get_string('yes'));
+ $formcancel = html_form::make_button('index.php', $optionsno, get_string('no'), 'get');
+ echo $OUTPUT->confirm($strdeletecheckfull, $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
}
echo $OUTPUT->box_end();
// Print action buttons
-echo '<div class="buttons">';
+echo $OUTPUT->container_start('buttons');
if ($moving) {
- print_single_button('index.php', array('id'=>$course->id), get_string('cancel'), 'get');
+ echo $OUTPUT->button(html_form::make_button('index.php', array('id'=>$course->id), get_string('cancel'), 'get'));
} else {
- print_single_button('category.php', array('courseid'=>$course->id), get_string('addcategory', 'grades'), 'get');
- print_single_button('item.php', array('courseid'=>$course->id), get_string('additem', 'grades'), 'get');
+ echo $OUTPUT->button(html_form::make_button('category.php', array('courseid'=>$course->id), get_string('addcategory', 'grades'), 'get'));
+ echo $OUTPUT->button(html_form::make_button('item.php', array('courseid'=>$course->id), get_string('additem', 'grades'), 'get'));
if (!empty($CFG->enableoutcomes)) {
- print_single_button('outcomeitem.php', array('courseid'=>$course->id), get_string('addoutcomeitem', 'grades'), 'get');
+ echo $OUTPUT->button(html_form::make_button('outcomeitem.php', array('courseid'=>$course->id), get_string('addoutcomeitem', 'grades'), 'get'));
}
//print_single_button('index.php', array('id'=>$course->id, 'action'=>'autosort'), get_string('autosort', 'grades'), 'get');
}
-echo '</div>';
+echo $OUTPUT->container_end();
echo $OUTPUT->footer();
print_grade_page_head($courseid, 'edittree', null, $heading);
if (!grade_outcome::fetch_all_available($COURSE->id)) {
- notice_yesno(get_string('nooutcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/course.php?id='.$courseid, $returnurl);
+ echo $OUTPUT->confirm(get_string('nooutcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/course.php?id='.$courseid, $returnurl);
echo $OUTPUT->footer();
die();
}
print_header(get_string('deleteselectedkey'), get_string('deleteselectedkey'));
$optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('id'=>$courseid);
- notice_yesno(get_string('deletekeyconfirm', 'userkey', $key->value), 'key.php', 'keymanager.php', $optionsyes, $optionsno, 'get', 'get');
+ $formcontinue = html_form::make_button('key.php', $optionsyes, get_string('yes'), 'get');
+ $formcancel = html_form::make_button('keymanager.php', $optionsno, get_string('no'), 'get');
+ echo $OUTPUT->confirm(get_string('deletekeyconfirm', 'userkey', $key->value), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
$data[] = $line;
}
}
+$table = new html_table();
$table->head = array(get_string('keyvalue', 'userkey'), get_string('keyiprestriction', 'userkey'), get_string('keyvaliduntil', 'userkey'), $stredit);
$table->size = array('50%', '30%', '10%', '10%');
$table->align = array('left', 'left', 'left', 'center');
$table->width = '90%';
$table->data = $data;
-print_table($table);
+echo $OUTPUT->table($table);
-echo '<div class="buttons">';
-print_single_button('key.php', array('courseid'=>$course->id), get_string('newuserkey', 'userkey'));
-echo '</div>';
+echo $OUTPUT->container_start('buttons');
+echo $OUTPUT->button(html_form::make_button('key.php', array('courseid'=>$course->id), get_string('newuserkey', 'userkey')));
+echo $OUTPUT->container_end();
echo $OUTPUT->footer();
?>
public function print_continue() {
global $CFG, $OUTPUT;
- $params = $this->get_export_params();
-
+ $params = $this->get_export_params();
echo $OUTPUT->heading(get_string('export', 'grades'));
- echo '<div class="gradeexportlink">';
+ echo $OUTPUT->container_start('gradeexportlink');
+
if (!$this->userkey) { // this button should trigger a download prompt
- print_single_button($CFG->wwwroot.'/grade/export/'.$this->plugin.'/export.php',
- $params, get_string('download', 'admin'));
+ echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/grade/export/'.$this->plugin.'/export.php',
+ $params, get_string('download', 'admin')));
} else {
$paramstr = '';
$sep = '?';
foreach($params as $name=>$value) {
$paramstr .= $sep.$name.'='.$value;
- $sep = '&';
+ $sep = '&';
}
- $link = $CFG->wwwroot.'/grade/export/'.$this->plugin.'/dump.php'.$paramstr.'&key='.$this->userkey;
+ $link = $CFG->wwwroot.'/grade/export/'.$this->plugin.'/dump.php'.$paramstr.'&key='.$this->userkey;
- echo get_string('download', 'admin').': <a href="'.$link.'">'.$link.'</a>';
+ echo get_string('download', 'admin').': ' . $OUTPUT->link(html_link::make($link, $link));
}
- echo '</div>';
+ echo $OUTPUT->container_end();
}
}
print_header(get_string('deleteselectedkey'), get_string('deleteselectedkey'));
$optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('id'=>$courseid);
- notice_yesno(get_string('deletekeyconfirm', 'userkey', $key->value), 'key.php', 'keymanager.php', $optionsyes, $optionsno, 'get', 'get');
+ $formcontinue = html_form::make_button('key.php', $optionsyes, get_string('yes'), 'get');
+ $formcancel = html_form::make_button('keymanager.php', $optionsno, get_string('no'), 'get');
+ echo $OUTPUT->confirm(get_string('deletekeyconfirm', 'userkey', $key->value), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
$data[] = $line;
}
}
+$table = new html_table();
$table->head = array(get_string('keyvalue', 'userkey'), get_string('keyiprestriction', 'userkey'), get_string('keyvaliduntil', 'userkey'), $stredit);
$table->size = array('50%', '30%', '10%', '10%');
$table->align = array('left', 'left', 'left', 'center');
$table->width = '90%';
$table->data = $data;
-print_table($table);
+echo $OUTPUT->table($table);
-echo '<div class="buttons">';
-print_single_button('key.php', array('courseid'=>$course->id), get_string('newuserkey', 'userkey'));
-echo '</div>';
+echo $OUTPUT->container_start('buttons');
+echo $OUTPUT->button(html_form::make_button('key.php', array('courseid'=>$course->id), get_string('newuserkey', 'userkey')));
+echo $OUTPUT->container_end();
echo $OUTPUT->footer();
?>
* @return string
*/
function get_studentrowhtml($user) {
- global $CFG, $USER;
+ global $CFG, $USER, $OUTPUT;
$showuserimage = $this->get_pref('showuserimage');
$showuseridnumber = $this->get_pref('showuseridnumber');
$fixedstudents = empty($USER->screenreader) && $this->get_pref('fixedstudents');
// Student name and link
$user_pic = null;
if ($showuserimage) {
- $user_pic = '<div class="userpic">' . print_user_picture($user, $this->courseid, true, 0, true) . '</div>';
+ $user_pic = '<div class="userpic">' . $OUTPUT->user_picture(moodle_user_picture::make($user, $this->courseid)) . '</div>';
}
$studentrowhtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">'
$string = get_string('turneditingon');
}
- $buttons = print_single_button('index.php', $options, $string, 'get', '_self', true);
+ $buttons = $OUTPUT->button(html_form::make_button('index.php', $options, $string, 'get'));
} else {
$USER->gradeediting[$course->id] = 0;
// Student name and link
$user_pic = null;
if ($showuserimage) {
- $user_pic = '<div class="userpic">' . print_user_picture($user, $this->courseid, null, 0, true) . '</div>';
+ $user_pic = '<div class="userpic">' . $OUTPUT->user_picture(moodle_user_picture::make($user, $this->courseid)) . '</div>';
}
$studentshtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">'
$user_pic = null;
if ($showuserimage) {
- $user_pic = '<div class="userpic">' . print_user_picture($user, $this->courseid, NULL, 0, true) . "</div>\n";
+ $user_pic = '<div class="userpic">' . $OUTPUT->user_picture(moodle_user_picture::make($user, $this->courseid)) . "</div>\n";
}
$studentshtml .= '<tr class="r'.$this->rowcount++ . $row_classes[$this->rowcount % 2] . '">'
return true;
}
-
+
/**
* Returns whether or not to display fixed students column.
* Includes a browser check, because IE6 doesn't support the scrollbar.
*/
public function is_fixed_students() {
global $USER, $CFG;
- return empty($USER->screenreader) && $CFG->grade_report_fixedstudents &&
- (check_browser_version('MSIE', '7.0') ||
+ return empty($USER->screenreader) && $CFG->grade_report_fixedstudents &&
+ (check_browser_version('MSIE', '7.0') ||
check_browser_version('Firefox', '2.0') ||
check_browser_version('Gecko', '2006010100') ||
check_browser_version('Camino', '1.0') ||
check_browser_version('Opera', '6.0') ||
- check_browser_version('Safari', '2.0'));
+ check_browser_version('Safari', '2.0'));
}
}
?>