mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
moodle/site:manageblocks tweak
This commit is contained in:
parent
260a56b114
commit
0c4d9f492e
1 changed files with 12 additions and 2 deletions
|
@ -1342,8 +1342,18 @@ function load_capability_def($component) {
|
||||||
$defpath = $CFG->libdir.'/db/access.php';
|
$defpath = $CFG->libdir.'/db/access.php';
|
||||||
$varprefix = 'moodle';
|
$varprefix = 'moodle';
|
||||||
} else {
|
} else {
|
||||||
$defpath = $CFG->dirroot.'/'.$component.'/db/access.php';
|
$compparts = explode('/', $component);
|
||||||
$varprefix = str_replace('/', '_', $component);
|
|
||||||
|
if ($compparts[0] == 'block') {
|
||||||
|
// Blocks are an exception. Blocks directory is 'blocks', and not
|
||||||
|
// 'block'. So we need to jump through hoops.
|
||||||
|
$defpath = $CFG->dirroot.'/'.$compparts[0].
|
||||||
|
's/'.$compparts[1].'/db/access.php';
|
||||||
|
$varprefix = $compparts[0].'_'.$compparts[1];
|
||||||
|
} else {
|
||||||
|
$defpath = $CFG->dirroot.'/'.$component.'/db/access.php';
|
||||||
|
$varprefix = str_replace('/', '_', $component);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$capabilities = array();
|
$capabilities = array();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue