瀏覽代碼

Added javascript variables for building URLs

spficklin 14 年之前
父節點
當前提交
3b539d15ec
共有 1 個文件被更改,包括 9 次插入0 次删除
  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');
 }