[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / ecrire / balise / info_.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2016 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) return;
14
15 /**
16 * Generer n'importe quel info pour un objet : #INFO_TITRE{article, #ENV{id_article}}
17 * Utilise la fonction generer_info_entite() de inc/filtres
18 * se reporter a sa documentation
19 *
20 */
21 function balise_INFO__dist($p){
22 $info = $p->nom_champ;
23 $type_objet = interprete_argument_balise(1,$p);
24 $id_objet = interprete_argument_balise(2,$p);
25 if ($info === 'INFO_' or !$type_objet or !$id_objet) {
26 $msg = _T('zbug_balise_sans_argument', array('balise' => ' INFO_'));
27 erreur_squelette($msg, $p);
28 $p->interdire_scripts = true;
29 return $p;
30 }
31 else {
32 $info_sql = strtolower(substr($info,5));
33 $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'".($p->etoile?","._q($p->etoile):"").")";
34 $p->code = champ_sql($info, $p, $code);
35 $p->interdire_scripts = true;
36 return $p;
37 }
38 }
39
40 ?>