PageRenderTime 45ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/spip/ecrire/inc/informer.php

https://github.com/eyeswebcrea/espace-couture-sittler.fr
PHP | 73 lines | 52 code | 8 blank | 13 comment | 12 complexity | 9c5b40c44ec47953a38e664f10908d3a MD5 | raw file
Possible License(s): LGPL-2.1, GPL-3.0
  1. <?php
  2. /***************************************************************************\
  3. * SPIP, Systeme de publication pour l'internet *
  4. * *
  5. * Copyright (c) 2001-2011 *
  6. * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
  7. * *
  8. * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
  9. * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
  10. \***************************************************************************/
  11. if (!defined('_ECRIRE_INC_VERSION')) return;
  12. # Les information d'une rubrique selectionnee dans le mini navigateur
  13. // http://doc.spip.org/@inc_informer_dist
  14. function inc_informer_dist($id, $col, $exclus, $rac, $type, $do='aff')
  15. {
  16. global $spip_display,$spip_lang_right ;
  17. include_spip('inc/texte');
  18. if ($type == "rubrique") {
  19. $row = sql_fetsel("titre, descriptif", "spip_rubriques", "id_rubrique = $id");
  20. if ($row) {
  21. $titre = typo($row["titre"]);
  22. $descriptif = propre($row["descriptif"]);
  23. } else {
  24. $titre = _T('info_racine_site');
  25. }
  26. } else
  27. $titre = '';
  28. $res = '';
  29. if ($type == "rubrique" AND $spip_display != 1 AND $spip_display!=4 AND isset($GLOBALS['meta']['image_process']))
  30. if ($GLOBALS['meta']['image_process'] != "non") {
  31. $chercher_logo = charger_fonction('chercher_logo', 'inc');
  32. if ($res = $chercher_logo($id, 'id_rubrique', 'on')) {
  33. list($fid, $dir, $nom, $format) = $res;
  34. include_spip('inc/filtres_images_mini');
  35. $res = image_reduire("<img src='$fid' alt='' />", 100, 48);
  36. if ($res)
  37. $res = "<div style='float: $spip_lang_right; margin-$spip_lang_right: -5px; margin-top: -5px;'>$res</div>";
  38. }
  39. }
  40. $rac = htmlentities($rac);
  41. # ce lien provoque la selection (directe) de la rubrique cliquee
  42. # et l'affichage de son titre dans le bandeau
  43. $titre = strtr(str_replace("'", "&#8217;",
  44. str_replace('"', "&#34;", textebrut($titre))),
  45. "\n\r", " ");
  46. $js_func = $do . '_selection_titre';
  47. return "<div style='display: none;'>"
  48. . "<input type='text' id='".$rac."_sel' value='$id' />"
  49. . "<input type='text' id='".$rac."_sel2' value=\""
  50. . entites_html($titre)
  51. . "\" />"
  52. . "</div>"
  53. . "<div class='informer' style='padding: 5px; border-top: 0px;'>"
  54. . (!$res ? '' : $res)
  55. . "<p><b>".safehtml($titre)."</b></p>"
  56. . (!$descriptif ? '' : "<div>".safehtml($descriptif)."</div>")
  57. . "<div style='text-align: $spip_lang_right;'>"
  58. . "<input type='submit' value='"
  59. . _T('bouton_choisir')
  60. . "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />"
  61. . "</div>"
  62. . "</div>";
  63. }
  64. ?>