From 304375367444febe6dabdfc35dfb6eae19ff4357 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 26 Feb 2018 13:04:52 -0500 Subject: [PATCH] Added post processing to dataMemberInfo.php to force http:// to the beginning of URLs. Also started adding page top text capability - not outputting yet. --- classes/data/dataMemberInfo.php | 9 ++++++++- controllers/admin.php | 11 +++++++++-- views/admin/adminPageText.html | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 views/admin/adminPageText.html diff --git a/classes/data/dataMemberInfo.php b/classes/data/dataMemberInfo.php index 914aa92b..3b4731fd 100644 --- a/classes/data/dataMemberInfo.php +++ b/classes/data/dataMemberInfo.php @@ -556,7 +556,6 @@ class GlmDataMemberInfo extends GlmDataAbstract if ($r['lat'] == 0 || $r['lon'] == 0) { $r['bad_lat_lon'] = true; } - } // Only run these tests for 'l' (getList), 'g' (getEntry), 'e' (editEntry), 'u' (updateEntry) @@ -564,6 +563,14 @@ class GlmDataMemberInfo extends GlmDataAbstract return $r; } + // Check that URLs have http:// in front of them. + if (strtolower(substr($r['url'],0,4)) != 'http') { + $r['url'] = 'http://'.$r['url']; + } + if (strtolower(substr($r['reservation_url'],0,4)) != 'http') { + $r['reservation_url'] = 'http://'.$r['reservation_url']; + } + // Get Amenity Data for this entry if ($this->doPostProcessing || $this->postProcessAmenity) { $sql = " diff --git a/controllers/admin.php b/controllers/admin.php index 4a8a71ea..611838df 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -998,6 +998,12 @@ class glmMembersAdmin extends GlmPluginSupport // Load Smarty Template support $smarty = new smartyTemplateSupport(); + // Build Admin Page Text using "adminPageText.html". That template should include a pop-up form and display any selected text. + $pageTopText = ''; + // **** NEED TO GET PAGE TOP TEXT HERE **** + $smarty->templateAssign( 'glmAdminPageTopText', $pageTopText); + $output = $smarty->template->fetch('admin/adminPageText.html'); + // Add standard template parameters require GLM_MEMBERS_PLUGIN_SETUP_PATH.'/standardTemplateParams.php'; @@ -1015,13 +1021,14 @@ class glmMembersAdmin extends GlmPluginSupport $smarty->templateAssign('errorMsg', $errorMsg); } - // Update the Smarty view path - *** NEEED TO FIX THIS TO SUPPORT THEME VIEWS SOMEHOW **** + // Update the Smarty view path $smarty->template->addTemplateDir($viewPath); // Generate output from model data and view if ( $returnOutput ) { - $output = $smarty->template->fetch( $viewFile ); + $output = $output.$smarty->template->fetch( $viewFile ); } else { + echo $output; $smarty->template->display( $viewFile ); } diff --git a/views/admin/adminPageText.html b/views/admin/adminPageText.html new file mode 100644 index 00000000..f0f7cf7d --- /dev/null +++ b/views/admin/adminPageText.html @@ -0,0 +1,2 @@ +{* This is a template for entering and displaying text on the top of each admin page. Included by admin controller. *} +{* Needs to be developed. Admin Controller needs to get page top text if any and it should be displayed here along with a form accessible by a button to add or edit text. *} \ No newline at end of file -- 2.17.1