Skip to content

Commit

Permalink
MDL-19346 get_db_directories() - make it use core get_plugin_types() …
Browse files Browse the repository at this point in the history
…where all the plugins are defined
  • Loading branch information
stronk7 committed May 30, 2009
1 parent 52c2ec0 commit 76b6c64
Showing 1 changed file with 8 additions and 59 deletions.
67 changes: 8 additions & 59 deletions lib/adminlib.php
Expand Up @@ -244,65 +244,14 @@ function get_db_directories() {
/// First, the main one (lib/db)
$dbdirs[] = $CFG->libdir.'/db';

/// Now, activity modules (mod/xxx/db)
if ($plugins = get_list_of_plugins('mod')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot.'/mod/'.$plugin.'/db';
}
}

/// Now, assignment submodules (mod/assignment/type/xxx/db)
if ($plugins = get_list_of_plugins('mod/assignment/type')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot.'/mod/assignment/type/'.$plugin.'/db';
}
}

/// Now, question types (question/type/xxx/db)
if ($plugins = get_list_of_plugins('question/type')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot.'/question/type/'.$plugin.'/db';
}
}

/// Now, blocks (blocks/xxx/db)
if ($plugins = get_list_of_plugins('blocks', 'db')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot.'/blocks/'.$plugin.'/db';
}
}

/// Now, course formats (course/format/xxx/db)
if ($plugins = get_list_of_plugins('course/format', 'db')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot.'/course/format/'.$plugin.'/db';
}
}

/// Now, enrolment plugins (enrol/xxx/db)
if ($plugins = get_list_of_plugins('enrol', 'db')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot.'/enrol/'.$plugin.'/db';
}
}

/// Now admin report plugins (admin/report/xxx/db)
if ($plugins = get_list_of_plugins($CFG->admin.'/report', 'db')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot.'/'.$CFG->admin.'/report/'.$plugin.'/db';
}
}

/// Now quiz report plugins (mod/quiz/report/xxx/db)
if ($plugins = get_list_of_plugins('mod/quiz/report', 'db')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot.'/mod/quiz/report/'.$plugin.'/db';
}
}

if ($plugins = get_list_of_plugins('portfolio/type', 'db')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot . '/portfolio/type/' . $plugin . '/db';
/// Then, all the ones defined by get_plugin_types()
if ($plugintypes = get_plugin_types()) {
foreach ($plugintypes as $plugintype => $pluginbasedir) {
if ($plugins = get_list_of_plugins($pluginbasedir, 'db')) {
foreach ($plugins as $plugin) {
$dbdirs[] = $CFG->dirroot . '/' . $pluginbasedir . '/' . $plugin . '/db';
}
}
}
}

Expand Down

0 comments on commit 76b6c64

Please sign in to comment.