From 4566894aae23e9b4e0fcd9b9e6fc897126e9fa59 Mon Sep 17 00:00:00 2001 From: "Committo,Ergo:sum" <esj@rezo.net> Date: Mon, 24 Sep 2007 16:12:49 +0000 Subject: [PATCH] =?UTF-8?q?R=C3=A9solution=20de=20#1075=20(liste=20des=20d?= =?UTF-8?q?ocuments=20recherch=C3=A9s).=20Toutefois=20il=20manque=20un=20l?= =?UTF-8?q?ogo=20de=20la=20famille=2012=20pour=20les=20documents,=20et=20l?= =?UTF-8?q?a=20CSS=20ne=20laisse=20pas=20assez=20de=20place=20quand=20les?= =?UTF-8?q?=20num=C3=A9ros=20sont=20sur=204=20chiffres.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/inc/afficher_objets.php | 26 ++++++++++++++++---------- ecrire/inc/puce_statut.php | 3 +++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ecrire/inc/afficher_objets.php b/ecrire/inc/afficher_objets.php index 1231d80b68..5a57af2d9d 100644 --- a/ecrire/inc/afficher_objets.php +++ b/ecrire/inc/afficher_objets.php @@ -13,7 +13,7 @@ // http://doc.spip.org/@icone_table function icone_table($type){ - $derog = array('mot'=>'mot-cle-24.gif','syndic_article'=>'site-24.gif'); + $derog = array('document'=> 'doc-24.gif', 'mot'=>'mot-cle-24.gif','syndic_article'=>'site-24.gif'); if (isset($derog[$type])) return $derog[$type]; return "$type-24.gif"; @@ -21,10 +21,12 @@ function icone_table($type){ // http://doc.spip.org/@lien_editer_objet function lien_editer_objet($type,$key,$id){ - return generer_url_ecrire($type . "s_edit","$key=$id"); + return $type == 'document' ? '' : generer_url_ecrire($type . "s_edit","$key=$id"); } + // http://doc.spip.org/@lien_voir_objet function lien_voir_objet($type,$key,$id){ + if ($type == 'document') return generer_url_document($id); $exec = array('article'=>'articles','breve'=>'breves_voir','rubrique'=>'naviguer','mot'=>'mots_edit'); $exec = isset($exec[$type])?$exec[$type]:$type . "s"; return generer_url_ecrire($exec,"$key=$id"); @@ -63,13 +65,13 @@ function afficher_numero_edit($id, $key, $type,$row=NULL) { $numero = _T('info_numero_abbreviation'); } - if (!autoriser('modifier',$type,$id)) { + if (!autoriser('modifier',$type,$id) OR + !$href = lien_editer_objet($type,$key,$id)) { $bal ='span'; - $href = ''; } else { $bal = 'a'; $href = "\nhref='" - . lien_editer_objet($type,$key,$id) + . $href . "' title='" . _T('bouton_modifier') . "'"; @@ -236,6 +238,7 @@ function inc_afficher_objets_dist($type, $titre_table,$requete,$formater='', $fo $fonction_ligne = "afficher_objet_boucle"; $arg = array($type,id_table_objet($type),$afficher_langue, false, $langue_defaut); } + return affiche_tranche_bandeau($requete, icone_table($type), NULL, NULL, $tmp_var, $titre_table, $force, $largeurs, $styles, $fonction_ligne, $arg); } @@ -269,16 +272,19 @@ function afficher_objet_boucle($row, &$tous_id, $voir_logo, $own) list($fid, $dir, $nom, $format) = $logo; include_spip('inc/filtres_images'); $logo = image_reduire("<img src='$fid' alt='' />", 26, 20); + if ($logo) $s .= "\n<span style='float: $spip_lang_right; margin-top: -2px; margin-bottom: -2px;'>$logo</span>"; } } if (strlen($titre)){ - $s .= "<a href='" . lien_voir_objet($type,$primary,$id_objet) . "'" - . " title='" . _T('info_numero_abbreviation'). "$id_objet'" - . ">"; - $s .= $titre; - $s .= "</a>"; + $s .= "<a href='" + . lien_voir_objet($type,$primary,$id_objet) + . "' " + . "title='" . _T('info_numero_abbreviation'). $id_objet + . "'>" + . $titre + . "</a>"; } $s .= $suite; $s .= "</div>"; diff --git a/ecrire/inc/puce_statut.php b/ecrire/inc/puce_statut.php index 05d069c625..cdc03ad03b 100644 --- a/ecrire/inc/puce_statut.php +++ b/ecrire/inc/puce_statut.php @@ -21,6 +21,9 @@ function inc_puce_statut_dist($id_objet, $statut, $id_rubrique, $type, $ajax=fal return "<img src='"._DIR_IMG_PACK. "$type-24.gif" . "' />"; } +function puce_statut_document($id, $statut, $id_rubrique, $type, $ajax='') { + return "<img src='"._DIR_IMG_PACK. "attachment.gif" . "' />"; +} // http://doc.spip.org/@puce_statut_auteur // Hack de compatibilite: les appels directs ont un $type != 'auteur' -- GitLab