Commit 1dfa95f9 authored by Penny Leach's avatar Penny Leach Committed by Richard Mansfield
Browse files

Changed the default for plugins_installed to only get active plugins.

The only places in Mahara that don't want this are upgrades, which I
changed as well.
parent 6f70ba92
......@@ -541,7 +541,7 @@ function xmldb_core_upgrade($oldversion=0) {
$field->setAttributes(XMLDB_TYPE_CHAR, 50, XMLDB_UNSIGNED, XMLDB_NOTNULL);
change_field_notnull($table, $field);
if ($blocktypes = plugins_installed('blocktype')) {
if ($blocktypes = plugins_installed('blocktype', true)) {
foreach ($blocktypes as $bt) {
install_blocktype_viewtypes_for_plugin(blocktype_single_to_namespaced($bt->name, $bt->artefactplugin));
}
......
......@@ -960,8 +960,11 @@ function plugin_types_installed() {
*
* @param string $plugintype type of plugin
*/
function plugins_installed($plugintype) {
return get_records_array($plugintype . '_installed');
function plugins_installed($plugintype, $all=false) {
if ($all) {
return get_records_array($plugintype . '_installed');
}
return get_records_array($plugintype . '_installed', 'active', 1);
}
/**
......
......@@ -884,7 +884,7 @@ function install_blocktype_extras() {
// poll all the installed blocktype plugins and ask them what categories they export
if ($blocktypes = plugins_installed('blocktype')) {
if ($blocktypes = plugins_installed('blocktype', true)) {
foreach ($blocktypes as $bt) {
install_blocktype_categories_for_plugin(blocktype_single_to_namespaced($bt->name, $bt->artefactplugin));
install_blocktype_viewtypes_for_plugin(blocktype_single_to_namespaced($bt->name, $bt->artefactplugin));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment