fixup! fixup! Code cleaning : split database into database (for noalyss) and databasecore , with the functions

This commit is contained in:
Dany De Bontridder 2019-07-25 21:24:44 +02:00
parent be6d216109
commit eb55afc103
2 changed files with 28 additions and 29 deletions

View file

@ -222,4 +222,25 @@ class Database extends DatabaseCore
echo '</ul>';
}
/**
* return the name of the database with the domain name
* @param $p_id of the folder WITHOUT the domain name
* @param $p_type dos for folder mod for template
* @return formatted name
*/
function format_name($p_id, $p_type)
{
switch ($p_type) {
case 'dos':
$sys_name = sprintf("%sdossier%d", strtolower(domaine), $p_id);
break;
case 'mod':
$sys_name = sprintf("%smod%d", strtolower(domaine), $p_id);
break;
default:
echo_error(__FILE__ . " format_name invalid type " . $p_type, __LINE__);
throw new Exception(__FILE__ . " format_name invalid type " . $p_type . __LINE__);
}
return $sys_name;
}
}