diff --git a/.gitattributes b/.gitattributes index bf566a5eccc2f59bfa18d8d6dbb28a324dc0f390..0470abbe294333107d35a243de35ad45bbf451a7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ * text=auto !eol IMG/document-vierge.gif -text +IMG/type_defaut-dist.png -text IMG/type_ram.png -text IMG/type_rm.png -text NAVPICS/big-logo-spip.gif -text diff --git a/IMG/type_defaut-dist.png b/IMG/type_defaut-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..af26d0649687084d682a51fdd9477fec464eb2cb Binary files /dev/null and b/IMG/type_defaut-dist.png differ diff --git a/ecrire/article_documents.php3 b/ecrire/article_documents.php3 index 2e3766a221648b59534ea9e121ce5db52f7ce707..eb40879e175a8d6a21c6d72a921ebd94106a6f05 100644 --- a/ecrire/article_documents.php3 +++ b/ecrire/article_documents.php3 @@ -26,13 +26,23 @@ if ($modif_document == 'oui') { mysql_query("UPDATE spip_documents SET titre=\"$titre\", descriptif=\"$descriptif\" WHERE id_document=$id_document"); } +$query = "SELECT titre FROM spip_articles WHERE id_article = $id_article"; +$result = mysql_query($query); +if ($art = mysql_fetch_object($result)) { + $titre_art = "« ".typo($art->titre)." »"; + $lien_art = " <a href='articles.php3?id_article=$id_article' target='spip_normal'><font color='ffffff'>$titre_art</font></a>"; +} else { + $titre_art = ''; + $lien_art = ''; +} + debut_html("Images et documents"); echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n"; echo "<tr bgcolor='$couleur_foncee'>\n"; echo "<td width='100%'><font face='Verdana,Arial,Helvetica,sans-serif' size='4' color='#FFFFFF'>"; -echo "Documents liés à l'article"; +echo "Documents liés à l'article".$lien_art; echo "</td></tr>\n"; $docs_affiches = ""; @@ -81,13 +91,11 @@ while ($row = mysql_fetch_array($result)) { echo "<tr><td height='15'> </td></tr>\n"; -echo "<tr bgcolor='#EEEECC'>\n"; -echo "<td width='100%'><font face='Verdana,Arial,Helvetica,sans-serif' size='4' color='#000000'>"; -echo "Ajouter un nouveau document"; +echo "<tr bgcolor='$couleur_foncee'>\n"; +echo "<td><font face='Verdana,Arial,Helvetica,sans-serif' size='4' color='#FFFFFF'>"; +echo "Ajouter une image ou un document"; echo "</td></tr>\n"; - - -echo "<tr><td>\n"; +echo debut_boite_info(); $hash = calculer_action_auteur("ajout_doc"); @@ -98,7 +106,7 @@ echo "<INPUT NAME='id_article' TYPE=Hidden VALUE=$id_article>\n"; echo "<INPUT NAME='hash_id_auteur' TYPE=Hidden VALUE=$connect_id_auteur>\n"; echo "<INPUT NAME='hash' TYPE=Hidden VALUE=$hash>\n"; echo "<INPUT NAME='ajout_doc' TYPE=Hidden VALUE='oui'>\n"; -echo "Ajouter une image ou un document :"; +// echo "Ajouter une image ou un document :"; echo aide("artimg"); if (tester_upload() AND ($connect_statut == '0minirezo')) { $texte_upload = texte_upload(""); @@ -118,7 +126,7 @@ echo "</FORM>"; echo "</div>"; echo "</font>\n"; -echo "</td></tr>\n"; +echo fin_boite_info(); echo "</table></body></html>\n"; flush(); diff --git a/ecrire/inc_texte.php3 b/ecrire/inc_texte.php3 index 3eccc156bbae2b6b77fc9ae9e453e0eb6d0dd6ef..2572b2f6afaca4ab4d78e6fcc4137502979d13bd 100644 --- a/ecrire/inc_texte.php3 +++ b/ecrire/inc_texte.php3 @@ -72,19 +72,22 @@ function vignette_par_defaut ($type_extension) { $img = "IMG2"; else $img = "IMG"; - $filename = "$img/type_$type_extension.png"; - - if (file_exists($filename)) { - $vig = "<img src='$filename'>"; - } else { - $vig = "<table cellpadding=0 cellspacing=0 border=0 width=35 height=32 align='left' valign='bottom'>\n"; - $vig .= "<tr width=35 height=32>\n"; - $vig .= "<td width=35 height=32 background='$img/document-vierge.gif' align='left'>\n"; - $vig .= "<table bgcolor='#666666' style='border: solid 1px black; margin-top: 10px; padding-top: 0px; padding-bottom: 0px; padding-left: 3px; padding-right: 3px;' cellspacing=0 border=0>\n"; - $vig .= "<tr><td><font face='verdana,arial,helvetica,sans-serif' color='white' size='1'>$type_extension</font></td></tr></table>\n"; - $vig .= "</td></tr></table>\n "; + + $filename = "$img/type_$type_extension"; + + if (file_exists($filename.'.png')) { + $vig = "$filename.png"; + } else if (file_exists($filename.'-dist.png')) { + $vig = "$filename-dist.png"; + } else if (file_exists("$img/type_defaut.png")) { + $vig = "$img/type_defaut.png"; + } else if (file_exists("$img/type_defaut-dist.png")) { + $vig = "$img/type_defaut-dist.png"; } + $image = getimagesize($vig); + $vig = "<img src='$vig' alt='$type_extension' border='0' ".$image[3]." >"; + return $vig; }