From f943f4fd00735b1571ec499e431cefe5bc60f8f8 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 5 Jul 2007 21:40:05 +0000 Subject: [PATCH] MDL-10207 delete support in grade tree editing page --- grade/report/grader/category.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/grade/report/grader/category.php b/grade/report/grader/category.php index cef9fc9c608..612d9525969 100644 --- a/grade/report/grader/category.php +++ b/grade/report/grader/category.php @@ -84,7 +84,23 @@ switch ($action) { break; case 'delete': - //TODO: implement deleting in grade items and categories + if ($eid) { + $confirm = optional_param('confirm', 0, PARAM_BOOL); + + if ($confirm and confirm_sesskey()) { + $object->delete('grade/report/grader/category'); + redirect($returnurl); + + } else { + print_header_simple($strgrades . ': ' . $strgraderreport, ': ' . $strcategoriesedit, $navigation, '', '', true, '', navmenu($course)); + $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, 'category.php', 'category.php', $optionsyes, $optionsno, 'post', 'get'); + print_footer($course); + die; + } + } break; case 'autosort': @@ -156,7 +172,7 @@ print_header_simple($strgrades . ': ' . $strgraderreport, ': ' . $strcategoriese print_heading(get_string('categoriesedit', 'grades')); // Add tabs -$currenttab = 'editcategory'; +$currenttab = 'editcategory'; include('tabs.php'); print_box_start('gradetreebox generalbox');