Commit 52fe3992 authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review
Browse files

Merge "Use existing functions to test for installed plugins"

parents fd829387 6a1683c1
......@@ -1614,7 +1614,7 @@ function group_get_menu_tabs() {
if ($role) {
safe_require('grouptype', $group->grouptype);
$artefactplugins = call_static_method('GroupType' . $group->grouptype, 'get_group_artefact_plugins');
if ($plugins = get_records_array('artefact_installed', 'active', 1)) {
if ($plugins = plugins_installed('artefact')) {
foreach ($plugins as &$plugin) {
if (!in_array($plugin->name, $artefactplugins)) {
continue;
......
......@@ -1364,7 +1364,7 @@ function blocktype_name_to_namespaced($blocktype) {
static $resultcache = array();
if (!isset($resultcache[$blocktype])) {
$artefactplugin = get_field('blocktype_installed', 'artefactplugin', 'name', $blocktype);
$artefactplugin = blocktype_artefactplugin($blocktype);
if ($artefactplugin) {
$resultcache[$blocktype] = "$artefactplugin/$blocktype";
}
......
......@@ -1710,7 +1710,7 @@ class View {
foreach($instancejs as &$jsfile) {
$jsfile = (is_array($jsfile) && isset($jsfile['file'])) ? $jsfile['file'] : $jsfile;
if(strpos($jsfile, 'http://') === false) {
if($artefactplugin = get_field('blocktype_installed', 'artefactplugin', 'name', $pluginname)) {
if ($artefactplugin = blocktype_artefactplugin($pluginname)) {
$jsfile = 'artefact/' . $artefactplugin . '/blocktype/' .
$pluginname . '/' . $jsfile;
}
......
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