Explorar o código

Added javascript variables for building URLs

spficklin %!s(int64=14) %!d(string=hai) anos
pai
achega
3b539d15ec
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      tripal_core/tripal_core.module

+ 9 - 0
tripal_core/tripal_core.module

@@ -48,6 +48,15 @@ function tripal_core_init(){
       }  
       tripal_db_set_active($previous_db);  // now use drupal database
    }
+
+   // add some variables for all javasript to use for building URLs
+   global $base_url;
+   $theme_dir = drupal_get_path('theme', 'tripal');
+   $clean_urls  = variable_get('clean_url', 0);
+   drupal_add_js("
+      var baseurl = '$base_url'; 
+      var themedir = '$theme_dir'; 
+      var isClean = $clean_urls;",'inline');
 }