diff --git a/enrol/cohort/addinstance.php b/enrol/cohort/addinstance.php index 7d9f6fc3dcf..d35e098a8ed 100644 --- a/enrol/cohort/addinstance.php +++ b/enrol/cohort/addinstance.php @@ -37,7 +37,9 @@ require_login($course); require_capability('moodle/course:enrolconfig', $context); $PAGE->set_url('/enrol/cohort/addinstance.php', array('id'=>$course->id)); -$PAGE->set_pagelayout('standard'); +$PAGE->set_pagelayout('admin'); + +navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id))); // Try and make the manage instances node on the navigation active $courseadmin = $PAGE->settingsnav->get('courseadmin'); diff --git a/enrol/cohort/addinstance_form.php b/enrol/cohort/addinstance_form.php index 049d7fe59ff..af6bfd7ea5f 100644 --- a/enrol/cohort/addinstance_form.php +++ b/enrol/cohort/addinstance_form.php @@ -68,7 +68,7 @@ class enrol_cohort_addinstance_form extends moodleform { $mform->addElement('hidden', 'id', null); $mform->setType('id', PARAM_INT); - $this->add_action_buttons(); + $this->add_action_buttons(true, get_string('addinstance', 'enrol')); $this->set_data(array('id'=>$course->id)); } diff --git a/enrol/manual/edit.php b/enrol/manual/edit.php index a930e4ddc23..5237721130a 100644 --- a/enrol/manual/edit.php +++ b/enrol/manual/edit.php @@ -57,6 +57,7 @@ if ($instances = $DB->get_records('enrol', array('courseid'=>$course->id, 'enrol } else { require_capability('moodle/course:enrolconfig', $context); // no instance yet, we have to add new instance + navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id))); $instance = new object(); $instance->id = null; $instance->courseid = $course->id; @@ -83,6 +84,9 @@ if ($mform->is_cancelled()) { redirect($return); } +$PAGE->set_title(get_string('pluginname', 'enrol_manual')); +$PAGE->set_heading($course->fullname); + echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('pluginname', 'enrol_manual')); $mform->display(); diff --git a/enrol/manual/edit_form.php b/enrol/manual/edit_form.php index a389e1b6b03..9a4219e00d1 100644 --- a/enrol/manual/edit_form.php +++ b/enrol/manual/edit_form.php @@ -57,7 +57,7 @@ class enrol_manual_edit_form extends moodleform { $mform->addElement('hidden', 'courseid'); - $this->add_action_buttons(); + $this->add_action_buttons(true, ($instance->id ? null : get_string('addinstance', 'enrol'))); $this->set_data($instance); } diff --git a/enrol/meta/addinstance.php b/enrol/meta/addinstance.php index 8c01623c7ef..448480443f0 100644 --- a/enrol/meta/addinstance.php +++ b/enrol/meta/addinstance.php @@ -33,6 +33,11 @@ $id = required_param('id', PARAM_INT); // course id $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST); $context = get_context_instance(CONTEXT_COURSE, $course->id, MUST_EXIST); +$PAGE->set_url('/enrol/meta/addinstance.php', array('id'=>$course->id)); +$PAGE->set_pagelayout('admin'); + +navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id))); + require_login($course); require_capability('moodle/course:enrolconfig', $context); @@ -52,7 +57,8 @@ if ($mform->is_cancelled()) { redirect(new moodle_url('/enrol/instances.php', array('id'=>$course->id))); } -$PAGE->set_url('/enrol/meta/addinstance.php', array('id'=>$course->id)); +$PAGE->set_heading($course->fullname); +$PAGE->set_title(get_string('pluginname', 'enrol_meta')); echo $OUTPUT->header(); diff --git a/enrol/meta/addinstance_form.php b/enrol/meta/addinstance_form.php index bc99db2b8eb..0bba4dfa372 100644 --- a/enrol/meta/addinstance_form.php +++ b/enrol/meta/addinstance_form.php @@ -66,7 +66,7 @@ class enrol_meta_addinstance_form extends moodleform { $mform->addElement('hidden', 'id', null); $mform->setType('id', PARAM_INT); - $this->add_action_buttons(); + $this->add_action_buttons(true, get_string('addinstance', 'enrol')); $this->set_data(array('id'=>$course->id)); } diff --git a/enrol/paypal/edit.php b/enrol/paypal/edit.php index 2b087ed0846..bb8ff015874 100644 --- a/enrol/paypal/edit.php +++ b/enrol/paypal/edit.php @@ -52,6 +52,7 @@ if ($instanceid) { } else { require_capability('moodle/course:enrolconfig', $context); // no instance yet, we have to add new instance + navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id))); $instance = new object(); $instance->id = null; $instance->courseid = $course->id; @@ -84,6 +85,9 @@ if ($mform->is_cancelled()) { redirect($return); } +$PAGE->set_heading($course->fullname); +$PAGE->set_title(get_string('pluginname', 'enrol_paypal')); + echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('pluginname', 'enrol_paypal')); $mform->display(); diff --git a/enrol/paypal/edit_form.php b/enrol/paypal/edit_form.php index 3d264095142..8ee2147ad99 100644 --- a/enrol/paypal/edit_form.php +++ b/enrol/paypal/edit_form.php @@ -81,7 +81,7 @@ class enrol_paypal_edit_form extends moodleform { $mform->addElement('hidden', 'id'); $mform->addElement('hidden', 'courseid'); - $this->add_action_buttons(); + $this->add_action_buttons(true, ($instance->id ? null : get_string('addinstance', 'enrol'))); $this->set_data($instance); } diff --git a/enrol/self/edit.php b/enrol/self/edit.php index 8a0e67ae29b..d646fb1b27d 100644 --- a/enrol/self/edit.php +++ b/enrol/self/edit.php @@ -52,6 +52,7 @@ if ($instanceid) { } else { require_capability('moodle/course:enrolconfig', $context); // no instance yet, we have to add new instance + navigation_node::override_active_url(new moodle_url('/enrol/instances.php', array('id'=>$course->id))); $instance = new object(); $instance->id = null; $instance->courseid = $course->id; @@ -84,6 +85,9 @@ if ($mform->is_cancelled()) { redirect($return); } +$PAGE->set_heading($course->fullname); +$PAGE->set_title(get_string('pluginname', 'enrol_self')); + echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('pluginname', 'enrol_self')); $mform->display(); diff --git a/enrol/self/edit_form.php b/enrol/self/edit_form.php index a2731e7de46..89c94f9a452 100644 --- a/enrol/self/edit_form.php +++ b/enrol/self/edit_form.php @@ -78,7 +78,7 @@ class enrol_self_edit_form extends moodleform { $mform->addElement('hidden', 'id'); $mform->addElement('hidden', 'courseid'); - $this->add_action_buttons(); + $this->add_action_buttons(true, ($instance->id ? null : get_string('addinstance', 'enrol'))); $this->set_data($instance); }