From e823cd13fa796f99c2a5c5a675092046739a1c82 Mon Sep 17 00:00:00 2001 From: vyshane Date: Mon, 28 Aug 2006 06:36:36 +0000 Subject: [PATCH] Cleanups --- admin/roles/assign.html | 2 +- admin/roles/override.html | 4 ++-- admin/roles/override.php | 23 +++++++++++------------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/admin/roles/assign.html b/admin/roles/assign.html index d50a9461f0..37e6dd542a 100755 --- a/admin/roles/assign.html +++ b/admin/roles/assign.html @@ -5,7 +5,7 @@ if ($userid) { print (''); } -if ($course->id) { +if ($courseid) { print (''); } ?> diff --git a/admin/roles/override.html b/admin/roles/override.html index f4a4603021..c5cfc89f3c 100755 --- a/admin/roles/override.html +++ b/admin/roles/override.html @@ -1,11 +1,11 @@ -
+ '); } -if ($course->id) { +if ($courseid) { print (''); }?> diff --git a/admin/roles/override.php b/admin/roles/override.php index a10888a060..1497eea391 100755 --- a/admin/roles/override.php +++ b/admin/roles/override.php @@ -139,21 +139,20 @@ **************************************/ if ($roleid) { - - // this is the array holding capabilities of this role sorted till this context + // This is the array holding capabilities of this role sorted till this context $r_caps = role_context_capabilities($roleid, $context); - - // this is the available capabilities assignable in this context - $capabilities = fetch_context_capabilities($context); - print_simple_box_start("center"); - - include_once('override.html'); - - print_simple_box_end(); - + // Get the capabilities assignable in this context + if ($capabilities = fetch_context_capabilities($context)) { + print_simple_box_start("center"); + include_once('override.html'); + print_simple_box_end(); + } else { + notice(get_string('nocapabilitiesincontext', 'moodle'), + $CFG->wwwroot.'/admin/roles/override.php?contextid='.$contextid); + } } print_footer($course); -?> +?> \ No newline at end of file -- 2.39.5