Added the feature that stops plugins from being exported as part of JCB package

This commit is contained in:
2019-11-13 05:36:42 +02:00
parent 1a18f5a386
commit 850ee4b7e9
5 changed files with 21 additions and 6 deletions

View File

@ -749,6 +749,21 @@ class ComponentbuilderModelJoomla_components extends JModelList
// actions to take if table is component_plugins
if ('component_plugins' === $table)
{
// we remove those plugins not part of the export
if (isset($item->addjoomla_plugins) && ComponentbuilderHelper::checkJson($item->addjoomla_plugins))
{
$item->addjoomla_plugins = array_filter(
json_decode($item->addjoomla_plugins, true),
function ($plugin) {
// target 2 is only export and target 0 is both (1 is only compile)
if (isset($plugin['target']) && ($plugin['target'] == 2 || $plugin['target'] == 0))
{
return true;
}
return false;
}
);
}
// add custom admin views
$this->setData('joomla_plugin', $this->getValues($item->addjoomla_plugins, 'subform', 'plugin'), 'id');
}