52
0

update - v1.1.0

This commit is contained in:
Llewellyn van der Merwe 2023-02-05 23:57:58 +02:00
parent f429dd1b7d
commit bfcd4a464b
Signed by: Llewellyn
GPG Key ID: A9201372263741E7
4 changed files with 44 additions and 104 deletions

View File

@ -15,12 +15,16 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Plugin\CMSPlugin;
JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
/**
* Extension - Componentbuilder Export Compiler plugin.
*
* @package ComponentbuilderExportCompiler
* @since 1.0.2
* @since 1.1.0
*/
class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
{
@ -47,34 +51,6 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
*/
protected $languageArray = array();
/**
* The hash placeholder
*
* @var string
*/
protected $hhh = '#' . '#' . '#';
/**
* The open bracket placeholder
*
* @var string
*/
protected $bbb = '[' . '[' . '[';
/**
* The close bracket placeholder
*
* @var string
*/
protected $ddd = ']' . ']' . ']';
/**
* The line numbers Switch
*
* @var boolean
*/
protected $debugLinenr = false;
/*
* The lang prefix
*
@ -107,15 +83,9 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
{
if ($this->exportTextOnly && $this->componentActive($context))
{
// sync needed compiler properties with this plugin class
$this->debugLinenr = $compiler->debugLinenr;
$this->hhh = $compiler->hhh;
$this->bbb = $compiler->bbb;
$this->ddd = $compiler->ddd;
$this->langPrefix = $compiler->langPrefix;
// activate export text only
$compiler->exportTextOnly = $this->exportTextOnly;
// activate strict_permission_per_field if set in plugin (default true)
$compiler->strictFieldExportPermissions = $this->strictFieldExportPermissions;
}
@ -181,10 +151,10 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
// main lang prefix
$lang = $this->langPrefix . '_CONFIG';
// start building field set for config
$configFieldSets[] = $this->_t(1) . "<fieldset";
$configFieldSets[] = $this->_t(2) . 'name="export_text_only_config"';
$configFieldSets[] = $this->_t(2) . 'label="' . $lang . '_EXPORT_TEXT_ONLY_TAB_LABEL"';
$configFieldSets[] = $this->_t(2) . 'description="' . $lang . '_EXPORT_TEXT_ONLY_TAB_DESCRIPTION">';
$configFieldSets[] = Indent::_(1) . "<fieldset";
$configFieldSets[] = Indent::_(2) . 'name="export_text_only_config"';
$configFieldSets[] = Indent::_(2) . 'label="' . $lang . '_EXPORT_TEXT_ONLY_TAB_LABEL"';
$configFieldSets[] = Indent::_(2) . 'description="' . $lang . '_EXPORT_TEXT_ONLY_TAB_DESCRIPTION">';
// setup lang
$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.";
@ -202,20 +172,20 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
$this->languageArray[$lang . '_ACTIVATE'] = "Activate";
$this->languageArray[$lang . '_DEACTIVATE'] = "Deactivate";
$configFieldSets[] = PHP_EOL . $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Export Text Only Field. Type: Radio. (joomla) -->";
$configFieldSets[] = $this->_t(2) . "<field";
$configFieldSets[] = $this->_t(3) . "type=\"radio\"";
$configFieldSets[] = $this->_t(3) . "name=\"export_text_only\"";
$configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_EXPORT_TEXT_ONLY_LABEL\"";
$configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_EXPORT_TEXT_ONLY_DESCRIPTION\"";
$configFieldSets[] = $this->_t(3) . "class=\"btn-group btn-group-yesno\"";
$configFieldSets[] = $this->_t(3) . "default=\"0\">";
$configFieldSets[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Option Set. -->";
$configFieldSets[] = $this->_t(3) . "<option value=\"1\">";
$configFieldSets[] = $this->_t(4) . $lang . "_ACTIVATE</option>";
$configFieldSets[] = $this->_t(3) . "<option value=\"0\">";
$configFieldSets[] = $this->_t(4) . $lang . "_DEACTIVATE</option>";
$configFieldSets[] = $this->_t(2) . "</field>";
$configFieldSets[] = PHP_EOL . Indent::_(2) . "<!--" . Line::_(__Line__, __Class__) . " Export Text Only Field. Type: Radio. (joomla) -->";
$configFieldSets[] = Indent::_(2) . "<field";
$configFieldSets[] = Indent::_(3) . "type=\"radio\"";
$configFieldSets[] = Indent::_(3) . "name=\"export_text_only\"";
$configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_EXPORT_TEXT_ONLY_LABEL\"";
$configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_EXPORT_TEXT_ONLY_DESCRIPTION\"";
$configFieldSets[] = Indent::_(3) . "class=\"btn-group btn-group-yesno\"";
$configFieldSets[] = Indent::_(3) . "default=\"0\">";
$configFieldSets[] = Indent::_(3) . "<!--" . Line::_(__Line__, __Class__) . " Option Set. -->";
$configFieldSets[] = Indent::_(3) . "<option value=\"1\">";
$configFieldSets[] = Indent::_(4) . $lang . "_ACTIVATE</option>";
$configFieldSets[] = Indent::_(3) . "<option value=\"0\">";
$configFieldSets[] = Indent::_(4) . $lang . "_DEACTIVATE</option>";
$configFieldSets[] = Indent::_(2) . "</field>";
// add strict Field Export Permissions field
if ($this->strictFieldExportPermissions)
@ -223,57 +193,27 @@ class PlgExtensionComponentbuilderExportCompiler extends CMSPlugin
$this->languageArray[$lang . '_STRICT_PERMISSION_PER_FIELD_LABEL'] = "Use Strict Permission per/field";
$this->languageArray[$lang . '_STRICT_PERMISSION_PER_FIELD_DESCRIPTION'] = "Use strict permissions per/field in the export methods where there are fields permissions in a view.";
$configFieldSets[] = PHP_EOL . $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Strict_permission_per_field Field. Type: Radio. (joomla) -->";
$configFieldSets[] = $this->_t(2) . "<field";
$configFieldSets[] = $this->_t(3) . "type=\"radio\"";
$configFieldSets[] = $this->_t(3) . "name=\"strict_permission_per_field\"";
$configFieldSets[] = $this->_t(3) . "label=\"" . $lang . "_STRICT_PERMISSION_PER_FIELD_LABEL\"";
$configFieldSets[] = $this->_t(3) . "description=\"" . $lang . "_STRICT_PERMISSION_PER_FIELD_DESCRIPTION\"";
$configFieldSets[] = $this->_t(3) . "class=\"btn-group btn-group-yesno\"";
$configFieldSets[] = $this->_t(3) . "default=\"1\">";
$configFieldSets[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Option Set. -->";
$configFieldSets[] = $this->_t(3) . "<option value=\"1\">";
$configFieldSets[] = $this->_t(4) . $lang . "_ACTIVATE</option>";
$configFieldSets[] = $this->_t(3) . "<option value=\"0\">";
$configFieldSets[] = $this->_t(4) . $lang . "_DEACTIVATE</option>";
$configFieldSets[] = $this->_t(2) . "</field>";
$configFieldSets[] = PHP_EOL . Indent::_(2) . "<!--" . Line::_(__Line__, __Class__) . " Strict_permission_per_field Field. Type: Radio. (joomla) -->";
$configFieldSets[] = Indent::_(2) . "<field";
$configFieldSets[] = Indent::_(3) . "type=\"radio\"";
$configFieldSets[] = Indent::_(3) . "name=\"strict_permission_per_field\"";
$configFieldSets[] = Indent::_(3) . "label=\"" . $lang . "_STRICT_PERMISSION_PER_FIELD_LABEL\"";
$configFieldSets[] = Indent::_(3) . "description=\"" . $lang . "_STRICT_PERMISSION_PER_FIELD_DESCRIPTION\"";
$configFieldSets[] = Indent::_(3) . "class=\"btn-group btn-group-yesno\"";
$configFieldSets[] = Indent::_(3) . "default=\"1\">";
$configFieldSets[] = Indent::_(3) . "<!--" . Line::_(__Line__, __Class__) . " Option Set. -->";
$configFieldSets[] = Indent::_(3) . "<option value=\"1\">";
$configFieldSets[] = Indent::_(4) . $lang . "_ACTIVATE</option>";
$configFieldSets[] = Indent::_(3) . "<option value=\"0\">";
$configFieldSets[] = Indent::_(4) . $lang . "_DEACTIVATE</option>";
$configFieldSets[] = Indent::_(2) . "</field>";
}
}
// close that fieldset
$configFieldSets[] = $this->_t(1) . "</fieldset>";
$configFieldSets[] = Indent::_(1) . "</fieldset>";
}
}
/**
* Set the line number in comments
*
* @param int $nr The line number
*
* @return void
*
*/
protected function setLine($nr)
{
if ($this->debugLinenr)
{
return ' [Plugin-Privacy-Compiler ' . $nr . ']';
}
return '';
}
/**
* Set the tab/space
*
* @param int $nr The number of tag/space
*
* @return string
*
*/
protected function _t($nr)
{
// use global method for conformity
return ComponentbuilderHelper::_t($nr);
}
/**
* The array of active components

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="4" group="extension" method="upgrade">
<name>PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER</name>
<creationDate>13th November, 2022</creationDate>
<creationDate>5th February, 2023</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.0.2</version>
<version>1.1.0</version>
<description>PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION</description>
<!-- Scripts to run on installation -->

View File

@ -1,7 +1,7 @@
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.0.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.
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Export Compiler (v.1.1.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"

View File

@ -1,7 +1,7 @@
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.0.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.
PLG_EXTENSION_COMPONENTBUILDEREXPORTCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Export Compiler (v.1.1.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"