summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinc/lib_base.php12
-rwxr-xr-xinc/templates/header.php8
-rwxr-xr-xindex.php2
3 files changed, 19 insertions, 3 deletions
diff --git a/inc/lib_base.php b/inc/lib_base.php
index f30c85d7aec..f098e74c08e 100755
--- a/inc/lib_base.php
+++ b/inc/lib_base.php
@@ -86,7 +86,7 @@ $loginresult=OC_USER::loginlisener();
*
*/
class OC_USER {
-
+
/**
* check if the login button is pressed and logg the user in
*
@@ -125,6 +125,16 @@ class OC_USER {
*
*/
class OC_UTIL {
+ public static $scripts=array();
+
+ /**
+ * add a javascript file
+ *
+ * @param url $url
+ */
+ public static function addscript($url){
+ self::$scripts[]=$url;
+ }
/**
* array to store all the optional navigation buttons of the plugins
diff --git a/inc/templates/header.php b/inc/templates/header.php
index 66289a23ba9..2035aba538a 100755
--- a/inc/templates/header.php
+++ b/inc/templates/header.php
@@ -6,9 +6,15 @@
<base href="<?php echo($WEBROOT); ?>/"/>
<link rel="stylesheet" type="text/css" href="css/default.php"/>
<script type='text/ecmascript' src='<?php echo($WEBROOT)?>/js/lib_ajax.js'></script>
+<!-- <script type='text/ecmascript' src='<?php echo($WEBROOT)?>/js/timer.js'></script> -->
+<!-- <script type='text/ecmascript' src='<?php echo($WEBROOT)?>/js/notification.js'></script> -->
<script type='text/ecmascript' src='<?php echo($WEBROOT)?>/js/lib_xmlloader.js'></script>
<script type='text/ecmascript' src='<?php echo($WEBROOT)?>/js/lib_files.js'></script>
- <script type='text/ecmascript' src='<?php echo($WEBROOT)?>/js/ajax.js'></script>
+<?php
+foreach(OC_UTIL::$scripts as $script){
+ echo("<script type='text/ecmascript' src='$WEBROOT/$script'></script>");
+}
+?>
<script type='text/ecmascript'>
var WEBROOT='<?php echo($WEBROOT)?>';
</script>
diff --git a/index.php b/index.php
index b4a19dd0388..08d94c6079d 100755
--- a/index.php
+++ b/index.php
@@ -31,7 +31,7 @@ if(isset($_GET['file'])) {
}else{
-
+ OC_UTIL::addscript('js/ajax.js');
OC_UTIL::showheader();
OC_FILES::showbrowser($CONFIG_DATADIRECTORY,$dir);