3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2007 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
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 \***************************************************************************/
13 if (!defined("_ECRIRE_INC_VERSION")) return;
15 // Fonction appelee dans une boucle, calculer les invariants au premier appel.
17 // http://doc.spip.org/@inc_formater_article_dist
18 function inc_formater_article_dist($row)
20 global $dir_lang, $options, $spip_lang_right, $spip_display;
22 static $chercher_logo, $img_admin, $formater_auteur, $nb, $langue_defaut, $afficher_langue;
25 $chercher_logo = ($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non");
27 $chercher_logo = charger_fonction('chercher_logo', 'inc');
28 $formater_auteur = charger_fonction('formater_auteur', 'inc');
29 $img_admin = http_img_pack("admin-12.gif", "", " width='12' height='12'", _T('titre_image_admin_article'));
30 $nb = ($options == "avancees");
31 if (($GLOBALS['meta']['multi_rubriques'] == 'oui' AND (!isset($GLOBALS['id_rubrique']))) OR $GLOBALS['meta']['multi_articles'] == 'oui') {
32 $afficher_langue = true
;
33 $langue_defaut = !isset($GLOBALS['langue_rubrique'])
34 ?
$GLOBALS['meta']['langue_site']
35 : $GLOBALS['langue_rubrique'];
40 $id_article = $row['id_article'];
43 if ($logo = $chercher_logo($id_article, 'id_article', 'on')) {
44 list($fid, $dir, $nom, $format) = $logo;
45 include_spip('inc/filtres_images');
46 $logo = image_reduire("<img src='$fid' alt='' />", 26, 20);
52 $titre = sinon($row['titre'], _T('ecrire:info_sans_titre'));
53 $id_rubrique = $row['id_rubrique'];
55 $statut = $row['statut'];
56 $descriptif = $row['descriptif'];
57 if ($lang = $row['lang']) changer_typo($lang);
59 $vals[]= puce_statut_article($id_article, $statut, $id_rubrique);
63 . generer_url_ecrire("articles","id_article=$id_article")
65 . (!$descriptif ?
'' :
66 (' title="'.attribut_html(typo($descriptif)).'"'))
68 . " style=\"display:block;\">"
70 ("<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>" . $logo . "</span>"))
71 . (acces_restreint_rubrique($id_rubrique) ?
$img_admin : '')
73 . (!($afficher_langue AND $lang != $GLOBALS['meta']['langue_site']) ?
'' :
74 (" <span class='spip_xx-small' style='color: #666666'$dir_lang>(".traduire_nom_langue($lang).")</span>"))
75 . (!$row['petition'] ?
'' : (" <span class='spip_xx-small' style='color: red'>"._T('lien_petitions')."</span>"))
79 $result = auteurs_article($id_article);
80 $les_auteurs = array();
81 while ($r = spip_fetch_array($result)) {
82 list($s, $mail, $nom, $w, $p) = $formater_auteur($r['id_auteur']);
83 $les_auteurs[]= "$mail $nom";
85 $vals[] = join('<br />', $les_auteurs);
87 $s = affdate_jourcourt($date);
88 $vals[] = $s ?
$s : ' ';
90 if ($nb) $vals[]= afficher_numero_edit($id_article, 'id_article', 'article');
92 if ($options == "avancees") { // Afficher le numero (JMB)
93 $largeurs = array(11, '', 80, 100, 50);
94 $styles = array('', 'arial2', 'arial1', 'arial1', 'arial1');
96 $largeurs = array(11, '', 100, 100);
97 $styles = array('', 'arial2', 'arial1', 'arial1');
100 return ($spip_display != 4)
101 ?
afficher_liste_display_neq4($largeurs, $vals, $styles)
102 : afficher_liste_display_eq4($largeurs, $vals, $styles);