Permalink
Browse files

MDL-37572 Course categories are now managed in /course/manage.php

Switching between categories view and edit no longer depend on global editing mode
/course/index.php and /course/category.php do not contain editing code
  • Loading branch information...
marinaglancy authored and Sam Hemelryk committed Jan 29, 2013
1 parent 1918a24 commit 2c49fb4c3e29c82184da08d4de69df9a973ca50c
@@ -8,7 +8,7 @@
or has_capability('moodle/course:create', $systemcontext)
or has_capability('moodle/site:approvecourse', $systemcontext)) { // speedup for non-admins, add all caps used on this page
- $ADMIN->add('courses', new admin_externalpage('coursemgmt', new lang_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/index.php?categoryedit=on',
+ $ADMIN->add('courses', new admin_externalpage('coursemgmt', new lang_string('coursemgmt', 'admin'), $CFG->wwwroot . '/course/manage.php',
array('moodle/category:manage', 'moodle/course:create')));
/// Course Default Settings Page
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -49,7 +49,7 @@
$message = "$strdeletecoursecheck<br /><br />" . format_string($course->fullname, true, array('context' => $coursecontext)) . " (" . $courseshortname . ")";
- echo $OUTPUT->confirm($message, "delete.php?id=$course->id&delete=".md5($course->timemodified), "category.php?id=$course->category");
+ echo $OUTPUT->confirm($message, "delete.php?id=$course->id&delete=".md5($course->timemodified), "manage.php?id=$course->category");
echo $OUTPUT->footer();
exit;
@@ -80,7 +80,7 @@
echo $OUTPUT->heading( get_string("deletedcourse", "", $courseshortname) );
- echo $OUTPUT->continue_button("category.php?id=$course->category");
+ echo $OUTPUT->continue_button("manage.php?id=$course->category");
echo $OUTPUT->footer();
@@ -121,8 +121,8 @@ function definition() {
$mform->addElement('static', 'emptymessage', '', get_string('deletecategoryempty'));
}
- $mform->addElement('hidden', 'delete');
- $mform->setType('delete', PARAM_ALPHANUM);
+ $mform->addElement('hidden', 'deletecat');
+ $mform->setType('deletecat', PARAM_ALPHANUM);
$mform->addElement('hidden', 'sure');
$mform->setType('sure', PARAM_ALPHANUM);
$mform->setDefault('sure', md5(serialize($category)));
View
@@ -90,6 +90,12 @@
case 'category':
$url = new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$categoryid));
break;
+ case 'catmanage':
+ $url = new moodle_url($CFG->wwwroot.'/course/manage.php', array('id'=>$categoryid));
+ break;
+ case 'topcatmanage':
+ $url = new moodle_url($CFG->wwwroot.'/course/manage.php');
+ break;
case 'topcat':
$url = new moodle_url($CFG->wwwroot.'/course/');
break;
View
@@ -85,11 +85,11 @@
if ($mform->is_cancelled()) {
if ($id) {
- redirect($CFG->wwwroot . '/course/category.php?id=' . $id . '&categoryedit=on');
+ redirect($CFG->wwwroot . '/course/manage.php?id=' . $id);
} else if ($parent) {
- redirect($CFG->wwwroot .'/course/category.php?id=' . $parent . '&categoryedit=on');
+ redirect($CFG->wwwroot .'/course/manage.php?id=' . $parent);
} else {
- redirect($CFG->wwwroot .'/course/index.php?categoryedit=on');
+ redirect($CFG->wwwroot .'/course/manage.php');
}
} else if ($data = $mform->get_data()) {
$newcategory = new stdClass();
@@ -128,7 +128,7 @@
add_to_log(SITEID, "category", $logaction, "editcategory.php?id=$newcategory->id", $newcategory->id);
fix_course_sortorder();
- redirect('category.php?id='.$newcategory->id.'&categoryedit=on');
+ redirect('manage.php?id='.$newcategory->id);
}
// Unfortunately the navigation never generates correctly for this page because technically this page doesn't actually
@@ -150,7 +150,7 @@
// Failing that we'll override the URL, not as accurate and chances are things
// won't be 100% correct all the time but should work most times.
// A common reason to arrive here is having the management capability within only a particular category (not at system level).
- navigation_node::override_active_url(new moodle_url('/course/index.php', array('categoryedit' => 'on')));
+ navigation_node::override_active_url(new moodle_url('/course/manage.php'));
}
$PAGE->set_title($title);
Oops, something went wrong.

0 comments on commit 2c49fb4

Please sign in to comment.