admin_externalpage_print_header();
}
-$table = null;
-$table2 = null;
+$table = new stdClass();
+$table2 = new stdClass();
$heading = '';
if ($courseid and $scales = grade_scale::fetch_all_local($courseid)) {
echo $OUTPUT->heading($strgradeedit);
-print_simple_box_start("center");
+echo $OUTPUT->box_start();
// Form if in edit or add modes
$mform->display();
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo $OUTPUT->footer();
die;
}
public function get_header_cell() {
- return '<th class="header" scope="col">'.get_string('aggregation', 'grades').helpbutton('aggregation', 'aggregation', 'grade', true, false, '', true).'</th>';
+ global $OUTPUT;
+ return '<th class="header" scope="col">'.get_string('aggregation', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregation', 'aggregation', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
class grade_edit_tree_column_extracredit extends grade_edit_tree_column {
public function get_header_cell() {
- return '<th class="header" scope="col">'.get_string('extracredit', 'grades').helpbutton('aggregationcoefcombo', 'aggregationcoefcombo', 'grade', true, false, '', true).'</th>';
+ global $OUTPUT;
+ return '<th class="header" scope="col">'.get_string('extracredit', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregationcoefcombo', 'aggregationcoefcombo', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
class grade_edit_tree_column_weight extends grade_edit_tree_column {
public function get_header_cell() {
- return '<th class="header" scope="col">'.get_string('weightuc', 'grades').helpbutton('aggregationcoefweight', 'aggregationcoefweight', 'grade', true, false, '', true).'</th>';
+ global $OUTPUT;
+ return '<th class="header" scope="col">'.get_string('weightuc', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregationcoefweight', 'aggregationcoefweight', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
}
public function get_header_cell() {
+ global $OUTPUT;
return '<th class="header" style="width: 40px" scope="col">'.get_string('aggregateonlygraded', 'grades')
- .helpbutton('aggregateonlygraded', 'aggregateonlygraded', 'grade', true, false, '', true).'</th>';
+ .$OUTPUT->help_icon(moodle_help_icon::make('aggregateonlygraded', 'aggregateonlygraded', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
}
public function get_header_cell() {
+ global $OUTPUT;
return '<th class="header" style="width: 40px" scope="col">'.get_string('aggregatesubcats', 'grades')
- .helpbutton('aggregatesubcats', 'aggregatesubcats', 'grade', true, false, '', true).'</th>';
+ .$OUTPUT->help_icon(moodle_help_icon::make('aggregatesubcats', 'aggregatesubcats', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
}
public function get_header_cell() {
+ global $OUTPUT;
return '<th class="header" style="width: 40px" scope="col">'.get_string('aggregateoutcomes', 'grades')
- .helpbutton('aggregateoutcomes', 'aggregateoutcomes', 'grade', true, false, '', true).'</th>';
+ .$OUTPUT->help_icon(moodle_help_icon::make('aggregateoutcomes', 'aggregateoutcomes', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
}
public function get_header_cell() {
- return '<th class="header" scope="col">'.get_string('droplow', 'grades').helpbutton('droplow', 'droplow', 'grade', true, false, '', true).'</th>';
+ global $OUTPUT;
+ return '<th class="header" scope="col">'.get_string('droplow', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('droplow', 'droplow', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
}
public function get_header_cell() {
- return '<th class="header" scope="col">'.get_string('keephigh', 'grades').helpbutton('keephigh', 'keephigh', 'grade', true, false, '', true).'</th>';
+ global $OUTPUT;
+ return '<th class="header" scope="col">'.get_string('keephigh', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('keephigh', 'keephigh', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
}
public function get_header_cell() {
- return '<th class="header" scope="col">'.get_string('multfactor', 'grades').helpbutton('multfactor', 'multfactor', 'grade', true, false, '', true).'</th>';
+ global $OUTPUT;
+ return '<th class="header" scope="col">'.get_string('multfactor', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('multfactor', 'multfactor', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
class grade_edit_tree_column_plusfactor extends grade_edit_tree_column {
public function get_header_cell() {
- return '<th class="header" scope="col">'.get_string('plusfactor', 'grades').helpbutton('plusfactor', 'plusfactor', 'grade', true, false, '', true).'</th>';
+ global $OUTPUT;
+ return '<th class="header" scope="col">'.get_string('plusfactor', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('plusfactor', 'plusfactor', 'grade')).'</th>';
}
public function get_category_cell($category, $levelclass, $params) {
if (!$user = $DB->get_record('user', array('id' => $value))) {
// user not found, abort whold import
import_cleanup($importcode);
- notify("user mapping error, could not find user with id \"$value\"");
+ echo $OUTPUT->notification("user mapping error, could not find user with id \"$value\"");
$status = false;
break 3;
}
if (!$user = $DB->get_record('user', array('idnumber' => $value))) {
// user not found, abort whold import
import_cleanup($importcode);
- notify("user mapping error, could not find user with idnumber \"$value\"");
+ echo $OUTPUT->notification("user mapping error, could not find user with idnumber \"$value\"");
$status = false;
break 3;
}
case 'useremail':
if (!$user = $DB->get_record('user', array('email' => $value))) {
import_cleanup($importcode);
- notify("user mapping error, could not find user with email address \"$value\"");
+ echo $OUTPUT->notification("user mapping error, could not find user with email address \"$value\"");
$status = false;
break 3;
}
case 'username':
if (!$user = $DB->get_record('user', array('username' => $value))) {
import_cleanup($importcode);
- notify("user mapping error, could not find user with username \"$value\"");
+ echo $OUTPUT->notification("user mapping error, could not find user with username \"$value\"");
$status = false;
break 3;
}
// had to pick mapping
$status = false;
import_cleanup($importcode);
- notify(get_string('importfailed', 'grades'));
+ echo $OUTPUT->notification(get_string('importfailed', 'grades'));
break 3;
}
// had to pick mapping
$status = false;
import_cleanup($importcode);
- notify(get_string('importfailed', 'grades'));
+ echo $OUTPUT->notification(get_string('importfailed', 'grades'));
break 3;
}
if ($gradeitem->is_locked()) {
$status = false;
import_cleanup($importcode);
- notify(get_string('gradeitemlocked', 'grades'));
+ echo $OUTPUT->notification(get_string('gradeitemlocked', 'grades'));
break 3;
}
echo "<br/>grade is $value";
$status = false;
import_cleanup($importcode);
- notify(get_string('badgrade', 'grades'));
+ echo $OUTPUT->notification(get_string('badgrade', 'grades'));
break 3;
}
$value = $key;
echo "<br/>grade is $value";
$status = false;
import_cleanup($importcode);
- notify(get_string('badgrade', 'grades'));
+ echo $OUTPUT->notification(get_string('badgrade', 'grades'));
break 3;
}
$newgrade->finalgrade = $value;
// user not found, abort whold import
$status = false;
import_cleanup($importcode);
- notify('user mapping error, could not find user!');
+ echo $OUTPUT->notification('user mapping error, could not find user!');
break;
}
// not allowed to import into this group, abort
$status = false;
import_cleanup($importcode);
- notify('user not member of current group, can not update!');
+ echo $OUTPUT->notification('user not member of current group, can not update!');
break;
}
// individual grade locked
$status = false;
import_cleanup($importcode);
- notify(get_string('gradelocked', 'grades'));
+ echo $OUTPUT->notification(get_string('gradelocked', 'grades'));
break 2;
}
}
* @return bool success
*/
function grade_import_commit($courseid, $importcode, $importfeedback=true, $verbose=true) {
- global $CFG, $USER, $DB;
+ global $CFG, $USER, $DB, $OUTPUT;
$commitstart = time(); // start time in case we need to roll back
$newitemids = array(); // array to hold new grade_item ids from grade_import_newitem table, mapping array
}
if ($verbose) {
- notify(get_string('importsuccess', 'grades'), 'notifysuccess');
+ echo $OUTPUT->notification(get_string('importsuccess', 'grades'), 'notifysuccess');
$unenrolledusers = get_unenrolled_users_in_import($importcode, $courseid);
if ($unenrolledusers) {
$list = "<ul>\n";
$list .= '<li>' . get_string('usergrade', 'grades', $u) . '</li>';
}
$list .= "</ul>\n";
- notify(get_string('unenrolledusersinimport', 'grades', $list), 'notifysuccess');
+ echo $OUTPUT->notification(get_string('unenrolledusersinimport', 'grades', $list), 'notifysuccess');
}
- print_continue($CFG->wwwroot.'/grade/index.php?id='.$courseid);
+ echo $OUTPUT->continue_button($CFG->wwwroot.'/grade/index.php?id='.$courseid);
}
// clean up
import_cleanup($importcode);
echo $OUTPUT->footer();
die;
} else {
- notify($error);
- print_continue($CFG->wwwroot.'/grade/index.php?id='.$course->id);
+ echo $OUTPUT->notification($error);
+ echo $OUTPUT->continue_button($CFG->wwwroot.'/grade/index.php?id='.$course->id);
echo $OUTPUT->footer();
die;
}
//show warnings if any
foreach($warnings as $warning) {
- notify($warning);
+ echo $OUTPUT->notification($warning);
}
$studentsperpage = $report->get_pref('studentsperpage');
echo "</a></div>\n";
}
-print_simple_box_start("center");
+echo $OUTPUT->box_start();
$mform->display();
-print_simple_box_end();
+echo $OUTPUT->box_end();
echo $OUTPUT->footer();
?>
//show warnings if any
foreach($warnings as $warning) {
- notify($warning);
+ echo $OUTPUT->notification($warning);
}
$studentsperpage = $report->get_pref('studentsperpage');
echo $user_selector;
if ($currentgroup and !groups_is_member($currentgroup, $userid)) {
- notify(get_string('groupusernotmember', 'error'));
+ echo $OUTPUT->notification(get_string('groupusernotmember', 'error'));
} else {
if ($report->fill_table()) {
echo '<br />'.$report->print_table(true);
}
public function fill_table() {
- global $CFG, $DB;
+ global $CFG, $DB, $OUTPUT;
// MDL-11679, only show 'mycourses' instead of all courses
if ($courses = get_my_courses($this->user->id, 'c.sortorder ASC', 'id, shortname, showgrades')) {
return true;
} else {
- notify(get_string('nocourses', 'grades'));
+ echo $OUTPUT->notification(get_string('nocourses', 'grades'));
return false;
}
}
echo $user_selector;
if ($currentgroup and !groups_is_member($currentgroup, $userid)) {
- notify(get_string('groupusernotmember', 'error'));
+ echo $OUTPUT->notification(get_string('groupusernotmember', 'error'));
} else {
if ($report->fill_table()) {
echo '<br />'.$report->print_table(true);