Skip to content

Commit

Permalink
Ignore disabled course formats (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
jboulen authored Nov 13, 2024
1 parent d2b8260 commit 523118e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@

$pluginmanager = \core_plugin_manager::instance();
$plugins = [];
foreach (array_keys($pluginmanager->get_plugins_of_type('format')) as $plugin) {
$plugins[$plugin] = new lang_string('pluginname', 'format_' . $plugin);
foreach ($pluginmanager->get_plugins_of_type('format') as $pluginname => $plugin) {
if (!$plugin->is_enabled()) {
continue;
}
$plugins[$pluginname] = new lang_string('pluginname', 'format_' . $pluginname);
}
// Sort alphabetically. Custom sort function needed, because lang_string is an object.
uasort($plugins, function($a, $b) {
Expand Down

0 comments on commit 523118e

Please sign in to comment.