Call standard template params in each plugin
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 17 Jun 2019 17:46:19 +0000 (13:46 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 17 Jun 2019 17:46:19 +0000 (13:46 -0400)
So each plugin can have standard params in smarty.

controllers/admin.php

index cbbfe92..3be5f69 100755 (executable)
@@ -385,6 +385,14 @@ class glmMembersAdmin extends GlmPluginSupport
         // Add standard template parameters
         require GLM_MEMBERS_PLUGIN_SETUP_PATH . '/standardTemplateParams.php';
 
+        // Add standard template parameters for plugins
+        foreach ( $this->config['addOns'] as $a ) {
+            $stdTempFile = $a['dir'].'/setup/standardTemplateParams.php';
+            if ( is_file( $stdTempFile ) ) {
+                require_once $stdTempFile;
+            }
+        }
+
         // Add data from model to Smarty template
         if ( is_array( $results['data'] ) && count( $results['data'] ) > 0 ) {
             foreach ( $results['data'] as $k=>$d ) {
@@ -1080,6 +1088,13 @@ class glmMembersAdmin extends GlmPluginSupport
         // Add standard template parameters
         require GLM_MEMBERS_PLUGIN_SETUP_PATH . '/standardTemplateParams.php';
 
+        // Add standard template parameters for plugins
+        foreach ( $this->config['addOns'] as $a ) {
+            $stdTempFile = $a['dir'].'/setup/standardTemplateParams.php';
+            if ( is_file( $stdTempFile ) ) {
+                require_once $stdTempFile;
+            }
+        }
         // Add data from model to Smarty template
         if ( is_array( $results['data'] ) && count( $results['data'] ) > 0 ) {
             foreach ( $results['data'] as $k=>$d ) {