[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / ecrire / inc / informer.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 # 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 include_spip('inc/texte');
21 if ($type == "rubrique") {
22 $row = sql_fetsel("titre, descriptif", "spip_rubriques", "id_rubrique = $id");
23 if ($row) {
24 $titre = typo($row["titre"]);
25 $descriptif = propre($row["descriptif"]);
26 } else {
27 $titre = _T('info_racine_site');
28 }
29 } else
30 $titre = '';
31
32 $res = '';
33 if ($type == "rubrique" AND $GLOBALS['spip_display'] != 1 AND isset($GLOBALS['meta']['image_process']))
34 if ($GLOBALS['meta']['image_process'] != "non") {
35 $chercher_logo = charger_fonction('chercher_logo', 'inc');
36 if ($res = $chercher_logo($id, 'id_rubrique', 'on')) {
37 list($fid, $dir, $nom, $format) = $res;
38 include_spip('inc/filtres_images_mini');
39 $res = image_reduire("<img src='$fid' alt='' />", 100, 48);
40 if ($res)
41 $res = "<div style='float: ".$GLOBALS['spip_lang_right']."; margin-".$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>";
42 }
43 }
44
45 $rac = spip_htmlentities($rac);
46
47 # ce lien provoque la selection (directe) de la rubrique cliquee
48 # et l'affichage de son titre dans le bandeau
49 $titre = strtr(str_replace("'", "&#8217;",
50 str_replace('"', "&#34;", textebrut($titre))),
51 "\n\r", " ");
52
53 $js_func = $do . '_selection_titre';
54 return "<div style='display: none;'>"
55 . "<input type='text' id='".$rac."_sel' value='$id' />"
56 . "<input type='text' id='".$rac."_sel2' value=\""
57 . entites_html($titre)
58 . "\" />"
59 . "</div>"
60 . "<div class='informer' style='padding: 5px; border-top: 0px;'>"
61 . (!$res ? '' : $res)
62 . "<p><b>".safehtml($titre)."</b></p>"
63 . (!$descriptif ? '' : "<div>".safehtml($descriptif)."</div>")
64 . "<div style='text-align: ".$GLOBALS['spip_lang_right'].";'>"
65 . "<input type='submit' class='fondo' value='"
66 . _T('bouton_choisir')
67 . "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
68 . "</div>"
69 . "</div>";
70 }
71 ?>