Change to allow modules to add new tabs
This commit is contained in:
parent
0c848c3d89
commit
7dcd991215
@ -111,6 +111,7 @@ else if ($_POST["action"] == 'confirmDeleteProdLineInForm')
|
||||
else if ($_POST["action"] == 'ProductCanvasAbility')
|
||||
{
|
||||
dolibarr_set_const($db, "PRODUCT_CANVAS_ABILITY", $_POST["ProductCanvasAbility"]);
|
||||
dolibarr_set_const($db, "MAIN_NEED_SMARTY", $_POST["ProductCanvasAbility"]);
|
||||
// Create temp directory for smarty
|
||||
if (! empty($dolibarr_smarty_compile)) create_exdir($dolibarr_smarty_compile);
|
||||
if (! empty($dolibarr_smarty_cache)) create_exdir($dolibarr_smarty_cache);
|
||||
|
||||
@ -124,7 +124,7 @@ function product_prepare_head($product, $user)
|
||||
if ($values[2]) $langs->load($values[2]);
|
||||
$head[$h][0] = eregi_replace('__ID__',$product->id,$values[3]);
|
||||
$head[$h][1] = $langs->trans($values[1]);
|
||||
$head[$h][2] = 'module'.$i;
|
||||
$head[$h][2] = 'tab'.$values[1];
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -507,23 +507,22 @@ else // Si utilisateur externe
|
||||
// Only rodolphe and auguria menu manage canvas menu (auguria not correctly yet)
|
||||
if (! eregi('^rodolphe',$conf->left_menu) && ! eregi('^auguria',$conf->left_menu)) $conf->global->PRODUCT_CANVAS_ABILITY=0;
|
||||
|
||||
// Si besoin de smarty
|
||||
if ($conf->global->PRODUCT_CANVAS_ABILITY)
|
||||
|
||||
// For modules using Smarty
|
||||
if ($conf->global->MAIN_NEED_SMARTY)
|
||||
{
|
||||
// SMARTY
|
||||
// Definit dans le fichier de conf
|
||||
// $dolibarr_smarty_libs_dir="/home/www/dolibarr/external-libs/smarty/libs/";
|
||||
// $dolibarr_smarty_compile="/home/www/dolibarr/documents/smarty/templates/temp";
|
||||
// $dolibarr_smarty_cache="/home/www/dolibarr/documents/smarty/cache/temp";
|
||||
|
||||
if (empty($dolibarr_smarty_libs_dir)) $dolibarr_smarty_libs_dir=$dolibarr_main_document_root.'/../external-libs/smarty/libs/';
|
||||
if (empty($dolibarr_smarty_compile)) $dolibarr_smarty_compile=$dolibarr_main_data_root.'/smarty/templates/temp';
|
||||
if (empty($dolibarr_smarty_cache)) $dolibarr_smarty_cache=$dolibarr_main_data_root.'/smarty/cache/temp';
|
||||
|
||||
if (empty($dolibarr_smarty_libs_dir)) $dolibarr_smarty_libs_dir=DOL_DATA_ROOT.'/../external-libs/smarty/libs/';
|
||||
if (empty($dolibarr_smarty_compile)) $dolibarr_smarty_compile=DOL_DATA_ROOT.'/smarty/templates/temp';
|
||||
if (empty($dolibarr_smarty_cache)) $dolibarr_smarty_cache=DOL_DATA_ROOT.'/smarty/cache/temp';
|
||||
|
||||
$smarty_libs = $dolibarr_smarty_libs_dir. "Smarty.class.php";
|
||||
if (file_exists ($smarty_libs))
|
||||
{
|
||||
|
||||
require_once($smarty_libs);
|
||||
$smarty = new Smarty();
|
||||
$smarty->compile_dir = $dolibarr_smarty_compile;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user