summaryrefslogtreecommitdiff
path: root/itjs.class
diff options
context:
space:
mode:
authorChristian Schneider2007-10-18 12:42:31 +0000
committerChristian Schneider2007-10-18 12:42:31 +0000
commit3aee6d57f18ae1d43d5f6b141fc9e5a22bea4f39 (patch)
tree9147b1619001c1d19a8164e4f88d70b677bad13a /itjs.class
parent3f1dbb8bc67b578266ca679e572eca0c90a23876 (diff)
downloaditools-3aee6d57f18ae1d43d5f6b141fc9e5a22bea4f39.tar.gz
itools-3aee6d57f18ae1d43d5f6b141fc9e5a22bea4f39.tar.bz2
itools-3aee6d57f18ae1d43d5f6b141fc9e5a22bea4f39.zip
Also support css files through ITools Joining Service(TM)
Diffstat (limited to 'itjs.class')
-rw-r--r--itjs.class31
1 files changed, 16 insertions, 15 deletions
diff --git a/itjs.class b/itjs.class
index f54bb18..bbeb618 100644
--- a/itjs.class
+++ b/itjs.class
@@ -103,23 +103,24 @@ function encode($values)
function filenames($filelist)
{
$result = array();
-
- $files = array_flip(explode(",", it::replace(array('\?.*' => ""), $filelist)));
- $itools = array_flip(array("it.js", "loader.js", "state.js", "timer.js"));
- $plainfiles = array_flip(array("boot.js", "state.html", "error.gif"));
-
- if (isset($files['itools']))
+ $path = $GLOBALS['ULTRAHOME'] . "/itjs";
+ $itjs = "/www/server/phpinclude/itools/itjs";
+ $searchlib = "/www/lib.search.ch/doc";
+ $special = array(
+ "itools" => "$itjs/it.js,$itjs/loader.js,$itjs/state.js,$itjs/timer.js",
+ "boot.js" => "$itjs/boot.js",
+ "state.html" => "$itjs/state.html",
+ "error.gif" => "$itjs/error.gif",
+ "search.css" => "$searchlib/search.css",
+ "prettyprint.css" => "$searchlib/prettyprint.css",
+ );
+
+ foreach (explode(",", it::replace(array('\?.*' => ""), $filelist)) as $file)
{
- unset($files['itools']);
- $files = $itools + $files; # Order is important!
- }
+ $filenames = $special[$file] ? $special[$file] : "$path/$file";
- foreach (array_keys($files) as $file)
- {
- if (isset($itools[$file]) || isset($plainfiles[$file]))
- $result[] = "/www/server/phpinclude/itools/itjs/$file";
- else
- $result[] = $GLOBALS['ULTRAHOME'] . "/itjs/$file";
+ foreach (explode(",", $filenames) as $filename)
+ $result[] = $filename;
}
return $result;