f) && $this->f != null) { $f = $this->f; } elseif (isset($GLOBALS["f"])) { $f = $GLOBALS["f"]; } else { die("Impossible"); } // Gestion de la traduction des HOOKS $sql_hooks = 'lien_module.declencheur as "'.__("déclencheur").'"'; $hooks = $f->module_manager->get_all_available_hooks(); if (!empty($hooks) ){ $sql_hooks = "CASE"; foreach($hooks as $name => $desc) { $sql_hooks = sprintf( "%s WHEN lien_module.declencheur = '%s' THEN '%s'", $sql_hooks, $name, str_replace("'", "''", $desc) ); } $sql_hooks .= ' ELSE lien_module.declencheur END as "'.__("déclencheur").'"'; } // Gestion de la traduction des MODULES $sql_modules = 'lien_module.module as "'.__("module").'"'; $modules = $f->module_manager->get_all_available_modules(); if (!empty($modules)){ $sql_modules = "CASE"; foreach($modules as $module) { $module_name = $module->get_short_name(); $module_desc = $module->get_description(); $sql_modules = sprintf( "%s WHEN lien_module.module = '%s' THEN '%s'", $sql_modules, $module_name, str_replace("'", "''", $module_desc) ); } $sql_modules .= ' ELSE lien_module.module END as "'.__("module").'"'; } $tri = "ORDER BY lien_module.ordre DESC NULLS LAST"; if (! empty($retourformulaire)) { $selection = "WHERE object_name = '".$this->db->escapeSimple($retourformulaire)."'"; if (! empty($idx)) { $selection .= " AND object_id = '".$this->db->escapeSimple($idx)."'"; } $champAffiche = array( 'lien_module.lien_module as "'.__("lien_module").'"', $sql_modules, $sql_hooks, 'lien_module.ordre as "'.__("ordre").'"', ); $champNonAffiche = array( 'lien_module.object_id as "'.__("object_id").'"', 'lien_module.object_name as "'.__("object_name").'"', 'lien_module.parametres as "'.__("parametres").'"', ); $champRecherche = array( 'lien_module.module as "'.__("module").'"', 'lien_module.declencheur as "'.__("déclencheur").'"', 'lien_module.ordre as "'.__("ordre").'"', ); }