Permalink
Browse files

Merge branch 'MDL-34591_24' of git://github.com/grabs/moodle into MOO…

…DLE_24_STABLE
  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Dec 9, 2012
2 parents 1c50e53 + 7c3f708 commit 0b4767ca50dfdf6f8e5d081c0cc282984ee34901
Showing with 19 additions and 0 deletions.
  1. +19 −0 enrol/paypal/lib.php
View
@@ -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 0b4767c

Please sign in to comment.