Skip to content

Commit

Permalink
moodle/course:managemetacourse is now singular
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 19, 2006
1 parent 096a664 commit b79da3a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion blocks/admin/block_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function get_content() {

/// Manage metacourses
if ($course->metacourse) {
if (has_capability('moodle/course:managemetacourses', $context)) {
if (has_capability('moodle/course:managemetacourse', $context)) {
$strchildcourses = get_string('childcourses');
$this->content->items[]='<a href="importstudents.php?id='.$this->instance->pageid.'">'.$strchildcourses.'</a>';
$this->content->icons[]='<img src="'.$CFG->pixpath.'/i/course.gif" alt="" />';
Expand Down
4 changes: 2 additions & 2 deletions course/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

} else {
$managers = count(get_users_by_capability($context, 'moodle/course:managemetacourses'));
$managers = count(get_users_by_capability($context, 'moodle/course:managemetacourse'));
$participants = count(get_users_by_capability($context, 'moodle/course:view'));
if ($participants > $managers) {
$disable_meta = get_string('metaalreadyhasenrolments');
Expand Down Expand Up @@ -147,7 +147,7 @@
add_to_log(SITEID, "course", "new", "view.php?id=$newcourseid", "$form->fullname (ID $newcourseid)") ;
$context = get_context_instance(CONTEXT_COURSE, $newcourseid);

if ($form->metacourse and has_capability('moodle/course:managemetacourses', $context)) { // Redirect users with metacourse capability to student import
if ($form->metacourse and has_capability('moodle/course:managemetacourse', $context)) { // Redirect users with metacourse capability to student import
redirect($CFG->wwwroot."/course/importstudents.php?id=$newcourseid");

} else if (has_capability('moodle/role:assign', $context)) { // Redirect users with assign capability to assign users to different roles
Expand Down
2 changes: 1 addition & 1 deletion course/importstudents.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

require_login($course->id);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('moodle/course:managemetacourses', $context);
require_capability('moodle/course:managemetacourse', $context);

if (!$course->metacourse) {
redirect("$CFG->wwwroot/course/view.php?id=$course->id");
Expand Down
2 changes: 1 addition & 1 deletion lib/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
)
),

'moodle/course:managemetacourses' => array(
'moodle/course:managemetacourse' => array(

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
Expand Down
2 changes: 1 addition & 1 deletion lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ function sync_metacourse($course) {
}

// always keep metacourse managers
if ($users = get_users_by_capability($context, 'moodle/course:managemetacourses')) {
if ($users = get_users_by_capability($context, 'moodle/course:managemetacourse')) {
$managers = array_keys($users);
} else {
$managers = array();
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)

$version = 2006091807; // YYYYMMDD = date
$version = 2006091900; // YYYYMMDD = date
// XY = increments within a single day

$release = '1.7 dev'; // Human-friendly version name
Expand Down

0 comments on commit b79da3a

Please sign in to comment.