Browse files

MDL-34591 - paypal does not allow unenrol

  • Loading branch information...
1 parent 4bd6f71 commit a8e85e05bcafc9595eb156a29a7aea318a958855 @grabs grabs committed Dec 5, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 enrol/paypal/lib.php
View
19 enrol/paypal/lib.php
@@ -207,4 +207,23 @@ function enrol_page_hook(stdClass $instance) {
return $OUTPUT->box(ob_get_clean());
}
+ /**
+ * Gets an array of the user enrolment actions
+ *
+ * @param course_enrolment_manager $manager
+ * @param stdClass $ue A user enrolment object
+ * @return array An array of user_enrolment_actions
+ */
+ public function get_user_enrolment_actions(course_enrolment_manager $manager, $ue) {
+ $actions = array();
+ $context = $manager->get_context();
+ $instance = $ue->enrolmentinstance;
+ $params = $manager->get_moodlepage()->url->params();
+ $params['ue'] = $ue->id;
+ if ($this->allow_unenrol($instance) && has_capability("enrol/paypal:unenrol", $context)) {
+ $url = new moodle_url('/enrol/unenroluser.php', $params);
+ $actions[] = new user_enrolment_action(new pix_icon('t/delete', ''), get_string('unenrol', 'enrol'), $url, array('class'=>'unenrollink', 'rel'=>$ue->id));
+ }
+ return $actions;
+ }
}

0 comments on commit a8e85e0

Please sign in to comment.