From: Chuck Scott Date: Tue, 1 Mar 2016 16:38:08 +0000 (-0500) Subject: Cleaned up incompatible template references to URL/Url. X-Git-Tag: v2.0.0^2~60 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9fc54e2aba5fab65d5927cd49af45eb09602f91b;p=WP-Plugins%2Fglm-member-db.git Cleaned up incompatible template references to URL/Url. --- diff --git a/controllers/admin.php b/controllers/admin.php index 9e505102..df2c81e0 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -826,20 +826,7 @@ class glmMembersAdmin extends GlmPluginSupport $smarty->template->addTemplateDir(GLM_MEMBERS_WORDPRESS_PLUGIN_PATH . "$plugIn/views"); // Add standard template parameters - $smarty->templateAssign ( 'addOnTabs', $addOnTabs); - $smarty->templateAssign ( 'adminDebug', GLM_MEMBERS_PLUGIN_ADMIN_DEBUG); - $smarty->templateAssign ( 'adminURL', GLM_MEMBERS_PLUGIN_ADMIN_URL); - $smarty->templateAssign ( 'siteBaseURL', GLM_MEMBERS_SITE_BASE_URL); - $smarty->templateAssign ( 'baseURL', GLM_MEMBERS_PLUGIN_BASE_URL); - $smarty->templateAssign ( 'thisURL', GLM_MEMBERS_PLUGIN_CURRENT_URL ); - $smarty->templateAssign ( 'thisPage', (isset($_REQUEST['page']) ? $_REQUEST['page']: '') ); - $smarty->templateAssign ( 'glmPluginName', GLM_MEMBERS_PLUGIN_NAME ); - $smarty->templateAssign ( 'glmPluginMediaURL', GLM_MEMBERS_PLUGIN_MEDIA_URL ); - $smarty->templateAssign ( 'glmWordpresBasePluginPath', GLM_MEMBERS_WORDPRESS_PLUGIN_PATH ); - $smarty->templateAssign ( 'thisYear', date ( 'Y' ) ); - $smarty->templateAssign ( 'ref_type_numb', $this->config['ref_type_numb']); - $smarty->templateAssign ( 'settings', $this->config['settings']); - $smarty->templateAssign ( 'terms', $this->config['terms']); + require GLM_MEMBERS_PLUGIN_SETUP_PATH.'/standardTemplateParams.php'; // 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 bb093fd8..35608d73 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -447,18 +447,7 @@ class glmMembersFront extends GlmPluginSupport $smarty->template->setTemplateDir($viewPath); // Add standard parameters - $smarty->templateAssign ( 'errorMsg', $errorMsg); - $smarty->templateAssign ( 'frontDebug', GLM_MEMBERS_PLUGIN_FRONT_DEBUG); - $smarty->templateAssign ( 'siteBaseUrl', GLM_MEMBERS_SITE_BASE_URL); - $smarty->templateAssign ( 'baseURL', GLM_MEMBERS_PLUGIN_BASE_URL); - $smarty->templateAssign ( 'thisURL', GLM_MEMBERS_PLUGIN_CURRENT_URL ); - $smarty->templateAssign ( 'glmPluginName', GLM_MEMBERS_PLUGIN_NAME ); - $smarty->templateAssign ( 'glmPluginMediaURL', GLM_MEMBERS_PLUGIN_MEDIA_URL ); - $smarty->templateAssign ( 'ref_type_numb', $this->config['ref_type_numb']); - $smarty->templateAssign ( 'thisYear', date ( 'Y' ) ); - $smarty->templateAssign ( 'settings', $this->config['settings']); - $smarty->templateAssign ( 'terms', $this->config['terms']); - $smarty->templateAssign('thisAction', $action); + require GLM_MEMBERS_PLUGIN_SETUP_PATH.'/standardTemplateParams.php'; // Add data from model to Smarty template if (is_array($results['data']) && count($results['data']) > 0) { diff --git a/setup/standardTemplateParams.php b/setup/standardTemplateParams.php new file mode 100644 index 00000000..b5090be5 --- /dev/null +++ b/setup/standardTemplateParams.php @@ -0,0 +1,58 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +/* + * Standard template parameters available to all templates + * + * This file is "required" by both the front and admin controllers + * inside the controller() function. As such, this runs in the + * context of those controllers. + * + */ + +// Common to both admin and front-end +$smarty->templateAssign('glmPluginName', GLM_MEMBERS_PLUGIN_NAME ); +$smarty->templateAssign('siteBaseUrl', GLM_MEMBERS_SITE_BASE_URL); +$smarty->templateAssign('baseUrl', GLM_MEMBERS_PLUGIN_BASE_URL); +$smarty->templateAssign('thisUrl', GLM_MEMBERS_PLUGIN_CURRENT_URL ); +$smarty->templateAssign('glmPluginMediaUrl', GLM_MEMBERS_PLUGIN_MEDIA_URL ); +$smarty->templateAssign('thisPage', (isset($_REQUEST['page']) ? $_REQUEST['page']: '') ); +$smarty->templateAssign('glmWordpresBasePluginPath', GLM_MEMBERS_WORDPRESS_PLUGIN_PATH ); +$smarty->templateAssign('thisYear', date ( 'Y' ) ); +$smarty->templateAssign('ref_type_numb', $this->config['ref_type_numb']); +$smarty->templateAssign('settings', $this->config['settings']); +$smarty->templateAssign('terms', $this->config['terms']); + + +if (is_admin()) { + + // Admin specific + $smarty->templateAssign('adminDebug', GLM_MEMBERS_PLUGIN_ADMIN_DEBUG); + $smarty->templateAssign('addOnTabs', $addOnTabs); + $smarty->templateAssign('adminUrl', GLM_MEMBERS_PLUGIN_ADMIN_URL); + +} else { + + // Front specific + $smarty->templateAssign('frontDebug', GLM_MEMBERS_PLUGIN_FRONT_DEBUG); + $smarty->templateAssign('errorMsg', $errorMsg); + $smarty->templateAssign('thisAction', $action); + +} + + + + + diff --git a/views/admin/dashboardWidget/index.html b/views/admin/dashboardWidget/index.html index 9e524dae..883d3461 100644 --- a/views/admin/dashboardWidget/index.html +++ b/views/admin/dashboardWidget/index.html @@ -29,7 +29,7 @@ html: true, select: function( event, ui ) { var memberID = ui.item.id; - window.location.replace("{$adminURL}?page=glm-members-admin-menu-member&glm_action=index&member=" + memberID ); + window.location.replace("{$adminUrl}?page=glm-members-admin-menu-member&glm_action=index&member=" + memberID ); }, response: function(event, ui) { if (!ui.content.length) { @@ -50,40 +50,40 @@ {if !$haveMemberTypes} No Member Types - Add + Add {/if} {if !$haveCategories} No Member Categories - Add + Add {/if} {if !$haveAmenities} No Amenities - Add + Add {/if} {if !$haveCities} No Cities - Add + Add {/if} {if !$haveRegions} No Regions - Add + Add {/if} {if $numbMembers == 0} No Members - Add a Member + Add a Member {/if} - Number of Members Listed: List Members{$numbMembers} + Number of Members Listed: List Members{$numbMembers} {if $haveBadLatLon} @@ -100,7 +100,7 @@ {/if} - {$p.member}: {$p.reference_name} + {$p.member}: {$p.reference_name} {/foreach} @@ -125,7 +125,7 @@ {/if} - {$p.member}: + {$p.member}: {$p.reference_name} diff --git a/views/admin/management/development.html b/views/admin/management/development.html index 9687cbb1..74c00994 100644 --- a/views/admin/management/development.html +++ b/views/admin/management/development.html @@ -10,7 +10,7 @@