52
0

Release of v1.1.5

This commit is contained in:
Robot 2023-10-18 09:28:04 +02:00
parent 9d789fbf83
commit b63b998ee5
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
4 changed files with 23 additions and 20 deletions

View File

@ -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

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_COMPONENTBUILDERLANGUAGEPACKAGING</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>1.1.4</version>
<version>1.1.5</version>
<description>PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING_XML_DESCRIPTION</description>
<!-- Scripts to run on installation -->

View File

@ -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="<h1>Extension - Componentbuilder Language Packaging (v.1.1.4)</h1> <div style='clear: both;'></div><p>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.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 12th October, 2019</small></p>"
PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING_XML_DESCRIPTION="<h1>Extension - Componentbuilder Language Packaging (v.1.1.5)</h1> <div style='clear: both;'></div><p>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.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 12th October, 2019</small></p>"

View File

@ -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="<h1>Extension - Componentbuilder Language Packaging (v.1.1.4)</h1> <div style='clear: both;'></div><p>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.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 12th October, 2019</small></p>"
PLG_EXTENSION_COMPONENTBUILDERLANGUAGEPACKAGING_XML_DESCRIPTION="<h1>Extension - Componentbuilder Language Packaging (v.1.1.5)</h1> <div style='clear: both;'></div><p>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.</p><p>Created by <a href='https://dev.vdm.io' target='_blank'>Llewellyn van der Merwe</a><br /><small>Development started 12th October, 2019</small></p>"