mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: use dol_buildpath
Fix: add .css and .js extension
This commit is contained in:
parent
026bb66ddd
commit
da736ec2c2
|
|
@ -116,7 +116,7 @@ function dol_buildpath($path,$mode=0)
|
|||
// FIXME Trying to know if a file on disk exist by forging path on disk from url
|
||||
// works only for some web server and some setup. This is bugged when
|
||||
// using proxy, rewriting, virtual path, etc...
|
||||
preg_match('/^([^.]+(\.css)?\.php)/i',$path,$regs);
|
||||
preg_match('/^([^.]+(\.css)?(\.php)?(\.js)?)/i',$path,$regs);
|
||||
if (! empty($regs[1])) $filepath = $regs[1];
|
||||
// An alternative for proxy but extremely slow
|
||||
//$url = 'http://'.$_SERVER["SERVER_NAME"].DOL_URL_ROOT.$path;
|
||||
|
|
|
|||
|
|
@ -855,7 +855,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||
{
|
||||
foreach($arrayofcss as $cssfile)
|
||||
{
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.$cssfile.'?lang='.$langs->defaultlang.'&theme='.$conf->theme.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1).'?lang='.$langs->defaultlang.'&theme='.$conf->theme.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -894,7 +894,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||
foreach($arrayofjs as $jsfile)
|
||||
{
|
||||
if (! preg_match('/^\//',$jsfile)) $jsfile='/'.$jsfile; // For backward compatibility
|
||||
print '<script type="text/javascript" src="'.$jsfile.'"></script>'."\n";
|
||||
print '<script type="text/javascript" src="'.dol_buildpath($jsfile,1).'"></script>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user