-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathajax_dynamics.php
More file actions
executable file
·73 lines (60 loc) · 1.59 KB
/
ajax_dynamics.php
File metadata and controls
executable file
·73 lines (60 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: ajax_dynamics.php,v 1.4 2013-04-12 09:25:31 mbertin Exp $
if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) die("no access");
$base_path = ".";
$base_noheader = 1;
$base_nobody = 1;
$base_nodojo = 1;
$clean_pret_tmp=1;
require_once ($base_path . "/includes/init.inc.php");
if(!SESSrights) exit;
// inclusion des fonctions utiles pour renvoyer la réponse à la requette recu
require_once ($base_path . "/includes/ajax.inc.php");
function utf8_decode_pmb(&$var) {
if(is_array($var)){
foreach($var as $val) {
utf8_decode_pmb($val);
}
}
else $var=utf8_decode($var);
}
function array_uft8_decode($tab){
foreach($tab as $key => $val) {
if(is_array($val)){
$tab[$key] = array_uft8_decode($val);
}else{
$tab[$key] = utf8_decode($val);
}
}
return $tab;
}
if (strtoupper($charset)!="UTF-8") {
$t=array_keys($_POST);
foreach($t as $v) {
global $$v;
utf8_decode_pmb($$v);
}
$t=array_keys($_GET);
foreach($t as $v) {
global $$v;
utf8_decode_pmb($$v);
}
//On décode aussi les POST et les GET en plus de les mettre en global
$_POST = array_uft8_decode($_POST);
$_GET = array_uft8_decode($_GET);
}
require_once($base_path."/$module/ajax/dynamics/".$typeElt.".class.php");
$elt = new $typeElt($id_elt,$fieldElt);
switch($quoifaire){
case 'edit':
$elt->make_display();
break;
case 'save':
$elt->update();
break;
}
ajax_http_send_response($elt->display);
?>