From 9fc54e2aba5fab65d5927cd49af45eb09602f91b Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 1 Mar 2016 11:38:08 -0500 Subject: [PATCH] Cleaned up incompatible template references to URL/Url. --- controllers/admin.php | 15 +---- controllers/front.php | 13 +---- setup/standardTemplateParams.php | 58 +++++++++++++++++++ views/admin/dashboardWidget/index.html | 20 +++---- views/admin/management/development.html | 16 ++--- views/admin/management/header.html | 14 ++--- views/admin/management/import.html | 2 +- .../admin/management/import/readDatabase.html | 2 +- views/admin/management/index.html | 2 +- views/admin/management/terms.html | 2 +- views/admin/member/header.html | 4 +- views/admin/member/index.html | 16 ++--- views/admin/member/memberEdit.html | 8 +-- views/admin/member/memberInfo.html | 20 +++---- views/admin/members/header.html | 6 +- views/admin/members/index.html | 20 +++---- views/admin/members/list.html | 11 ++-- views/admin/settings/amenities.html | 6 +- views/admin/settings/categories.html | 6 +- views/admin/settings/cities.html | 6 +- views/admin/settings/header.html | 12 ++-- views/admin/settings/index.html | 8 +-- views/admin/settings/regions.html | 6 +- views/front/members/detail.html | 12 ++-- views/front/members/list.html | 10 ++-- 25 files changed, 165 insertions(+), 130 deletions(-) create mode 100644 setup/standardTemplateParams.php 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 @@