1 | <?php |
---|
2 | |
---|
3 | /***************************************************************************\ |
---|
4 | * SPIP, Systeme de publication pour l'internet * |
---|
5 | * * |
---|
6 | * Copyright (c) 2001-2015 * |
---|
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 | include_spip('inc/afficher_objets'); |
---|
15 | include_spip('inc/autoriser'); // auteurs_article |
---|
16 | // Fonction appelee dans une boucle, calculer les invariants au premier appel. |
---|
17 | // obsolete, utilise uniquement par afficher_objets |
---|
18 | |
---|
19 | // http://code.spip.net/@inc_formater_article_dist |
---|
20 | function inc_formater_article_dist($row, $own='') |
---|
21 | { |
---|
22 | global $spip_lang_right, $spip_display; |
---|
23 | static $pret = false; |
---|
24 | static $chercher_logo, $img_admin, $formater_auteur, $nb, $langue_defaut, $afficher_langue, $puce_statut; |
---|
25 | |
---|
26 | $id_article = $row['id_article']; |
---|
27 | |
---|
28 | if (!autoriser('voir','article',$id_article)) return ''; |
---|
29 | |
---|
30 | if (!$pret) { |
---|
31 | $chercher_logo = ($spip_display != 1 AND $spip_display != 4 AND $GLOBALS['meta']['image_process'] != "non"); |
---|
32 | if ($chercher_logo) |
---|
33 | $chercher_logo = charger_fonction('chercher_logo', 'inc'); |
---|
34 | $formater_auteur = charger_fonction('formater_auteur', 'inc'); |
---|
35 | $img_admin = http_img_pack('auteur-0minirezo-16.png', "", "", _T('titre_image_admin_article')); |
---|
36 | |
---|
37 | if (($GLOBALS['meta']['multi_rubriques'] == 'oui' AND (!isset($GLOBALS['id_rubrique']))) OR $GLOBALS['meta']['multi_articles'] == 'oui') { |
---|
38 | $afficher_langue = true; |
---|
39 | $langue_defaut = !isset($GLOBALS['langue_rubrique']) |
---|
40 | ? $GLOBALS['meta']['langue_site'] |
---|
41 | : $GLOBALS['langue_rubrique']; |
---|
42 | } |
---|
43 | $puce_statut = charger_fonction('puce_statut', 'inc'); |
---|
44 | $pret = true; |
---|
45 | } |
---|
46 | |
---|
47 | if ($chercher_logo) { |
---|
48 | if ($logo = $chercher_logo($id_article, 'id_article', 'on')) { |
---|
49 | list($fid, $dir, $nom, $format) = $logo; |
---|
50 | include_spip('inc/filtres_images_mini'); |
---|
51 | $logo = image_reduire("<img src='$fid' alt='' />", 26, 20); |
---|
52 | } |
---|
53 | } else $logo =''; |
---|
54 | |
---|
55 | $titre = sinon($row['titre'], _T('ecrire:info_sans_titre')); |
---|
56 | $id_rubrique = $row['id_rubrique']; |
---|
57 | $date = $row['date']; |
---|
58 | $statut = $row['statut']; |
---|
59 | $descriptif = $row['descriptif']; |
---|
60 | $lang_dir = lang_dir(($lang = $row['lang']) ? changer_typo($lang):''); |
---|
61 | |
---|
62 | $lien = "<div>" |
---|
63 | . "<a href='" |
---|
64 | . generer_url_ecrire("articles","id_article=$id_article") |
---|
65 | . "'" |
---|
66 | . (!$descriptif ? '' : |
---|
67 | (' title="'.attribut_html(typo($descriptif)).'"')) |
---|
68 | . " dir='$lang_dir'>" |
---|
69 | . (!$logo ? '' : |
---|
70 | ("<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>" . $logo . "</span>")) |
---|
71 | . (acces_restreint_rubrique($id_rubrique) ? $img_admin : '') |
---|
72 | . typo(supprime_img($titre,'')) |
---|
73 | . (!($afficher_langue AND $lang != $GLOBALS['meta']['langue_site'] AND strlen($lang)) ? '' : |
---|
74 | (" <span class='spip_xx-small' style='color: #666666' dir='$lang_dir'>(".traduire_nom_langue($lang).")</span>")) |
---|
75 | . (!$row['petition'] ? '' : |
---|
76 | ("</a> <a href='" . generer_url_ecrire('controle_petition', "id_article=$id_article") . "' class='spip_xx-small' style='color: red'>"._T('lien_petitions'))) |
---|
77 | . "</a>" |
---|
78 | . "</div>"; |
---|
79 | |
---|
80 | if ($spip_display == 4) return array($lien); |
---|
81 | |
---|
82 | $puce = $puce_statut($id_article, $statut, $id_rubrique,'article'); |
---|
83 | |
---|
84 | $auteurs = auteurs_article($id_article); |
---|
85 | foreach ($auteurs as $k => $r) { |
---|
86 | list(, $mail, $nom,,) = $formater_auteur($r['id_auteur']); |
---|
87 | $auteurs[$k]= "$mail $nom"; |
---|
88 | } |
---|
89 | |
---|
90 | $date = affdate_jourcourt($date); |
---|
91 | if (!$date) $date = ' '; |
---|
92 | |
---|
93 | $num = afficher_numero_edit($id_article, 'id_article', 'article'); |
---|
94 | |
---|
95 | // Afficher le numero (JMB) |
---|
96 | |
---|
97 | return array($puce, $lien, join('<br />', $auteurs), $date, $num); |
---|
98 | } |
---|
99 | |
---|
100 | ?> |
---|