From b63b998ee552951fc1c8af8c2a2fb9eccc766dfe Mon Sep 17 00:00:00 2001 From: aB0t Date: Wed, 18 Oct 2023 09:28:04 +0200 Subject: [PATCH] Release of v1.1.5 --- componentbuilderlanguagepackaging.php | 35 ++++++++++--------- componentbuilderlanguagepackaging.xml | 4 +-- ...sion_componentbuilderlanguagepackaging.ini | 2 +- ..._componentbuilderlanguagepackaging.sys.ini | 2 +- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/componentbuilderlanguagepackaging.php b/componentbuilderlanguagepackaging.php index 87d7440..56bfcd4 100644 --- a/componentbuilderlanguagepackaging.php +++ b/componentbuilderlanguagepackaging.php @@ -13,7 +13,10 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Application\CMSApplication; -use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Plugin\CMSPlugin; +use VDM\Joomla\Utilities\JsonHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php'); @@ -25,7 +28,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent; * Extension - Componentbuilder Language Packaging plugin. * * @package ComponentbuilderLanguagePackaging - * @since 1.1.4 + * @since 1.1.5 */ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin { @@ -239,13 +242,13 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin public function jcb_ce_onBeforeModelComponentData(&$context, &$component) { // add the privacy - $component->params = (isset($component->params) && ComponentbuilderHelper::checkJson($component->params)) ? json_decode($component->params, true) : $component->params; - if (ComponentbuilderHelper::checkArray($component->params) && isset($component->params['language_options']) && + $component->params = (isset($component->params) && JsonHelper::check($component->params)) ? json_decode($component->params, true) : $component->params; + if (ArrayHelper::check($component->params) && isset($component->params['language_options']) && isset($component->params['language_options']['activate']) && $component->params['language_options']['activate'] == 1) { // load the admin component details $this->activeComponents[$component->id] = $context; - $this->activeComponentsNames[$component->id] = ComponentbuilderHelper::safeString($component->name_code); + $this->activeComponentsNames[$component->id] = StringHelper::safe($component->name_code); $this->activeComponentsRealNames[$component->id] = $component->name; // add excluded list of languages if (isset($component->params['language_options']['languages'])) @@ -276,7 +279,7 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin // get component id $id = (int) filter_var($context, FILTER_SANITIZE_NUMBER_INT); // check if there is active - if (ComponentbuilderHelper::checkArray($this->activeComponents) + if (ArrayHelper::check($this->activeComponents) && isset($this->activeComponents[$id]) && $this->percentageLanguageAddOveride != 200) { @@ -321,7 +324,7 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin // get component id $id = (int) filter_var($context, FILTER_SANITIZE_NUMBER_INT); // check if there is active - if (ComponentbuilderHelper::checkArray($this->activeComponents) && isset($this->activeComponents[$id])) + if (ArrayHelper::check($this->activeComponents) && isset($this->activeComponents[$id])) { // set file name $file_name = 'plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name); @@ -342,7 +345,7 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin // get component id $id = (int) filter_var($context, FILTER_SANITIZE_NUMBER_INT); // check if there is active - if (ComponentbuilderHelper::checkArray($this->activeComponents) && isset($this->activeComponents[$id])) + if (ArrayHelper::check($this->activeComponents) && isset($this->activeComponents[$id])) { // extrude the languages that should not remain in the module $this->extrudeLanguages($id, $languages, $langTag, $module->file_name, $module->target_client); @@ -361,7 +364,7 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin // get component id $id = (int) filter_var($context, FILTER_SANITIZE_NUMBER_INT); // check if there is active - if (ComponentbuilderHelper::checkArray($this->activeComponents) && isset($this->activeComponents[$id])) + if (ArrayHelper::check($this->activeComponents) && isset($this->activeComponents[$id])) { // set file name $file_name = 'com_' . $this->activeComponentsNames[$id]; @@ -396,7 +399,7 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin // set all the extra languages not excluded foreach ($languages as $key => $language) { - if ($key !== $langTag && ComponentbuilderHelper::checkArray($language) && (!isset($this->excludedLang[$id]) || !in_array($key, $this->excludedLang[$id]))) + if ($key !== $langTag && ArrayHelper::check($language) && (!isset($this->excludedLang[$id]) || !in_array($key, $this->excludedLang[$id]))) { // add to our bucket $this->languages[$id][$file_name][$key] = $language; @@ -424,7 +427,7 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin */ protected function buildLanguages(&$id, &$langTag) { - if (isset($this->languages[$id]) && ComponentbuilderHelper::checkArray($this->languages[$id])) + if (isset($this->languages[$id]) && ArrayHelper::check($this->languages[$id])) { // rest xml array $langXML = array(); @@ -435,7 +438,7 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin $versionName = $this->activeComponentsNames[$id] . '_v' . str_replace('.', '_', $this->component_version . '__J' . $this->joomlaVersion); foreach ($this->languages[$id] as $file_name => $languages) { - if (ComponentbuilderHelper::checkArray($languages) && isset($this->buildDetails[$id][$file_name][$langTag])) + if (ArrayHelper::check($languages) && isset($this->buildDetails[$id][$file_name][$langTag])) { // get the main lang loader $mainLangLoader = $this->buildDetails[$id][$file_name][$langTag]; @@ -447,7 +450,7 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin $tag = trim($tag); // get language name $langName = $this->getLanguageName($tag); - $langCodeName = ComponentbuilderHelper::safeString($langName, 'F'); + $langCodeName = StringHelper::safe($langName, 'F'); // set the file folder name $langFolderFileName = $langCodeName . '_' . $versionName; // set the main folder path @@ -531,14 +534,14 @@ class PlgExtensionComponentbuilderLanguagePackaging extends CMSPlugin } // load the lang xml - if (ComponentbuilderHelper::checkArray($langXML)) + if (ArrayHelper::check($langXML)) { foreach ($langXML as $main_path => $target_clients) { // get the XML $xml = str_replace( - array_keys(CFactory::_('Content')->active), - array_values(CFactory::_('Content')->active), + array_keys(CFactory::_('Compiler.Builder.Content.One')->allActive()), + array_values(CFactory::_('Compiler.Builder.Content.One')->allActive()), $this->getLanguageXML($target_clients, $langPackages[$main_path], $langNames[$main_path]) ); // get the XML File Name diff --git a/componentbuilderlanguagepackaging.xml b/componentbuilderlanguagepackaging.xml index beb5ed4..448cb32 100644 --- a/componentbuilderlanguagepackaging.xml +++ b/componentbuilderlanguagepackaging.xml @@ -1,13 +1,13 @@ PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING - 2nd May, 2023 + 18th October, 2023 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 1.1.4 + 1.1.5 PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING_XML_DESCRIPTION diff --git a/language/en-GB/en-GB.plg_extension_componentbuilderlanguagepackaging.ini b/language/en-GB/en-GB.plg_extension_componentbuilderlanguagepackaging.ini index cffabfe..e73d132 100644 --- a/language/en-GB/en-GB.plg_extension_componentbuilderlanguagepackaging.ini +++ b/language/en-GB/en-GB.plg_extension_componentbuilderlanguagepackaging.ini @@ -1,3 +1,3 @@ PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING="Extension - Componentbuilder Language Packaging" PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING_DESCRIPTION="This plugin is used to add language packaging to JCB. 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_COMPONENTBUILDERLANGUAGEPACKAGING_XML_DESCRIPTION="

