Added post processing to dataMemberInfo.php to force http:// to the beginning of...
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 26 Feb 2018 18:04:52 +0000 (13:04 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 26 Feb 2018 18:04:52 +0000 (13:04 -0500)
Also started adding page top text capability - not outputting yet.

classes/data/dataMemberInfo.php
controllers/admin.php
views/admin/adminPageText.html [new file with mode: 0644]

index 914aa92..3b4731f 100644 (file)
@@ -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 = "
index 4a8a71e..611838d 100644 (file)
@@ -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 (file)
index 0000000..f0f7cf7
--- /dev/null
@@ -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