mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: rename dol_file_exists to dol_buildpath
This commit is contained in:
parent
b3c373bae8
commit
e1ab6c053f
|
|
@ -63,7 +63,7 @@ function print_auguria_menu($db,$atarget,$type_user)
|
|||
}
|
||||
else
|
||||
{
|
||||
$url=dol_file_exists($tabMenu[$i]['url'],1);
|
||||
$url=dol_buildpath($tabMenu[$i]['url'],1);
|
||||
if (! preg_match('/\?/',$url)) $url.='?';
|
||||
else $url.='&';
|
||||
if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
|
||||
|
|
@ -275,7 +275,7 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after)
|
|||
}
|
||||
|
||||
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
|
||||
$url=dol_file_exists($menu_array[$i]['url'],1);
|
||||
$url=dol_buildpath($menu_array[$i]['url'],1);
|
||||
|
||||
if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ function print_eldy_menu($db,$atarget,$type_user)
|
|||
}
|
||||
else
|
||||
{
|
||||
$url=dol_file_exists($tabMenu[$i]['url'],1);
|
||||
$url=dol_buildpath($tabMenu[$i]['url'],1);
|
||||
if (! preg_match('/\?/',$url)) $url.='?';
|
||||
else $url.='&';
|
||||
if (! preg_match('/mainmenu/i',$url) || ! preg_match('/leftmenu/i',$url))
|
||||
|
|
@ -1385,7 +1385,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
|
|||
}
|
||||
|
||||
// For external modules
|
||||
$url = dol_file_exists($menu_array[$i]['url'], 1);
|
||||
$url = dol_buildpath($menu_array[$i]['url'], 1);
|
||||
|
||||
// Menu niveau 0
|
||||
if ($menu_array[$i]['level'] == 0)
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ function societe_prepare_head($objsoc)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ function contact_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ function contract_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ function fichinter_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ function facturefourn_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
@ -134,7 +134,7 @@ function ordersupplier_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -87,19 +87,18 @@ function dol_require_once($relpath)
|
|||
// Forced to use file_exists otherwise there is a blank page
|
||||
//$res=@require_once(DOL_DOCUMENT_ROOT.$relpath);
|
||||
//if (! $res && defined('DOL_DOCUMENT_ROOT_ALT')) $res=@require_once(DOL_DOCUMENT_ROOT_ALT.$relpath);
|
||||
$res=require_once(dol_file_exists($relpath));
|
||||
$res=require_once(dol_buildpath($relpath));
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return path of url or filesystem. Return default_root or alternate root if file_exist fails.
|
||||
* TODO Rename function into dol_buildpath
|
||||
* @param path Relative or absolute path to file (Ie: mydir/myfile, ../myfile, ...)
|
||||
* @param mode 0=Used for a Filesystem path, 1=Used for an URL path
|
||||
* @return string Full filsystem path (if mode=0), Relative url path (if mode=1)
|
||||
*/
|
||||
function dol_file_exists($path,$mode=0)
|
||||
function dol_buildpath($path,$mode=0)
|
||||
{
|
||||
if (empty($mode)) // For a filesystem path
|
||||
{
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ function facture_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ function member_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ function commande_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ function prelevement_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ function product_prepare_head($object, $user)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ function project_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
@ -156,7 +156,7 @@ function task_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ function propal_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ function shipping_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
@ -102,7 +102,7 @@ function delivery_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ function stock_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ function user_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
@ -153,7 +153,7 @@ function group_prepare_head($object)
|
|||
{
|
||||
$values=explode(':',$value);
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = dol_file_exists(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i',$object->id,$values[3]),1);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
|
|
|
|||
|
|
@ -843,7 +843,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||
{
|
||||
foreach($conf->css_modules as $cssfile)
|
||||
{ // cssfile is an absolute path
|
||||
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_file_exists($cssfile,1).'?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";
|
||||
}
|
||||
}
|
||||
// CSS forced by page in top_htmlhead call (relative url starting with /)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user