Removed unnecessary flag variable in template.
authorFrank J. Gómez <frank@ginkgostreet.com>
Mon, 10 Aug 2015 03:57:51 +0000 (23:57 -0400)
committerFrank J. Gómez <frank@ginkgostreet.com>
Mon, 10 Aug 2015 03:57:51 +0000 (23:57 -0400)
Civi/Angular/Page/Main.php
templates/Civi/Angular/Page/Main.tpl

index c01da3d4938fceecee6914d374897b744bdc5959..8f60319f5695eaea103c9d4cb9a19ebc709b29b7 100644 (file)
@@ -109,11 +109,9 @@ class Main extends \CRM_Core_Page {
       }
     }
 
-    //This will enable setting of the lacation hash so that Angular knows
-    //Which page it is trying to load.
-    $this->assign("setRoute", ($this->region == "ajax-snippet"));
-    if($this->region == "ajax-snippet") {
-      $this->assign("route", $_REQUEST['route']);
-    }
+    // Set the location hash so that Angular knows which page it is trying to load.
+    $route = \CRM_Utils_Request::retrieve('route', 'String');
+    $this->assign("route", $route);
   }
+
 }
index 271124e4fcd1bf3bed81177ced11026b26cd51da..c547e66f15d3c9bd93e40fe2afe2ccbc8e6723a5 100644 (file)
@@ -1,7 +1,7 @@
-{if $setRoute}
-    <script type="text/javascript">
-        location.hash = '{$route}';
-    </script>
+{if $route}
+  <script type="text/javascript">
+    location.hash = '{$route}';
+  </script>
 {/if}
 {literal}
 <div ng-app="crmApp">