Skip to content

Commit

Permalink
MDL-28348 fix spelling and some whitespace issues
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 17, 2011
1 parent c2f53f0 commit 0a0b535
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions enrol/meta/locallib.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -45,7 +44,7 @@ public function role_assigned($ra) {
return true;
}

//only course level roles are interesting
// only course level roles are interesting
$parentcontext = get_context_instance_by_id($ra->contextid);
if ($parentcontext->contextlevel != CONTEXT_COURSE) {
return true;
Expand Down Expand Up @@ -81,7 +80,7 @@ public function role_assigned($ra) {
public function role_unassigned($ra) {
global $DB;

//note: do not test if plugin enabled, we want to keep removing previous roles
// note: do not test if plugin enabled, we want to keep removing previous roles

// prevent circular dependencies - we can not sync meta roles recursively
if ($ra->component === 'enrol_meta') {
Expand All @@ -99,7 +98,7 @@ public function role_unassigned($ra) {
return true;
}

//note: do not check 'nosyncroleids', somebody might have just enabled it, we want to get rid of nosync roles gradually
// note: do not check 'nosyncroleids', somebody might have just enabled it, we want to get rid of nosync roles gradually

foreach ($enrols as $enrol) {
// Is the user enrolled? We want to sync only really enrolled users
Expand All @@ -114,7 +113,7 @@ public function role_unassigned($ra) {
continue;
}

// unassing role, there is no other role assignment in parent course
// unassign role, there is no other role assignment in parent course
role_unassign($ra->roleid, $ra->userid, $context->id, 'enrol_meta', $enrol->id);
}

Expand Down Expand Up @@ -175,7 +174,7 @@ public function user_unenrolled($ue) {
public function course_deleted($course) {
global $DB;

//note: do not test if plugin enabled, we want to keep removing previously linked courses
// note: do not test if plugin enabled, we want to keep removing previously linked courses

// does anything want to sync with this parent?
if (!$enrols = $DB->get_records('enrol', array('customint1'=>$course->id, 'enrol'=>'meta'), 'id ASC')) {
Expand All @@ -184,7 +183,7 @@ public function course_deleted($course) {

$plugin = enrol_get_plugin('meta');
foreach ($enrols as $enrol) {
//unenrol all users
// unenrol all users
$ues = $DB->get_recordset('user_enrolments', array('enrolid'=>$enrol->id));
foreach ($ues as $ue) {
$plugin->unenrol_user($enrol, $ue->userid);
Expand All @@ -196,6 +195,7 @@ public function course_deleted($course) {
}
}


/**
* Sync all meta course links.
* @param int $courseid one course, empty mean all
Expand Down

0 comments on commit 0a0b535

Please sign in to comment.