Now automatically loading setup/standardTemplateParams.php from each registered plugi...
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 1 Mar 2019 20:44:40 +0000 (15:44 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 1 Mar 2019 20:44:40 +0000 (15:44 -0500)
controllers/admin.php
controllers/front.php
readme.txt

index 17e59ab..1d65a06 100755 (executable)
@@ -368,8 +368,13 @@ class glmMembersAdmin extends GlmPluginSupport
         // Load Smarty Template support
         $smarty = new smartyTemplateSupport();
 
-        // Add standard template parameters
-        require GLM_MEMBERS_PLUGIN_SETUP_PATH.'/standardTemplateParams.php';
+        // Add standard parameters from any registered plugin/add-on that has a standardTemplateParams.php file
+        foreach ($this->config['addOns'] as $a) {
+            $paramsScript = $a['dir'].'/setup/standardTemplateParams.php';
+            if (is_file($paramsScript)) {
+                require_once $paramsScript;
+            }
+        }
 
         // Add data from model to Smarty template
         if (is_array($results['data']) && count($results['data']) > 0) {
index 5d6aa9c..6e31620 100644 (file)
@@ -660,8 +660,13 @@ class glmMembersFront extends GlmPluginSupport
         // Load Smarty Template support
         $smarty = new smartyTemplateSupport();
 
-        // Add standard parameters
-        require GLM_MEMBERS_PLUGIN_SETUP_PATH.'/standardTemplateParams.php';
+        // Add standard parameters from any registered plugin/add-on that has a standardTemplateParams.php file
+        foreach ($this->config['addOns'] as $a) {
+            $paramsScript = $a['dir'].'/setup/standardTemplateParams.php';
+            if (is_file($paramsScript)) {
+                require_once $paramsScript;
+            }
+        }
 
         // Add data from model to Smarty template
         if (is_array($results['data']) && count($results['data']) > 0) {
index 9d2cac2..c7d0ad7 100755 (executable)
@@ -66,6 +66,9 @@ There is of course much more to this.
 (none)
 
 == Changelog ==
+= (pending) =
+* Now automatically loading setup/standardTemplateParams.php from each registered plugin if the file exists
+
 = 2.11.1 - 2 =
 * Bug fixes in the smarty templates.