* Api/Filemanager: add mime icons to minimal install
70
api/templates/default/images/mime128.php
Executable file
@ -0,0 +1,70 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
/**
|
||||
* EGroupWare: Convert eagerterrier mime icons
|
||||
*
|
||||
* @link https://github.com/eagerterrier/MimeTypes-Link-Icons
|
||||
* @link http://www.egroupware.org
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @package api
|
||||
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @copyright (c) 2015/16 by Ralf Becker <RalfBecker-AT-outdoor-training.de>
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
use EGroupware\Api\MimeMagic;
|
||||
|
||||
require_once '../../../../api/src/autoload.php';
|
||||
|
||||
/* compare current Horde $mime_extension_map with ours
|
||||
include_once 'Horde/Mime/mime.mapping.php';
|
||||
|
||||
foreach($mime_extension_map as $ext => $type)
|
||||
{
|
||||
if (!isset(MimeMagic::$mime_extension_map[$ext]))
|
||||
{
|
||||
echo "+\t$ext\t$type\n";
|
||||
}
|
||||
elseif(strtolower($type) === strtolower(MimeMagic::$mime_extension_map[$ext]))
|
||||
{
|
||||
echo "\t$ext\t$type\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "-\t$ext\t".MimeMagic::$mime_extension_map[$ext]."\n";
|
||||
echo "+\t$ext\t$type\n";
|
||||
}
|
||||
}
|
||||
exit;
|
||||
*/
|
||||
|
||||
// make sure these mime-type get their default extensions icon, not some alias
|
||||
$overwrites = array(
|
||||
'txt' => 'text/plain',
|
||||
'ogg' => 'audio/ogg',
|
||||
'ppt' => 'application/vnd.ms-powerpoint',
|
||||
'qt' => 'video/quicktime',
|
||||
);
|
||||
$src_dir=__DIR__.'/MimeTypes-Link-Icons/images';
|
||||
$dst_dir=__DIR__;
|
||||
foreach(scandir($src_dir) as $file)
|
||||
{
|
||||
if (preg_match('/^([^-]+)-icon-128x128.png$/', $file, $matches))
|
||||
{
|
||||
if (!isset(MimeMagic::$mime_extension_map[$matches[1]]))
|
||||
{
|
||||
echo "Unknown extension '$matches[1]'!\n";
|
||||
continue;
|
||||
}
|
||||
$type = MimeMagic::$mime_extension_map[$matches[1]];
|
||||
$dst_file = 'mime128_'.str_replace('/', '_', $type).'.png';
|
||||
if (file_exists($dst_dir.'/'.$dst_file) && !isset($overwrites[$matches[1]]))
|
||||
{
|
||||
echo "Icon for extension '$matches[1]' = $type already exists!\n";
|
||||
continue;
|
||||
}
|
||||
copy($src_dir.'/'.$file, $dst_dir.'/'.$dst_file);
|
||||
echo "$file --> $dst_file\n";
|
||||
}
|
||||
//else echo "Ignoring $file\n";
|
||||
}
|
BIN
api/templates/default/images/mime128_application_epub+zip.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
api/templates/default/images/mime128_application_javascript.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
api/templates/default/images/mime128_application_msword.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
BIN
api/templates/default/images/mime128_application_pdf.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
api/templates/default/images/mime128_application_postscript.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_application_rtf.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 20 KiB |
BIN
api/templates/default/images/mime128_application_vnd.koan.png
Normal file
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 6.3 KiB |
BIN
api/templates/default/images/mime128_application_x-font-ttf.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_application_x-gtar.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
api/templates/default/images/mime128_application_x-gzip.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
api/templates/default/images/mime128_application_x-httpd-php.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 11 KiB |
BIN
api/templates/default/images/mime128_application_x-rpm.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_application_x-sh.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
api/templates/default/images/mime128_application_x-sql.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
api/templates/default/images/mime128_application_x-tar.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
api/templates/default/images/mime128_application_x-tex.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
api/templates/default/images/mime128_application_x-xpinstall.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
api/templates/default/images/mime128_application_xml.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
api/templates/default/images/mime128_application_zip.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
api/templates/default/images/mime128_audio.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
api/templates/default/images/mime128_audio_midi.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
api/templates/default/images/mime128_audio_mp4.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
api/templates/default/images/mime128_audio_mpeg.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
api/templates/default/images/mime128_audio_ogg.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
api/templates/default/images/mime128_audio_x-flac.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
api/templates/default/images/mime128_audio_x-pn-realaudio.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_audio_x-wav.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
api/templates/default/images/mime128_directory.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
api/templates/default/images/mime128_image_gif.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
api/templates/default/images/mime128_image_jpeg.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
api/templates/default/images/mime128_image_png.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
api/templates/default/images/mime128_image_tiff.png
Normal file
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 12 KiB |
BIN
api/templates/default/images/mime128_image_vnd.djvu.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
api/templates/default/images/mime128_image_vnd.dwg.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
api/templates/default/images/mime128_image_x-icon.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
api/templates/default/images/mime128_message_rfc822.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
api/templates/default/images/mime128_model_vnd.dwf.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
api/templates/default/images/mime128_text_calendar.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
api/templates/default/images/mime128_text_css.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_text_csv.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
api/templates/default/images/mime128_text_html.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
api/templates/default/images/mime128_text_plain.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
api/templates/default/images/mime128_text_x-bibtex.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
api/templates/default/images/mime128_text_x-fortran.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
api/templates/default/images/mime128_text_x-python.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
api/templates/default/images/mime128_text_x-tex.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
api/templates/default/images/mime128_text_x-vcard.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
api/templates/default/images/mime128_unknown.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
api/templates/default/images/mime128_video.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
api/templates/default/images/mime128_video_3gpp.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
api/templates/default/images/mime128_video_3gpp2.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
api/templates/default/images/mime128_video_mp4.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_video_mpeg.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_video_ogg.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
api/templates/default/images/mime128_video_quicktime.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
api/templates/default/images/mime128_video_vnd.rn-realvideo.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_video_x-flv.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_video_x-m4v.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_video_x-matroska.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
api/templates/default/images/mime128_video_x-ms-asf.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_video_x-ms-vob.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
api/templates/default/images/mime128_video_x-ms-wmv.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
api/templates/default/images/mime128_video_x-msvideo.png
Normal file
After Width: | Height: | Size: 10 KiB |