diff --git a/componentbuilderheaderscompiler.php b/componentbuilderheaderscompiler.php
index 9aa6142..2da5d69 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.9
+ * @since 1.0.10
*/
class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
{
@@ -391,6 +391,23 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
}
}
+ /**
+ * Event Triggered in the compiler [on Before Model Dynamic Get Data]
+ *
+ * @return void
+ *
+ * @since 1.0.10
+ */
+ public function jcb_ce_onBeforeModelDynamicGetData(&$context, &$dynamicGet, &$id, &$code, &$area)
+ {
+ // check that the params are set
+ if (isset($dynamicGet->params))
+ {
+ // add the headers for the Site Views
+ $this->setDynamicHeaders($dynamicGet->params, $code, 'dynamic_get_headers');
+ }
+ }
+
/**
* Event Triggered in the compiler [on Before Model Component Data]
*
@@ -512,6 +529,37 @@ class PlgExtensionComponentbuilderHeadersCompiler extends CMSPlugin
}
}
+ /**
+ * set the dynamic get headers
+ *
+ * @return void
+ *
+ * @since 1.0.10
+ */
+ protected function setDynamicHeaders($params, $code, $key)
+ {
+ // add the headers
+ $params = (ComponentbuilderHelper::checkJson($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]))
+ {
+ foreach ($this->targets[$key] as $target => $event)
+ {
+ if (isset($params[$key][$target])
+ && $params[$key][$target] == 1)
+ {
+ // get the header string if set
+ $this->getHeaders(
+ $params[$key],
+ $event,
+ $code
+ );
+ }
+ }
+ }
+ }
+
/**
* get the headers
*
diff --git a/componentbuilderheaderscompiler.xml b/componentbuilderheaderscompiler.xml
index 3481a54..4b0fec2 100644
--- a/componentbuilderheaderscompiler.xml
+++ b/componentbuilderheaderscompiler.xml
@@ -7,7 +7,7 @@
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="
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
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="
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