This commit is contained in:
Jérôme Schneider 2015-04-13 17:55:06 +02:00
parent f893821ec3
commit 574d098612
2 changed files with 13 additions and 3 deletions

View File

@ -2,10 +2,20 @@
if (!defined("_ECRIRE_INC_VERSION")) return; #securite
function balise_LOTISSEMENTS_JSON() {
function balise_LOTISSEMENTS_JSON($p) {
return calculer_balise_dynamique($p,'LOTISSEMENTS_JSON', array());
}
function balise_LOTISSEMENTS_JSON_stat($args, $filtres) {
return array($args[0]);
}
function balise_LOTISSEMENTS_JSON_dyn($args, $filtres) {
$lotissements = array();
$result = spip_query("SELECT titre FROM lotis_rubriques WHERE id_parent=1");
while ($row = spip_fetch_array($result))
array_push($lotissements, $row['titre']);
return json_encode($lotissements);
}
?>

View File

@ -1,5 +1,5 @@
#CACHE{0}
#HTTP_HEADER{Content-Type: application/json; charset=utf-8}
#HTTP_HEADER{"Cache-Control: no-store, no-cache, must-revalidate"}
#HTTP_HEADER{Cache-Control: no-store, no-cache, must-revalidate}
#HTTP_HEADER{Pragma: no-cache}
#CACHE{0}
#LOTISSEMENTS_JSON