From: Chuck Scott Date: Fri, 26 Jan 2018 15:31:35 +0000 (-0500) Subject: Added Smarty debgug window to output when admin verbose debug enabled. X-Git-Tag: v2.10.23^2~12 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=3588f031569bbf73a8436b25c0b40d7af46b41bd;p=WP-Plugins%2Fglm-member-db.git Added Smarty debgug window to output when admin verbose debug enabled. --- diff --git a/controllers/admin.php b/controllers/admin.php index 3aeb9764..54792e83 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -122,11 +122,11 @@ class glmMembersAdmin extends GlmPluginSupport */ public function __construct ($wpdb, $config) { - + if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + // Save WordPress Database object $this->wpdb = $wpdb; @@ -233,11 +233,11 @@ class glmMembersAdmin extends GlmPluginSupport } } - + if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + } /** @@ -257,7 +257,7 @@ class glmMembersAdmin extends GlmPluginSupport if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + // Get the model action if (isset($_REQUEST['glm_action']) && $_REQUEST['glm_action'] != '') { $glmAction = sanitize_text_field($_REQUEST['glm_action']); @@ -379,11 +379,11 @@ class glmMembersAdmin extends GlmPluginSupport // Generate output from model data and view $smarty->template->display($viewFile); - + if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + exit; // Need to test if this is here for a reason! wp_die(); @@ -694,7 +694,7 @@ class glmMembersAdmin extends GlmPluginSupport if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + // Enque admin scripts and css here so that only happens when we're doing something $this->glmMembersAdminScripts(); @@ -820,7 +820,7 @@ class glmMembersAdmin extends GlmPluginSupport $className = 'GlmMembersAdmin_' . $menuItem . '_' . $action; $loopTracking .= "

Loop: $loopCheck
Model: $modelName
Class: $className

"; if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - trigger_error("Notice: Model: ".$modelName, E_USER_NOTICE); + trigger_error("Model: ".$modelName, E_USER_NOTICE); } // Create hook to add page tabs by add-on plugins @@ -898,7 +898,7 @@ class glmMembersAdmin extends GlmPluginSupport $badView = false; if ($view) { if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - trigger_error("Notice: View: ".$view, E_USER_NOTICE); + trigger_error("View: ".$view, E_USER_NOTICE); } // Get the specified view file - check theme first @@ -1009,13 +1009,6 @@ class glmMembersAdmin extends GlmPluginSupport $smarty->templateAssign('errorMsg', $errorMsg); } - // If view debug has been requested - if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { - - $x = $smarty->template->getTemplateVars(); - - } - // Update the Smarty view path - *** NEEED TO FIX THIS TO SUPPORT THEME VIEWS SOMEHOW **** $smarty->template->addTemplateDir($viewPath); @@ -1031,8 +1024,9 @@ class glmMembersAdmin extends GlmPluginSupport if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); + $smarty->template->display( 'admin/smartyDebug.html'); } - + if ( $returnOutput ) { return $output; } diff --git a/controllers/front.php b/controllers/front.php index 97ffbd6c..4e3e7024 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -43,7 +43,7 @@ class glmMembersFront extends GlmPluginSupport if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + // Save WordPress Database object $this->wpdb = $wpdb; @@ -101,11 +101,11 @@ class glmMembersFront extends GlmPluginSupport // Add filters for use anywhere else (apply_filter). Will have to add this to index.php eventually add_filter('glmMembersFrontScriptsFilter',array($this,'glmMembersFrontScripts')); add_action('glmMembersFrontCSSFilter',array($this,'glmMembersFrontCSS')); - + if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + } /** @@ -287,7 +287,7 @@ class glmMembersFront extends GlmPluginSupport if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + // Start with no cache_code - This prevents caching for subordinate controller hits $cache_code = false; @@ -672,7 +672,7 @@ class glmMembersFront extends GlmPluginSupport if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE); } - + return $out; } diff --git a/views/admin/members/list.html b/views/admin/members/list.html index 3d70b16a..a2d0af6f 100644 --- a/views/admin/members/list.html +++ b/views/admin/members/list.html @@ -1,3 +1,4 @@ +{debug} {include file='admin/members/header.html'}
diff --git a/views/admin/smartyDebug.html b/views/admin/smartyDebug.html new file mode 100644 index 00000000..0f2bdc19 --- /dev/null +++ b/views/admin/smartyDebug.html @@ -0,0 +1 @@ +{debug} \ No newline at end of file