added option to load js files from php

This commit is contained in:
Robin 2010-03-28 13:07:13 +02:00
parent 4ff703e9ab
commit f16f1e508f
3 changed files with 19 additions and 3 deletions

View File

@ -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

View File

@ -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>

View File

@ -31,7 +31,7 @@ if(isset($_GET['file'])) {
}else{
OC_UTIL::addscript('js/ajax.js');
OC_UTIL::showheader();
OC_FILES::showbrowser($CONFIG_DATADIRECTORY,$dir);