forked from Wavyzz/dolibarr
New: add directory for external module and other customization
This commit is contained in:
@@ -369,7 +369,14 @@ if ($mode != 4)
|
|||||||
{
|
{
|
||||||
if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs))
|
if (preg_match('/^([^@]+)@([^@]+)$/i',$urlpage,$regs))
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/'.$regs[2].'/admin/'.$regs[1].'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a> ';
|
if (file_exists(DOL_URL_ROOT.'/'.$regs[2].'/admin/'.$regs[1]))
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/'.$regs[2].'/admin/'.$regs[1].'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a> ';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/custom/modules/'.$regs[2].'/admin/'.$regs[1].'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a> ';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -381,7 +388,14 @@ if ($mode != 4)
|
|||||||
}
|
}
|
||||||
else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
|
else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs))
|
||||||
{
|
{
|
||||||
print '<td align="right" valign="top"><a href="'.DOL_URL_ROOT.'/'.$regs[2].'/admin/'.$regs[1].'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a></td>';
|
if (file_exists(DOL_URL_ROOT.'/'.$regs[2].'/admin/'.$regs[1]))
|
||||||
|
{
|
||||||
|
print '<td align="right" valign="top"><a href="'.DOL_URL_ROOT.'/'.$regs[2].'/admin/'.$regs[1].'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a></td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td align="right" valign="top"><a href="'.DOL_URL_ROOT.'/custom/modules/'.$regs[2].'/admin/'.$regs[1].'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup").'</a></td>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -179,8 +179,11 @@ class Translate {
|
|||||||
|
|
||||||
foreach($this->dir as $searchdir)
|
foreach($this->dir as $searchdir)
|
||||||
{
|
{
|
||||||
// If $domain is "file@module" instead of "file" then we look for module lang file htdocs/module/langs/code_CODE/file.lang
|
// If $domain is "file@module" instead of "file" then we look for module lang file
|
||||||
|
// in htdocs/custom/modules/mymodule/langs/code_CODE/file.lang
|
||||||
|
// and in htdocs/mymodule/langs/code_CODE/file.lang for backward compatibility
|
||||||
// instead of file htdocs/langs/code_CODE/filelang
|
// instead of file htdocs/langs/code_CODE/filelang
|
||||||
|
if (preg_match('/custom$/i',$searchdir)) $searchdir = $searchdir . "/modules";
|
||||||
if (preg_match('/@/',$domain)) $searchdir = $searchdir."/".(!empty($modulename)?$modulename:$newdomain)."/langs";
|
if (preg_match('/@/',$domain)) $searchdir = $searchdir."/".(!empty($modulename)?$modulename:$newdomain)."/langs";
|
||||||
else $searchdir=$searchdir."/langs";
|
else $searchdir=$searchdir."/langs";
|
||||||
|
|
||||||
|
|||||||
@@ -1137,7 +1137,14 @@ function img_object($alt, $object, $cssclass='')
|
|||||||
|
|
||||||
if (preg_match('/^([^@]+)@([^@]+)$/i',$object,$regs))
|
if (preg_match('/^([^@]+)@([^@]+)$/i',$object,$regs))
|
||||||
{
|
{
|
||||||
return '<img src="'.DOL_URL_ROOT.'/'.$regs[2].'/img/object_'.$regs[1].'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" '.$cssclass.'>';
|
if (file_exists(DOL_URL_ROOT.'/'.$regs[2].'/img/object_'.$regs[1]))
|
||||||
|
{
|
||||||
|
return '<img src="'.DOL_URL_ROOT.'/'.$regs[2].'/img/object_'.$regs[1].'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" '.$cssclass.'>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return '<img src="'.DOL_URL_ROOT.'/custom/modules/'.$regs[2].'/img/object_'.$regs[1].'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" '.$cssclass.'>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/object_'.$object.'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" '.$cssclass.'>';
|
return '<img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/object_'.$object.'.png" border="0" alt="'.dol_escape_htmltag($alt).'" title="'.dol_escape_htmltag($alt).'" '.$cssclass.'>';
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ if (empty($dolibarr_main_data_root))
|
|||||||
define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs)
|
define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs)
|
||||||
define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents)
|
define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents)
|
||||||
define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir
|
define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir
|
||||||
define('DOL_CUSTOM_PATH', $dolibarr_main_document_root.'/custom'); // Filesystem path to custom dir
|
define('DOL_CUSTOM_PATH', DOL_DOCUMENT_ROOT . '/custom'); // Filesystem path to custom dir
|
||||||
|
define('DOL_EXTMODULE_ROOT', DOL_CUSTOM_PATH . '/modules'); // Filesystem path to external modules dir
|
||||||
// If dolibarr_main_url_root = auto (Hidden feature for developers only), we try to forge it.
|
// If dolibarr_main_url_root = auto (Hidden feature for developers only), we try to forge it.
|
||||||
if ($dolibarr_main_url_root == 'auto' && ! empty($_SERVER["SCRIPT_URL"]) && ! empty($_SERVER["SCRIPT_URI"]))
|
if ($dolibarr_main_url_root == 'auto' && ! empty($_SERVER["SCRIPT_URL"]) && ! empty($_SERVER["SCRIPT_URI"]))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user