mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Can use javascript files with full http link
This commit is contained in:
parent
887020e4bd
commit
fcf4bcdc1d
|
|
@ -154,8 +154,10 @@ define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr'
|
|||
if (! empty($dolibarr_main_url_root_alt))
|
||||
{
|
||||
$altpart=str_replace($dolibarr_main_url_root,'',$dolibarr_main_url_root_alt);
|
||||
$tmp_alt=$tmp.(preg_match('/^\//',$altpart)?'':'/').$altpart;
|
||||
define('DOL_MAIN_URL_ROOT_ALT', $tmp_alt); // URL absolute root (https://sss/dolibarr/custom, ...)
|
||||
if (! preg_match('/^\//',$altpart) && ! empty($altpart)) { $tmp_alt=$dolibarr_main_url_root_alt; } // Manage case url=http://localhost/aaa and url_alt=http://localhost/aaabbb
|
||||
else $tmp_alt=$tmp.((preg_match('/\/$/',$tmp)||preg_match('/^\//',$altpart))?'':'/').$altpart;
|
||||
//$tmp_alt=$dolibarr_main_url_root_alt;
|
||||
define('DOL_MAIN_URL_ROOT_ALT', $tmp_alt); // URL absolute root (https://sss/dolibarr/custom, ...)
|
||||
$uri=preg_replace('/^http(s?):\/\//i','',constant('DOL_MAIN_URL_ROOT_ALT')); // $uri contains url without http*
|
||||
$suburi = strstr($uri, '/'); // $suburi contains url without domain
|
||||
if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
|
||||
|
|
@ -163,7 +165,7 @@ if (! empty($dolibarr_main_url_root_alt))
|
|||
}
|
||||
// Define prefix
|
||||
define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix);
|
||||
|
||||
//print DOL_URL_ROOT.'-'.DOL_URL_ROOT_ALT;
|
||||
|
||||
/*
|
||||
* Include functions
|
||||
|
|
|
|||
|
|
@ -932,8 +932,15 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||
print '<!-- Includes JS specific to page -->'."\n";
|
||||
foreach($arrayofjs as $jsfile)
|
||||
{
|
||||
if (! preg_match('/^\//',$jsfile)) $jsfile='/'.$jsfile; // For backward compatibility
|
||||
print '<script type="text/javascript" src="'.dol_buildpath($jsfile,1).'"></script>'."\n";
|
||||
if (preg_match('/^http/i',$jsfile))
|
||||
{
|
||||
print '<script type="text/javascript" src="'.$jsfile.'"></script>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! preg_match('/^\//',$jsfile)) $jsfile='/'.$jsfile; // For backward compatibility
|
||||
print '<script type="text/javascript" src="'.dol_buildpath($jsfile,1).'"></script>'."\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user