From db77ef80c666ed84a9533204b73b71cddf16e402 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Fri, 1 Mar 2019 15:44:40 -0500 Subject: [PATCH] Now automatically loading setup/standardTemplateParams.php from each registered plugin if the file exists --- controllers/admin.php | 9 +++++++-- controllers/front.php | 9 +++++++-- readme.txt | 3 +++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/controllers/admin.php b/controllers/admin.php index 17e59ab4..1d65a063 100755 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -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) { diff --git a/controllers/front.php b/controllers/front.php index 5d6aa9ca..6e31620e 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -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) { diff --git a/readme.txt b/readme.txt index 9d2cac2e..c7d0ad76 100755 --- a/readme.txt +++ b/readme.txt @@ -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. -- 2.17.1