Fixing Member website links
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 20 Aug 2014 15:22:56 +0000 (11:22 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 20 Aug 2014 15:24:42 +0000 (11:24 -0400)
Remove the external js file if they are on a member page.
Fix member urls so they can use https.

Toolkit/Members/ProfilePage.php
Toolkit/Members/SearchList.php
Toolkit/Page.php
Toolkit/Template/Page/Member.php

index 7107e45..736627d 100644 (file)
@@ -577,7 +577,10 @@ class Toolkit_Members_ProfilePage
             $page->toll_free   = $row['toll_free'];
             $page->fax         = $row['fax'];
             $page->email       = $row['member_contact_email'];
-            if (($row['url']) && strpos($row['url'], 'http://') === false) {
+            if (($row['url'])
+                && strpos($row['url'], 'http://') === false
+                && strpos($url, 'https://') === false
+            ) {
                 $row['url'] = 'http://' . $row['url'];
             }
             $page->url         = $row['url'];
index e73874c..e66a649 100644 (file)
@@ -757,7 +757,9 @@ class Toolkit_Members_SearchList extends Toolkit_FlexyDataGridBuilder
             return false;
         }
         // make sure the url has http://
-        if (strpos($url, 'http://') === false) {
+        if (strpos($url, 'http://') === false
+            && strpos($url, 'https://') === false
+        ) {
             $url = 'http://' . $url;
         }
         return $url;
index 93b7597..8fc8f36 100755 (executable)
@@ -162,7 +162,7 @@ class Toolkit_Page
         $GLOBALS['bottomScripts'][] = MEDIA_BASE_URL . 'js/pageSetup.js';
         $GLOBALS['styleSheets'][] = $this->mediaBaseURL . 'fancybox/jquery.fancybox.css';
         $GLOBALS['bottomScripts'][] = $this->mediaBaseURL . "fancybox/jquery.fancybox.js";
-        $GLOBALS['bottomScripts'][] = $this->glmAppBaseURL . 'libjs/external.js';
+        $GLOBALS['bottomScripts']['external'] = $this->glmAppBaseURL . 'libjs/external.js';
     }
 
     /**
index 5df0cf0..993a80a 100644 (file)
@@ -326,6 +326,7 @@ class Toolkit_Template_Page_Member
      */
     public function getContent()
     {
+        unset($GLOBALS['bottomScripts']['external']);
         $GLOBALS['bottomScripts'][] = MEDIA_APP_BASE_URL . 'libjs/member-link.js';
         $breadCrumbsBuilder         = $this->breadCrumbsFactory->createBreadCrumbsHelper();
         $page                       = $this->pageGateway->find($this->id);