1 |
mbideau |
17976 |
<?php |
2 |
|
|
/** |
3 |
|
|
* Ce script a pour objet de recuperer la liste des déclencheurs correspondant aux critères de recherche |
4 |
|
|
* |
5 |
|
|
* @package openfoncier |
6 |
|
|
* @version SVN : $Id: findModuleDeclencheurs.php |
7 |
|
|
*/ |
8 |
|
|
|
9 |
|
|
require_once "../obj/utils.class.php"; |
10 |
|
|
$f = new utils("nohtml"); |
11 |
|
|
$f->disableLog(); |
12 |
|
|
|
13 |
|
|
// Vérification des permissions |
14 |
|
|
$f->isAccredited(array("lien_module","lien_module_modifier","lien_module_ajouter"), "OR"); |
15 |
|
|
|
16 |
|
|
// Récupération des valeurs envoyées |
17 |
|
|
$f->set_submitted_value(); |
18 |
|
|
|
19 |
|
|
// Données |
20 |
|
|
$module_name = $f->get_submitted_get_value('module') ?? null; |
21 |
|
|
$module_name = html_entity_decode($module_name, ENT_QUOTES); |
22 |
|
|
$module_name_escaped = $f->db->escapeSimple($module_name); |
23 |
|
|
$f->log(__METHOD__, "module name: ".var_export($module_name, true)); |
24 |
|
|
|
25 |
|
|
$object_name = $f->get_submitted_get_value('object_name') ?? null; |
26 |
|
|
$object_name = html_entity_decode($object_name, ENT_QUOTES); |
27 |
|
|
$object_name_escaped = $f->db->escapeSimple($object_name); |
28 |
|
|
$f->log(__METHOD__, "object name: ".var_export($object_name, true)); |
29 |
|
|
|
30 |
|
|
$object_id = $f->get_submitted_get_value('object_id') ?? null; |
31 |
|
|
$object_id = html_entity_decode($object_id, ENT_QUOTES); |
32 |
|
|
$object_id_escaped = $f->db->escapeSimple($object_id); |
33 |
|
|
$f->log(__METHOD__, "object id: ".var_export($object_id, true)); |
34 |
|
|
|
35 |
|
|
$declencheurs = array(); |
36 |
|
|
|
37 |
|
|
// instancie le module |
38 |
ejpritchard |
18048 |
$module_inst = $f->module_manager->get_module_instance($module_name); |
39 |
mbideau |
17976 |
|
40 |
|
|
if (! empty($module_inst)) { |
41 |
|
|
$declencheurs = $module_inst->get_supported_hooks(true); |
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
echo json_encode($declencheurs); |