New: hookmanager class is used frequently and is a factory object, so we

can move it during init of environment and use it globally.
This commit is contained in:
Laurent Destailleur
2013-01-25 19:12:54 +01:00
parent 1cc949777f
commit 56e11e52fa
52 changed files with 27 additions and 183 deletions

View File

@@ -216,20 +216,11 @@ class FormMail
*/
function get_form($addfileaction='addfile',$removefileaction='removefile')
{
global $conf, $langs, $user;
global $hookmanager;
global $conf, $langs, $user, $hookmanager;
$langs->load("other");
$langs->load("mails");
if (! is_object($hookmanager))
{
if (! class_exists('HookManager')) {
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
require DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($this->db);
}
}
$hookmanager->initHooks(array('formmail'));
$parameters=array(