Move CRM.url init out of template CRM-12339
authorColeman Watts <coleman@civicrm.org>
Sat, 13 Apr 2013 20:57:18 +0000 (13:57 -0700)
committerColeman Watts <coleman@civicrm.org>
Sun, 14 Apr 2013 00:56:11 +0000 (17:56 -0700)
CRM/Core/Resources.php
templates/CRM/common/scripts.tpl

index c6a1096d69dedd89d4301fa7bf2a4349c134746a..e2f18b9a7fc3c6926d117c5355c9c7954954b836 100644 (file)
@@ -445,6 +445,11 @@ class CRM_Core_Resources {
         }
       }
 
+      // Initialize CRM.url
+      $url = CRM_Utils_System::url('civicrm/example', 'placeholder', FALSE, NULL, FALSE);
+      $js = "CRM.url('init', '$url');";
+      $this->addScript($js, $jsWeight++, $region);
+
       // Give control of jQuery back to the CMS - this loads last
       $this->addScriptFile('civicrm', 'js/noconflict.js', 9999, $region, FALSE);
 
index 26ba526b1da09c857e718f0805eb28a18eb4e85b..1d9dfb154b52dea78594e47f3445a52b4ef6e825 100644 (file)
@@ -25,9 +25,6 @@
 *}
 
 <script type="text/javascript">
-  {* Initialize CRM.url *}
-  CRM.url('init', '{crmURL p="civicrm/example" q="placeholder" h=0 }');
-
 {*/*
  * Here we define the CRM object,
  * A single global variable to hold everything that needs to be accessed from the global scope