diff --git a/.gitattributes b/.gitattributes index 60312b1db8726d3d01543db2005a95942b1ba9fc..54ca9e2a54bed296f1d3f6e4794b2b6a9f0b7039 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,11 +1,14 @@ * text=auto !eol +IMG/icones/ai-dist.png -text IMG/icones/aiff-dist.png -text IMG/icones/asf-dist.png -text IMG/icones/avi-dist.png -text IMG/icones/bmp-dist.png -text IMG/icones/bz2-dist.png -text +IMG/icones/deb-dist.png -text IMG/icones/defaut-dist.png -text IMG/icones/doc-dist.png -text +IMG/icones/dvi-dist.png -text IMG/icones/eps-dist.png -text IMG/icones/gif-dist.png -text IMG/icones/gz-dist.png -text @@ -25,16 +28,20 @@ IMG/icones/qt-dist.png -text IMG/icones/ra-dist.png -text IMG/icones/ram-dist.png -text IMG/icones/rm-dist.png -text +IMG/icones/rpm-dist.png -text IMG/icones/rtf-dist.png -text IMG/icones/sdd-dist.png -text IMG/icones/sdw-dist.png -text IMG/icones/sit-dist.png -text +IMG/icones/sxc-dist.png -text IMG/icones/sxi-dist.png -text IMG/icones/sxw-dist.png -text +IMG/icones/tex-dist.png -text IMG/icones/tgz-dist.png -text IMG/icones/tif-dist.png -text IMG/icones/txt-dist.png -text IMG/icones/wav-dist.png -text +IMG/icones/xcf-dist.png -text IMG/icones/xls-dist.png -text IMG/icones/xml-dist.png -text IMG/icones/zip-dist.png -text diff --git a/IMG/icones/ai-dist.png b/IMG/icones/ai-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..8c3c6175a0e6423d336e21c58fee54ef9d1a0f3d Binary files /dev/null and b/IMG/icones/ai-dist.png differ diff --git a/IMG/icones/deb-dist.png b/IMG/icones/deb-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..14b96768de2642d104dc84506d9eacfdb8749596 Binary files /dev/null and b/IMG/icones/deb-dist.png differ diff --git a/IMG/icones/dvi-dist.png b/IMG/icones/dvi-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..6b98fadaebf86884aa453ff848ba36f84c6b221e Binary files /dev/null and b/IMG/icones/dvi-dist.png differ diff --git a/IMG/icones/rpm-dist.png b/IMG/icones/rpm-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..7ef1fa7b6e1fd1c831645d25d196ff9c61d9d54c Binary files /dev/null and b/IMG/icones/rpm-dist.png differ diff --git a/IMG/icones/sxc-dist.png b/IMG/icones/sxc-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..a2a1ca6d6f880306d26ffc54ec71acf3112f2b2e Binary files /dev/null and b/IMG/icones/sxc-dist.png differ diff --git a/IMG/icones/tex-dist.png b/IMG/icones/tex-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..cb6488907c5c66422fec17973803fbf05355f9ac Binary files /dev/null and b/IMG/icones/tex-dist.png differ diff --git a/IMG/icones/xcf-dist.png b/IMG/icones/xcf-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..4e3fb96417038d9a8775a2153719b9ab255cce71 Binary files /dev/null and b/IMG/icones/xcf-dist.png differ diff --git a/ecrire/inc_base.php3 b/ecrire/inc_base.php3 index 41c9c663f162e23ba5bb31b3d8a440397cbde766..ca6b732a143c4846acebe012191286f7bfcf9eb0 100644 --- a/ecrire/inc_base.php3 +++ b/ecrire/inc_base.php3 @@ -514,53 +514,71 @@ function creer_base() { function remplir_type_documents() { + // Images reconnues par PHP $query = "INSERT IGNORE spip_types_documents (id_type, extension, titre, inclus) VALUES ". "(1, 'jpg', 'JPEG', 'image'), ". "(2, 'png', 'PNG', 'image'), ". "(3, 'gif', 'GIF', 'image')"; spip_query($query); + // Autres images (peuvent utiliser le tag <img>) $query = "INSERT IGNORE spip_types_documents (extension, titre, inclus) VALUES ". "('bmp', 'BMP', 'image'), ". "('psd', 'Photoshop', 'image'), ". "('tif', 'TIFF', 'image')"; spip_query($query); + // Multimedia (peuvent utiliser le tag <embed>) $query = "INSERT IGNORE spip_types_documents (extension, titre, inclus) VALUES ". "('aiff', 'AIFF', 'embed'), ". "('asf', 'Windows Media', 'embed'), ". "('avi', 'Windows Media', 'embed'), ". + "('mid', 'Midi', 'embed'), ". + "('mng', 'MNG', 'embed'), ". + "('mov', 'QuickTime', 'embed'), ". + "('mp3', 'MP3', 'embed'), ". + "('mpg', 'MPEG', 'embed'), ". + "('ogg', 'Ogg', 'embed'), ". + "('qt', 'QuickTime', 'embed'), ". + "('ra', 'RealAudio', 'embed'), ". + "('ram', 'RealAudio', 'embed'), ". + "('rm', 'RealAudio', 'embed'), ". + "('swf', 'Flash', 'embed'), ". + "('wav', 'WAV', 'embed'), ". + "('wmv', 'Windows Media', 'embed')"; + spip_query($query); + + // Documents varies + $query = "INSERT IGNORE spip_types_documents (extension, titre, inclus) VALUES ". + "('ai', 'Adobe Illustrator', 'non'), ". "('bz2', 'BZip', 'non'), ". + "('c', 'C source', 'non'), ". + "('deb', 'Debian', 'non'), ". "('doc', 'Word', 'non'), ". "('djvu', 'DjVu', 'non'), ". + "('dvi', 'LaTeX DVI', 'non'), ". "('eps', 'PostScript', 'non'), ". "('gz', 'GZ', 'non'), ". + "('h', 'C header', 'non'), ". "('html', 'HTML', 'non'), ". - "('mid', 'Midi', 'embed'), ". - "('mov', 'QuickTime', 'embed'), ". - "('mp3', 'MP3', 'embed'), ". - "('mpg', 'MPEG', 'embed'), ". - "('ogg', 'Ogg Vorbis', 'embed'), ". + "('pas', 'Pascal', 'non'), ". "('pdf', 'PDF', 'non'), ". "('ppt', 'PowerPoint', 'non'), ". "('ps', 'PostScript', 'non'), ". - "('qt', 'QuickTime', 'embed'), ". - "('ra', 'RealAudio', 'embed'), ". - "('ram', 'RealAudio', 'embed'), ". - "('rm', 'RealAudio', 'embed'), ". + "('rpm', 'RedHat/Mandrake/SuSE', 'non'), ". "('rtf', 'RTF', 'non'), ". "('sdd', 'StarOffice', 'non'), ". "('sdw', 'StarOffice', 'non'), ". "('sit', 'Stuffit', 'non'), ". + "('sxc', 'OpenOffice Calc', 'non'), ". "('sxi', 'OpenOffice Impress', 'non'), ". "('sxw', 'OpenOffice', 'non'), ". - "('swf', 'Flash', 'embed'), ". + "('tex', 'LaTeX', 'non'), ". "('tgz', 'TGZ', 'non'), ". "('txt', 'texte', 'non'), ". - "('wav', 'WAV', 'embed'), ". + "('xcf', 'GIMP multi-layer', 'non'), ". "('xls', 'Excel', 'non'), ". "('xml', 'XML', 'non'), ". - "('wmv', 'Windows Media', 'embed'), ". "('zip', 'Zip', 'non')"; spip_query($query); } @@ -1213,6 +1231,11 @@ function maj_base() { spip_query("ALTER TABLE spip_forum ADD INDEX id_syndic (id_syndic)"); maj_version (1.601); } + + if ($version_installee < 1.602) { + // juste des types de documents en plus (creer_base()) + maj_version (1.602); + } } ?> diff --git a/ecrire/inc_version.php3 b/ecrire/inc_version.php3 index 5883283faf3f010b41972e6610a95fcc93ca64d4..c95cb4b81be0184ef7ae177a3362365bb2356cca 100644 --- a/ecrire/inc_version.php3 +++ b/ecrire/inc_version.php3 @@ -144,10 +144,10 @@ if ($flag_ecrire) { // (utilise pour les modifs de la base de donnees) // version de la base -$spip_version = 1.601; +$spip_version = 1.602; // version de spip -$spip_version_affichee = "1.6b7 CVS"; +$spip_version_affichee = "1.6b8 CVS"; // version de spip / tag cvs if (ereg('Name: v(.*) ','$Name$', $regs)) $spip_version_affichee = $regs[1]; diff --git a/spip_image.php3 b/spip_image.php3 index 4e7e518931788d01c618fc7b37dfc312ab51b2fa..e61dec7683b10b0d8335ffbcf5d68200aa2a776d 100644 --- a/spip_image.php3 +++ b/spip_image.php3 @@ -238,7 +238,6 @@ function ajout_doc($orig, $source, $dest, $mode, $id_document, $doc_vignette='', if (!verifier_action_auteur("ajout_doc", $hash, $hash_id_auteur)) { exit; } - if (ereg("\.([^.]+)$", $orig, $match)) { $ext = addslashes(strtolower($match[1])); @@ -257,9 +256,21 @@ function ajout_doc($orig, $source, $dest, $mode, $id_document, $doc_vignette='', else return false; // - // Preparation + // Recopier le fichier // + $dest = 'IMG/'; + if (creer_repertoire('IMG', $ext)) + $dest .= $ext.'/'; + $dest .= ereg_replace("[^.a-zA-Z0-9_=-]+", "_", translitteration(ereg_replace("\.([^.]+)$", "", supprimer_tags(basename($orig))))); + $n = 0; + while (file_exists($newFile = $dest.($n++ ? '-'.$n : '').'.'.$ext)); + $dest_path = $newFile; + + if (!deplacer_fichier_upload($source, $dest_path)) return false; + // + // Preparation + // if ($mode == 'vignette') { $id_document_lie = $id_document; $query = "UPDATE spip_documents SET mode='document' where id_document=$id_document_lie"; @@ -277,17 +288,9 @@ function ajout_doc($orig, $source, $dest, $mode, $id_document, $doc_vignette='', } } - $dest = 'IMG/'; - if (creer_repertoire('IMG', $ext)) - $dest .= $ext.'/'; - $dest .= ereg_replace("[^.a-zA-Z0-9_=-]+", "_", translitteration(ereg_replace("\.([^.]+)$", "", supprimer_tags(basename($orig))))); - $n = 0; - while (file_exists($newFile = $dest.($n++ ? '-'.$n : '').'.'.$ext)); - $dest_path = $newFile; - - if (!deplacer_fichier_upload($source, $dest_path)) return false; - + // // Creer une vignette automatiquement + // $creer_preview=lire_meta("creer_preview"); $taille_preview=lire_meta("taille_preview"); $gd_formats = lire_meta("gd_formats"); @@ -314,9 +317,8 @@ function ajout_doc($orig, $source, $dest, $mode, $id_document, $doc_vignette='', } // - // Recopier le fichier + // Mettre a jour les infos du document uploade // - $size_image = getimagesize($dest_path); $type_image = decoder_type_image($size_image[2]); if ($type_image) { @@ -351,7 +353,6 @@ function ajout_doc($orig, $source, $dest, $mode, $id_document, $doc_vignette='', } - return $id_document; }