From c37702781e39d7bf321e6e2404001841f9cb9e8a Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Thu, 14 Oct 2021 16:31:53 +0200 Subject: [PATCH] update - v1.0.3 --- componentbuilderheaderscompiler.php | 52 ++++++++++++++++++- componentbuilderheaderscompiler.xml | 2 +- ...ension_componentbuilderheaderscompiler.ini | 2 +- ...on_componentbuilderheaderscompiler.sys.ini | 2 +- script.php | 4 +- 5 files changed, 55 insertions(+), 7 deletions(-) diff --git a/componentbuilderheaderscompiler.php b/componentbuilderheaderscompiler.php index 442faff..a495b53 100644 --- a/componentbuilderheaderscompiler.php +++ b/componentbuilderheaderscompiler.php @@ -22,7 +22,7 @@ JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/c * Extension - Componentbuilder Headers Compiler plugin. * * @package ComponentbuilderHeadersCompiler - * @since 1.0.2 + * @since 1.0.3 */ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin { @@ -46,7 +46,7 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin * The Targets * * @var array - * @since 1.0.0 + * @since 1.0.3 */ protected $targets = array( 'admin_view_headers' => @@ -94,6 +94,29 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin 'context' => 'site.views.model', 'view' => 'code' ) + ), + 'custom_admin_view_headers' => + array( + 'add_custom_admin_view_controller' => array( + 'field' => 'custom_admin_view_controller', + 'context' => 'custom.admin.view.controller', + 'view' => 'code' + ), + 'add_custom_admin_views_controller' => array( + 'field' => 'custom_admin_views_controller', + 'context' => 'custom.admin.views.controller', + 'view' => 'code' + ), + 'add_custom_admin_view_model' => array( + 'field' => 'custom_admin_view_model', + 'context' => 'custom.admin.view.model', + 'view' => 'code' + ), + 'add_custom_admin_views_model' => array( + 'field' => 'custom_admin_views_model', + 'context' => 'custom.admin.views.model', + 'view' => 'code' + ) ) ); @@ -152,6 +175,7 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin && ComponentbuilderHelper::checkJson($view->params)) ? json_decode( $view->params, true ) : $view->params; + // target site views if (ComponentbuilderHelper::checkArray($view->params) && isset($view->params['site_view_headers']) && ComponentbuilderHelper::checkArray( @@ -175,6 +199,30 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin } } } + // target custom admin veiws + if (ComponentbuilderHelper::checkArray($view->params) + && isset($view->params['custom_admin_view_headers']) + && ComponentbuilderHelper::checkArray( + $view->params['custom_admin_view_headers'] + )) + { + foreach ($this->targets['custom_admin_view_headers'] as $target => $event) + { + if (isset($view->params['custom_admin_view_headers'][$target]) + && $view->params['custom_admin_view_headers'][$target] == 1) + { + // activate the load of the privacy plugin + $this->loadClassHeaders = true; + // setup the view key name + $view_name = ComponentbuilderHelper::safeString( + $view->{$event['view']} + ); + // load the admin view details + $this->activeViews[$view_name][$event['context']] + = $view->params['custom_admin_view_headers'][$event['field']]; + } + } + } } /** diff --git a/componentbuilderheaderscompiler.xml b/componentbuilderheaderscompiler.xml index 599edb1..f99dfbc 100644 --- a/componentbuilderheaderscompiler.xml +++ b/componentbuilderheaderscompiler.xml @@ -7,7 +7,7 @@ http://www.joomlacomponentbuilder.com Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 1.0.2 + 1.0.3 PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_XML_DESCRIPTION diff --git a/language/en-GB/en-GB.plg_extension_componentbuilderheaderscompiler.ini b/language/en-GB/en-GB.plg_extension_componentbuilderheaderscompiler.ini index 1820116..02304f2 100644 --- a/language/en-GB/en-GB.plg_extension_componentbuilderheaderscompiler.ini +++ b/language/en-GB/en-GB.plg_extension_componentbuilderheaderscompiler.ini @@ -2,6 +2,6 @@ PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER="Extension - Componentbuilder Head 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="

Extension - Componentbuilder Headers Compiler (v.1.0.2)

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. +PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_XML_DESCRIPTION="

Extension - Componentbuilder Headers Compiler (v.1.0.3)

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.

Created by Llewellyn van der Merwe
Development started 24th May, 2020

" \ No newline at end of file diff --git a/language/en-GB/en-GB.plg_extension_componentbuilderheaderscompiler.sys.ini b/language/en-GB/en-GB.plg_extension_componentbuilderheaderscompiler.sys.ini index 1820116..02304f2 100644 --- a/language/en-GB/en-GB.plg_extension_componentbuilderheaderscompiler.sys.ini +++ b/language/en-GB/en-GB.plg_extension_componentbuilderheaderscompiler.sys.ini @@ -2,6 +2,6 @@ PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER="Extension - Componentbuilder Head 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="

Extension - Componentbuilder Headers Compiler (v.1.0.2)

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. +PLG_EXTENSION_COMPONENTBUILDERHEADERSCOMPILER_XML_DESCRIPTION="

Extension - Componentbuilder Headers Compiler (v.1.0.3)

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.

Created by Llewellyn van der Merwe
Development started 24th May, 2020

" \ No newline at end of file diff --git a/script.php b/script.php index 97c2356..5b5376e 100644 --- a/script.php +++ b/script.php @@ -60,8 +60,8 @@ class plgExtensionComponentbuilderHeadersCompilerInstallerScript { // get the version $jcbVersion = explode('.', $manifest->version); - // check that we have JCB 2.11.7 or higher installed - if (count($jcbVersion) == 3 && $jcbVersion[0] >= 2 && $jcbVersion[1] >= 11 && (($jcbVersion[1] == 11 && $jcbVersion[2] >= 7) || ($jcbVersion[1] > 11))) + // check that we have JCB 2.12.1 or higher installed + if (count($jcbVersion) == 3 && $jcbVersion[0] >= 2 && $jcbVersion[1] > 11) { $blockInstall = false; }