diff --git a/ecrire/inc/formater_article.php b/ecrire/inc/formater_article.php index 1ade1dd474bcebe2f0be97a2af10d4302689d33a..d4e73a2f3c28e145e4932a82f02740e7b1c6bd92 100644 --- a/ecrire/inc/formater_article.php +++ b/ecrire/inc/formater_article.php @@ -86,7 +86,7 @@ function inc_formater_article_dist($row) $s = affdate_jourcourt($date); $vals[] = $s ? $s : ' '; - if ($nb) $vals[]= afficher_numero_edit($id_article, 'id_article', 'articles_edit'); + if ($nb) $vals[]= afficher_numero_edit($id_article, 'id_article', 'article'); if ($options == "avancees") { // Afficher le numero (JMB) $largeurs = array(11, '', 80, 100, 50); diff --git a/ecrire/inc/presentation.php b/ecrire/inc/presentation.php index 32ce8ed151f2af6136964b10608af28ba7f54a1c..9397c522c905d220877a4f9ed786a00a26f5e5ff 100644 --- a/ecrire/inc/presentation.php +++ b/ecrire/inc/presentation.php @@ -929,7 +929,7 @@ function afficher_breves_boucle($row, &$tous_id, $voir_logo, $own) $vals[] = $s; if ($options == "avancees") { - $vals[] = afficher_numero_edit($id_breve, 'id_breve', 'breves_edit'); + $vals[] = afficher_numero_edit($id_breve, 'id_breve', 'breve'); } return $vals; @@ -1780,7 +1780,6 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30) if ($options != "avancees") return ''; $table = $type . 's'; - $script = $type . 's_edit'; $key = 'id_' . $type; $voss = spip_query("SELECT $key AS id, titre, statut FROM spip_$table WHERE id_rubrique=$id_rubrique AND (statut = 'publie' OR statut = 'prop') AND ($key != $id) ORDER BY $order DESC LIMIT $limit"); @@ -1791,7 +1790,7 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30) while($row = spip_fetch_array($voss)) { $n = $row['id']; - $retour .= afficher_numero_edit($n, $key, $script) + $retour .= afficher_numero_edit($n, $key, $type) . "<a class='" . $row['statut'] . "' style='font-size: 10px;' href='" @@ -1810,23 +1809,30 @@ function meme_rubrique($id_rubrique, $id, $type, $order='date', $limit=30) } // http://doc.spip.org/@afficher_numero_edit -function afficher_numero_edit($id, $key, $script) +function afficher_numero_edit($id, $key, $type) { global $spip_lang_right, $spip_lang_left; static $numero , $style='' ; - + if (!$style) { $style = " style='float: $spip_lang_right; padding-$spip_lang_left: 4px;font-size: 10px; color: black; '"; $numero = _T('info_numero_abbreviation'); } - return "<a$style\nhref='" - . generer_url_ecrire($script,"$key=$id") - . "'><b>" + if (!autoriser('modifier',$type,$id)) { + $bal ='span'; + $href = ''; + } else { + $bal = 'a'; + $href = "\nhref='" + . generer_url_ecrire($type . "s_edit","$key=$id") + . "'"; + } + return "<$bal$style$href><b>" . $numero . $id - . "</b></a>"; + . "</b></$bal>"; } //