fix to work with path containing a query

This commit is contained in:
Ralf Becker 2011-08-21 20:01:10 +00:00
parent 7b89481b76
commit 750f80b23b

View File

@ -15,11 +15,11 @@
/** /**
* Syntax for including JS files form others * Syntax for including JS files form others
* ----------------------------------------- * -----------------------------------------
* *
* Write a comment starting with "/*egw:uses". A linebreak has to follow. * Write a comment starting with "/*egw:uses". A linebreak has to follow.
* Then write all files which have to be included seperated by ";". A JS file * Then write all files which have to be included seperated by ";". A JS file
* include may have the following syntax: * include may have the following syntax:
* *
* 1) File in the same directory as the current file. Simply write the filename * 1) File in the same directory as the current file. Simply write the filename
* without ".js". Example: * without ".js". Example:
* egw_action; * egw_action;
@ -30,9 +30,9 @@
* stylite.filemanager.filemanager; // Loads /stylite/filemanager/filemanager.js * stylite.filemanager.filemanager; // Loads /stylite/filemanager/filemanager.js
* 3) Absolute file paths starting with "/". Example: * 3) Absolute file paths starting with "/". Example:
* /phpgwapi/js/jquery/jquery-ui.js; * /phpgwapi/js/jquery/jquery-ui.js;
* *
* Comments can be started with "//". * Comments can be started with "//".
* *
* Complete example of such an uses-clause: * Complete example of such an uses-clause:
* /*egw:uses * /*egw:uses
* egw_action_common; * egw_action_common;
@ -263,7 +263,7 @@ class egw_include_mgr
*/ */
private function translate_params($package, $file, $app) private function translate_params($package, $file, $app)
{ {
if ($package[0] == '/' && is_readable(EGW_SERVER_ROOT.($path = $package)) || if ($package[0] == '/' && is_readable(EGW_SERVER_ROOT.(parse_url($path = $package, PHP_URL_PATH))) ||
is_readable(EGW_SERVER_ROOT.($path="/$app/js/$package/$file.js")) || is_readable(EGW_SERVER_ROOT.($path="/$app/js/$package/$file.js")) ||
$app != 'phpgwapi' && is_readable(EGW_SERVER_ROOT.($path="/phpgwapi/js/$package/$file.js"))) $app != 'phpgwapi' && is_readable(EGW_SERVER_ROOT.($path="/phpgwapi/js/$package/$file.js")))
{ {