[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / inc / informer.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2014 *
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 # Les information d'une rubrique selectionnee dans le mini navigateur
16
17 // http://doc.spip.org/@inc_informer_dist
18 function inc_informer_dist($id, $col, $exclus, $rac, $type, $do='aff')
19 {
20 global $spip_display,$spip_lang_right ;
21
22 include_spip('inc/texte');
23 if ($type == "rubrique") {
24 $row = sql_fetsel("titre, descriptif", "spip_rubriques", "id_rubrique = $id");
25 if ($row) {
26 $titre = typo($row["titre"]);
27 $descriptif = propre($row["descriptif"]);
28 } else {
29 $titre = _T('info_racine_site');
30 }
31 } else
32 $titre = '';
33
34 $res = '';
35 if ($type == "rubrique" AND $spip_display != 1 AND $spip_display!=4 AND isset($GLOBALS['meta']['image_process']))
36 if ($GLOBALS['meta']['image_process'] != "non") {
37 $chercher_logo = charger_fonction('chercher_logo', 'inc');
38 if ($res = $chercher_logo($id, 'id_rubrique', 'on')) {
39 list($fid, $dir, $nom, $format) = $res;
40 include_spip('inc/filtres_images_mini');
41 $res = image_reduire("<img src='$fid' alt='' />", 100, 48);
42 if ($res)
43 $res = "<div style='float: $spip_lang_right; margin-$spip_lang_right: -5px; margin-top: -5px;'>$res</div>";
44 }
45 }
46
47 $rac = htmlentities($rac);
48
49 # ce lien provoque la selection (directe) de la rubrique cliquee
50 # et l'affichage de son titre dans le bandeau
51 $titre = strtr(str_replace("'", "&#8217;",
52 str_replace('"', "&#34;", textebrut($titre))),
53 "\n\r", " ");
54
55 $js_func = $do . '_selection_titre';
56 return "<div style='display: none;'>"
57 . "<input type='text' id='".$rac."_sel' value='$id' />"
58 . "<input type='text' id='".$rac."_sel2' value=\""
59 . entites_html($titre)
60 . "\" />"
61 . "</div>"
62 . "<div class='informer' style='padding: 5px; border-top: 0px;'>"
63 . (!$res ? '' : $res)
64 . "<p><b>".safehtml($titre)."</b></p>"
65 . (!$descriptif ? '' : "<div>".safehtml($descriptif)."</div>")
66 . "<div style='text-align: $spip_lang_right;'>"
67 . "<input type='submit' value='"
68 . _T('bouton_choisir')
69 . "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
70 . "</div>"
71 . "</div>";
72 }
73 ?>