52
0

Release of v2.2.5

This commit is contained in:
Robot 2023-10-18 09:28:04 +02:00
parent f9ab1fbfbe
commit 758273455a
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
4 changed files with 41 additions and 26 deletions

View File

@ -14,7 +14,11 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Registry\Registry;
use Joomla\Registry\Registry;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\JsonHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\String\NamespaceHelper;
JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
@ -24,7 +28,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory;
* Extension - Componentbuilder Headers Compiler plugin.
*
* @package ComponentbuilderHeadersCompiler
* @since 2.2.3
* @since 2.2.5
*/
class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
{
@ -499,7 +503,7 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
public function jcb_ce_onAfterGetComponentData(&$context, $compiler)
{
// add the powers to the component
if (ComponentbuilderHelper::checkArray($this->linkedPowers, true))
if (ArrayHelper::check($this->linkedPowers, true))
{
$compiler->linkedPowers = $this->linkedPowers;
}
@ -515,10 +519,10 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
protected function setHeaders(&$params, &$obj, $key)
{
// add the headers
$params = (ComponentbuilderHelper::checkJson($params)) ? json_decode($params, true) : $params;
$params = (JsonHelper::check($params)) ? json_decode($params, true) : $params;
// make sure we have the keys values in the params area
if (ComponentbuilderHelper::checkArray($params) && isset($params[$key])
&& ComponentbuilderHelper::checkArray($params[$key]))
if (ArrayHelper::check($params) && isset($params[$key])
&& ArrayHelper::check($params[$key]))
{
foreach ($this->targets[$key] as $target => $event)
{
@ -549,10 +553,10 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
protected function setDynamicHeaders($params, $code, $key)
{
// add the headers
$params = (ComponentbuilderHelper::checkJson($params)) ? json_decode($params, true) : $params;
$params = (JsonHelper::check($params)) ? json_decode($params, true) : $params;
// make sure we have the keys values in the params area
if (ComponentbuilderHelper::checkArray($params) && isset($params[$key])
&& ComponentbuilderHelper::checkArray($params[$key]))
if (ArrayHelper::check($params) && isset($params[$key])
&& ArrayHelper::check($params[$key]))
{
foreach ($this->targets[$key] as $target => $event)
{
@ -586,8 +590,8 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
$headers = [];
// load the headers if power
if (isset($params['power_' . $get['field']]) && ComponentbuilderHelper::checkArray($params['power_' . $get['field']], true)
&& ($powers = $this->getPowers($params['power_' . $get['field']])) !== false)
if (isset($params['power_' . $get['field']]) && ArrayHelper::check($params['power_' . $get['field']], true)
&& ($powers = $this->getPowers($params['power_' . $get['field']])) !== null)
{
foreach ($powers as $power)
{
@ -597,9 +601,9 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
}
// load the headers if text
if (isset($params[$get['field']]) && ComponentbuilderHelper::checkString($params[$get['field']]))
if (isset($params[$get['field']]) && StringHelper::check($params[$get['field']]))
{
if (($_headers = explode(PHP_EOL, $params[$get['field']])) !== false)
if (($_headers = explode(PHP_EOL, $params[$get['field']])))
{
foreach ($_headers as $header)
{
@ -614,7 +618,7 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
}
// check if we found some header values
if (ComponentbuilderHelper::checkArray($headers, true))
if (ArrayHelper::check($headers, true))
{
// activate the load of the headers
$this->loadHeaders = true;
@ -650,7 +654,7 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
}
elseif (isset($view->{$get}))
{
return ComponentbuilderHelper::safeString(
return StringHelper::safe(
$view->{$get}
);
}
@ -670,11 +674,22 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
$powers = array_filter(
// get the power namespace
array_map(function ($row) {
if (($power = ComponentbuilderHelper::getGUID($row['power'], 'power', ['a.guid', 'a.namespace'])) !== false)
if (($power = ComponentbuilderHelper::getGUID($row['power'], 'power', ['a.guid', 'a.namespace'])) !== null)
{
$power->build = (int) $row['build'];
$power->as = (string) $row['as'];
return $power;
$power->build = (int) $row['build'];
$power->as = (string) $row['as'];
return $power;
}
elseif (CFactory::_('Superpower')->load($row['power'], ['remote']))
{
if (($power = ComponentbuilderHelper::getGUID($row['power'], 'power', ['a.guid', 'a.namespace'])) !== null)
{
$power->build = (int) $row['build'];
$power->as = (string) $row['as'];
return $power;
}
}
return false;
}, $rows),
@ -684,7 +699,7 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
}
);
// add to active powers
if (ComponentbuilderHelper::checkArray($powers))
if (ArrayHelper::check($powers))
{
// convert the dots to namespace
return array_map(function ($power) {
@ -698,7 +713,7 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
}
}
// build the namespace
$namespace = ComponentbuilderHelper::safeNamespace(
$namespace = NamespaceHelper::safe(
str_replace(
array_keys($this->placeholders),
array_values($this->placeholders),
@ -706,7 +721,7 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
)
);
// check if it has an AS option
if (ComponentbuilderHelper::checkString($power->as) && $power->as !== 'default')
if (StringHelper::check($power->as) && $power->as !== 'default')
{
return 'use ' . $namespace . ' as ' . $power->as . ';';
}

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_COMPONENTBUILDERHEADERSCOMPILER</name>
<creationDate>2nd May, 2023</creationDate>
<creationDate>18th October, 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>2.2.3</version>
<version>2.2.5</version>
<description>PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_XML_DESCRIPTION</description>
<!-- Scripts to run on installation -->

View File

@ -1,3 +1,3 @@
PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER="Extension - Componentbuilder Headers Compiler"
PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_DESCRIPTION="This plugin is used to set the custom headers for your classes 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 set your code where you would like to set Custom Headers."
PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Headers Compiler (v.2.2.3)</h1> <div style='clear: both;'></div><p>This plugin is used to set the custom headers for your classes 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 set your code where you would like to set Custom Headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 24th May, 2020</small></p>"
PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Headers Compiler (v.2.2.5)</h1> <div style='clear: both;'></div><p>This plugin is used to set the custom headers for your classes 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 set your code where you would like to set Custom Headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 24th May, 2020</small></p>"

View File

@ -1,3 +1,3 @@
PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER="Extension - Componentbuilder Headers Compiler"
PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_DESCRIPTION="This plugin is used to set the custom headers for your classes 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 set your code where you would like to set Custom Headers."
PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Headers Compiler (v.2.2.3)</h1> <div style='clear: both;'></div><p>This plugin is used to set the custom headers for your classes 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 set your code where you would like to set Custom Headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 24th May, 2020</small></p>"
PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_XML_DESCRIPTION="<h1>Extension - Componentbuilder Headers Compiler (v.2.2.5)</h1> <div style='clear: both;'></div><p>This plugin is used to set the custom headers for your classes 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 set your code where you would like to set Custom Headers.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 24th May, 2020</small></p>"