3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
6 * Copyright (c) 2001-2014 *
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;
14 include_spip('inc/afficher_objets');
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, $own='')
20 global $spip_lang_right, $spip_display;
22 static $chercher_logo, $img_admin, $formater_auteur, $nb, $langue_defaut, $afficher_langue, $puce_statut;
24 $id_article = $row['id_article'];
26 if (!autoriser('voir','article',$id_article)) return '';
29 $chercher_logo = ($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non");
31 $chercher_logo = charger_fonction('chercher_logo', 'inc');
32 $formater_auteur = charger_fonction('formater_auteur', 'inc');
33 $img_admin = http_img_pack("admin-12.gif", "", " width='12' height='12'", _T('titre_image_admin_article'));
35 if (($GLOBALS['meta']['multi_rubriques'] == 'oui' AND (!isset($GLOBALS['id_rubrique']))) OR $GLOBALS['meta']['multi_articles'] == 'oui') {
36 $afficher_langue = true;
37 $langue_defaut = !isset($GLOBALS['langue_rubrique'])
38 ?
$GLOBALS['meta']['langue_site']
39 : $GLOBALS['langue_rubrique'];
41 $puce_statut = charger_fonction('puce_statut', 'inc');
46 if ($logo = $chercher_logo($id_article, 'id_article', 'on')) {
47 list($fid, $dir, $nom, $format) = $logo;
48 include_spip('inc/filtres_images_mini');
49 $logo = "<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>" .
50 image_reduire("<img src='$fid' alt='' />", 26, 20) .
55 $titre = supprime_img($row['titre'],'');
56 $id_rubrique = $row['id_rubrique'];
58 $statut = $row['statut'];
59 $descriptif = $row['descriptif'];
61 $dir = "dir='" . lang_dir($lang ?
changer_typo($lang) : '') . "'";
62 if ($lang AND $afficher_langue AND $lang != $GLOBALS['meta']['langue_site'])
63 $lang = " <span class='spip_xx-small' style='color: #666666' "
66 . traduire_nom_langue($lang)
70 $arg = "id_article=$id_article";
71 $url_a = generer_url_ecrire("articles", $arg);
72 if (!$row['petition'])
75 $petition = " <a href='" . generer_url_ecrire('controle_petition', $arg) . "' class='spip_xx-small' style='color: red'>"._T('lien_petitions') . "</a>";
79 . (acces_restreint_rubrique($id_rubrique) ?
$img_admin : '')
83 . (!$descriptif ?
'': (' title="'.attribut_html(typo($descriptif)).'"'))
85 . typo(strlen($titre) ?
$titre : _T('ecrire:info_sans_titre'))
91 if ($spip_display == 4) return array($lien);
93 $puce = $puce_statut($id_article, $statut, $id_rubrique,'article');
95 $auteurs = auteurs_article($id_article);
96 foreach ($auteurs as $k => $r) {
97 list(, $mail, $nom,,) = $formater_auteur($r['id_auteur']);
98 $auteurs[$k]= "$mail $nom";
101 $date = affdate_jourcourt($date);
102 if (!$date) $date = ' ';
104 $num = afficher_numero_edit($id_article, 'id_article', 'article');
106 // Afficher le numero (JMB)
108 return array($puce, $lien, join('<br />', $auteurs), $date, $num);