Release of v1.2.0
This commit is contained in:
parent
ccc864ec1f
commit
c6b1bcbcc0
@ -26,7 +26,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||
* Extension - Componentbuilder Export Compiler plugin.
|
||||
*
|
||||
* @package ComponentbuilderExportCompiler
|
||||
* @since 1.1.2
|
||||
* @since 1.2.0
|
||||
*/
|
||||
class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
{
|
||||
@ -51,7 +51,7 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $languageArray = array();
|
||||
protected $languageArray = [];
|
||||
|
||||
/*
|
||||
* The Export Text Only switch
|
||||
@ -63,9 +63,9 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
/*
|
||||
* The Strict Field Export Permissions switch
|
||||
*
|
||||
* @var int
|
||||
* @var bool
|
||||
*/
|
||||
protected $strictFieldExportPermissions = 0;
|
||||
protected $strictFieldExportPermissions = false;
|
||||
|
||||
/**
|
||||
* Event Triggered in the compiler [on Before Get Component Data]
|
||||
@ -74,15 +74,15 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
public function jcb_ce_onAfterGetComponentData(&$context, $compiler)
|
||||
public function jcb_ce_onAfterGetComponentData()
|
||||
{
|
||||
if ($this->exportTextOnly && $this->componentActive($context))
|
||||
if ($this->exportTextOnly && $this->componentActive())
|
||||
{
|
||||
// activate export text only
|
||||
$compiler->exportTextOnly = $this->exportTextOnly;
|
||||
CFactory::_('Config')->set('export_text_only', (int) $this->exportTextOnly);
|
||||
|
||||
// activate strict_permission_per_field if set in plugin (default true)
|
||||
$compiler->strictFieldExportPermissions = $this->strictFieldExportPermissions;
|
||||
CFactory::_('Config')->set('permission_strict_per_field', (bool) $this->strictFieldExportPermissions);
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,10 +93,10 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
public function jcb_ce_onAfterModelComponentData(&$context, &$component)
|
||||
public function jcb_ce_onAfterModelComponentData(&$component)
|
||||
{
|
||||
// check if we have export for any view
|
||||
if ($this->componentActive($context))
|
||||
if ($this->componentActive())
|
||||
{
|
||||
// set the export/import option
|
||||
if (isset($component->admin_views) && ArrayHelper::check($component->admin_views))
|
||||
@ -106,7 +106,7 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
if (!$this->exportTextOnly && (isset($view['port']) && $view['port'] || 1 == $view['settings']->add_custom_import))
|
||||
{
|
||||
$this->exportTextOnly = 1;
|
||||
$this->strictFieldExportPermissions = $this->params->get('strict_permission_per_field', 1);
|
||||
$this->strictFieldExportPermissions = (bool) $this->params->get('strict_permission_per_field', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,9 +120,9 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
public function jcb_ce_onBeforeSetLangFileData(&$context, $compiler)
|
||||
public function jcb_ce_onBeforeSetLangFileData()
|
||||
{
|
||||
if ($this->exportTextOnly && $this->componentActive($context) && ArrayHelper::check($this->languageArray))
|
||||
if ($this->exportTextOnly && $this->componentActive() && ArrayHelper::check($this->languageArray))
|
||||
{
|
||||
foreach($this->languageArray as $key => $string)
|
||||
{
|
||||
@ -138,10 +138,10 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
*
|
||||
* @since 1.0
|
||||
*/
|
||||
public function jcb_ce_onBeforeSetConfigFieldsets(&$context, &$timer, &$configFieldSets, &$configFieldSetsCustomField, &$componentDataConfig, &$extensionsParams, &$placeholders)
|
||||
public function jcb_ce_onBeforeSetConfigFieldsets(&$timer)
|
||||
{
|
||||
// only add fields after second time
|
||||
if ($this->exportTextOnly && $this->componentActive($context) && $timer == 2)
|
||||
if ($this->exportTextOnly && $this->componentActive() && $timer == 2)
|
||||
{
|
||||
// main lang prefix
|
||||
$lang = CFactory::_('Config')->lang_prefix . '_CONFIG';
|
||||
@ -154,7 +154,7 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
$this->languageArray[$lang . '_EXPORT_TEXT_ONLY_TAB_LABEL'] = "Export Options";
|
||||
$this->languageArray[$lang . '_EXPORT_TEXT_ONLY_TAB_DESCRIPTION'] = "Here are some extra option to adjust the export behavior of admin views.";
|
||||
// add custom Export Options
|
||||
if (isset($configFieldSetsCustomField['Export Options']) && ComponentbuilderHelper::checkArray($configFieldSetsCustomField['Export Options']))
|
||||
if (isset($configFieldSetsCustomField['Export Options']) && ArrayHelper::check($configFieldSetsCustomField['Export Options']))
|
||||
{
|
||||
$configFieldSets[] = implode("", $configFieldSetsCustomField['Export Options']);
|
||||
unset($configFieldSetsCustomField['Export Options']);
|
||||
@ -227,12 +227,10 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
/**
|
||||
* Set the line number in comments
|
||||
*
|
||||
* @param string $context The context of the current executing component
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
*/
|
||||
protected function componentActive(&$context)
|
||||
protected function componentActive()
|
||||
{
|
||||
// check the active option
|
||||
if (!$this->activateOption)
|
||||
@ -252,7 +250,7 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
|
||||
// only check if there are active
|
||||
if (ArrayHelper::check($this->componentsActive))
|
||||
{
|
||||
return in_array((int) filter_var($context, FILTER_SANITIZE_NUMBER_INT), $this->componentsActive);
|
||||
return in_array((int) CFactory::_('Config')->component_id, $this->componentsActive);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="plugin" version="4" group="extension" method="upgrade">
|
||||
<extension type="plugin" version="3.10" group="extension" method="upgrade">
|
||||
<name>PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER</name>
|
||||
<creationDate>24th October, 2023</creationDate>
|
||||
<creationDate>2nd March, 2024</creationDate>
|
||||
<author>Llewellyn van der Merwe</author>
|
||||
<authorEmail>joomla@vdm.io</authorEmail>
|
||||
<authorUrl>https://dev.vdm.io</authorUrl>
|
||||
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<version>1.1.2</version>
|
||||
<version>1.2.0</version>
|
||||
<description>PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION</description>
|
||||
|
||||
<!-- Scripts to run on installation -->
|
||||
|
@ -1,6 +1,6 @@
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER="Extension - Componentbuilder Export Compiler"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_DESCRIPTION="This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab."
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Export Compiler (v.1.1.2)</h1> <div style='clear: both;'></div><p>This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 21st August, 2019</small></p>"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Export Compiler (v.1.2.0)</h1> <div style='clear: both;'></div><p>This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 21st August, 2019</small></p>"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_SETTINGS="Settings"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_ACTIVATE_OPTION_LABEL="Activate Options"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_ACTIVATE_OPTION_DESCRIPTION="You can select the kind of activation control you would like to use. <b>All</b> will target all components, and <b>Selected</b> will let you select only those you want to be active."
|
||||
|
@ -1,6 +1,6 @@
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER="Extension - Componentbuilder Export Compiler"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_DESCRIPTION="This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab."
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Export Compiler (v.1.1.2)</h1> <div style='clear: both;'></div><p>This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 21st August, 2019</small></p>"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Export Compiler (v.1.2.0)</h1> <div style='clear: both;'></div><p>This plugin is used to tweak the export options for your components during compilation. To activate it you must first enable it here. Then open your JCB component global options, and under the Global tab, select this plugin in the Activate Compiler Plugins field.Also be sure to activate the component/s that should be targeted with this added export feature under the Component Activation tab.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 21st August, 2019</small></p>"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_SETTINGS="Settings"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_ACTIVATE_OPTION_LABEL="Activate Options"
|
||||
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_ACTIVATE_OPTION_DESCRIPTION="You can select the kind of activation control you would like to use. <b>All</b> will target all components, and <b>Selected</b> will let you select only those you want to be active."
|
||||
|
@ -12,6 +12,11 @@
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Filesystem\File;
|
||||
use Joomla\CMS\Filesystem\Folder;
|
||||
|
||||
/**
|
||||
* Extension - Componentbuilder Export Compiler script file.
|
||||
*
|
||||
@ -31,7 +36,7 @@ class plgExtensionComponentbuilderExportCompilerInstallerScript
|
||||
public function preflight($route, $adapter)
|
||||
{
|
||||
// get application
|
||||
$app = JFactory::getApplication();
|
||||
$app = Factory::getApplication();
|
||||
|
||||
// the default for both install and update
|
||||
$jversion = new JVersion();
|
||||
|
Loading…
x
Reference in New Issue
Block a user