Extension - Componentbuilder Language Packaging (v.1.1.4)

This plugin is used to add language packaging to JCB. 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.

Created by Llewellyn van der Merwe
Development started 12th October, 2019

" \ No newline at end of file +PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING_XML_DESCRIPTION="

Extension - Componentbuilder Language Packaging (v.1.1.5)

This plugin is used to add language packaging to JCB. 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.

Created by Llewellyn van der Merwe
Development started 12th October, 2019

" \ No newline at end of file diff --git a/language/en-GB/en-GB.plg_extension_componentbuilderlanguagepackaging.sys.ini b/language/en-GB/en-GB.plg_extension_componentbuilderlanguagepackaging.sys.ini index cffabfe..e73d132 100644 --- a/language/en-GB/en-GB.plg_extension_componentbuilderlanguagepackaging.sys.ini +++ b/language/en-GB/en-GB.plg_extension_componentbuilderlanguagepackaging.sys.ini @@ -1,3 +1,3 @@ PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING="Extension - Componentbuilder Language Packaging" PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING_DESCRIPTION="This plugin is used to add language packaging to JCB. 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_COMPONENTBUILDERLANGUAGEPACKAGING_XML_DESCRIPTION="

Extension - Componentbuilder Language Packaging (v.1.1.4)

This plugin is used to add language packaging to JCB. 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.

Created by Llewellyn van der Merwe
Development started 12th October, 2019

" \ No newline at end of file +PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING_XML_DESCRIPTION="

Extension - Componentbuilder Language Packaging (v.1.1.5)

This plugin is used to add language packaging to JCB. 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.

Created by Llewellyn van der Merwe
Development started 12th October, 2019

" \ No newline at end of file