mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-28 09:38:53 +01:00
using new mime icons for tile view in 64x64
This commit is contained in:
parent
989adb3fc3
commit
4a12f12683
@ -77,7 +77,7 @@ table.egwGridView_grid .tile .file_tile {
|
|||||||
table.egwGridView_grid .tile .file_tile img.vfsMimeIcon {
|
table.egwGridView_grid .tile .file_tile img.vfsMimeIcon {
|
||||||
height: auto;
|
height: auto;
|
||||||
width: auto;
|
width: auto;
|
||||||
max-height: 120px;
|
max-height: 64px;
|
||||||
display:block;
|
display:block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* EGroupware: CSS with less preprocessor
|
* EGroupware: CSS with less preprocessor
|
||||||
|
*
|
||||||
* FILEMANAGER
|
* FILEMANAGER
|
||||||
*
|
*
|
||||||
* Please do NOT change app.css directly, instead change app.less and compile it!
|
* Please do NOT change app.css directly, instead change app.less and compile it!
|
||||||
@ -107,7 +107,7 @@ table.egwGridView_grid .tile .file_tile {
|
|||||||
table.egwGridView_grid .tile .file_tile img.vfsMimeIcon {
|
table.egwGridView_grid .tile .file_tile img.vfsMimeIcon {
|
||||||
height: auto;
|
height: auto;
|
||||||
width: auto;
|
width: auto;
|
||||||
max-height: 120px;
|
max-height: 64px;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* EGroupware: CSS with less preprocessor
|
* EGroupware: CSS with less preprocessor
|
||||||
|
*
|
||||||
* FILEMANAGER
|
* FILEMANAGER
|
||||||
*
|
*
|
||||||
* Please do NOT change app.css directly, instead change app.less and compile it!
|
* Please do NOT change app.css directly, instead change app.less and compile it!
|
||||||
|
@ -1131,10 +1131,13 @@ class egw_vfs extends vfs_stream_wrapper
|
|||||||
$mime_full = strtolower(str_replace ('/','_',$mime_type));
|
$mime_full = strtolower(str_replace ('/','_',$mime_type));
|
||||||
list($mime_part) = explode('_',$mime_full);
|
list($mime_part) = explode('_',$mime_full);
|
||||||
|
|
||||||
if (!($img=$GLOBALS['egw']->common->image('etemplate',$icon='mime'.$size.'_'.$mime_full)) &&
|
if (!($img=common::image('etemplate',$icon='mime'.$size.'_'.$mime_full)) &&
|
||||||
!($img=$GLOBALS['egw']->common->image('etemplate',$icon='mime'.$size.'_'.$mime_part)))
|
// check mime-alias-map before falling back to more generic icons
|
||||||
|
!(isset(mime_magic::$mime_alias_map[$mime_type]) &&
|
||||||
|
($img=common::image('etemplate',$icon='mime'.$size.'_'.str_replace('/','_',self::$mime_alias_map[$mime_full])))) &&
|
||||||
|
!($img=common::image('etemplate',$icon='mime'.$size.'_'.$mime_part)))
|
||||||
{
|
{
|
||||||
$img = $GLOBALS['egw']->common->image('etemplate',$icon='mime'.$size.'_unknown');
|
$img = common::image('etemplate',$icon='mime'.$size.'_unknown');
|
||||||
}
|
}
|
||||||
if ($et_image === 'url')
|
if ($et_image === 'url')
|
||||||
{
|
{
|
||||||
@ -1813,7 +1816,7 @@ class egw_vfs extends vfs_stream_wrapper
|
|||||||
|
|
||||||
if ($mime_main == 'egw')
|
if ($mime_main == 'egw')
|
||||||
{
|
{
|
||||||
$image = $GLOBALS['egw']->common->image($mime_sub, 'navbar');
|
$image = common::image($mime_sub, 'navbar');
|
||||||
}
|
}
|
||||||
else if ($file && $mime_main == 'image' && in_array($mime_sub, array('png','jpeg','jpg','gif','bmp')) &&
|
else if ($file && $mime_main == 'image' && in_array($mime_sub, array('png','jpeg','jpg','gif','bmp')) &&
|
||||||
(string)$GLOBALS['egw_info']['server']['link_list_thumbnail'] != '0' &&
|
(string)$GLOBALS['egw_info']['server']['link_list_thumbnail'] != '0' &&
|
||||||
|
@ -1658,6 +1658,8 @@ class mime_magic
|
|||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
* Mapping some old formats to the newer form, or any other aliasing for mime-types
|
* Mapping some old formats to the newer form, or any other aliasing for mime-types
|
||||||
|
*
|
||||||
|
* Should be in sync with ../js/jsapi/egw_image.js
|
||||||
*/
|
*/
|
||||||
static $mime_alias_map = array(
|
static $mime_alias_map = array(
|
||||||
'text/vcard' => 'text/x-vcard',
|
'text/vcard' => 'text/x-vcard',
|
||||||
|
@ -25,6 +25,23 @@ egw.extend('images', egw.MODULE_GLOBAL, function() {
|
|||||||
*/
|
*/
|
||||||
var images = {};
|
var images = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mapping some old formats to the newer form, or any other aliasing for mime-types
|
||||||
|
*
|
||||||
|
* Should be in sync with ../inc/class.mime_magic.inc.php
|
||||||
|
*/
|
||||||
|
var mime_alias_map = {
|
||||||
|
'text/vcard': 'text/x-vcard',
|
||||||
|
'text/comma-separated-values': 'text/csv',
|
||||||
|
'text/rtf': 'application/rtf',
|
||||||
|
'text/xml': 'application/xml',
|
||||||
|
'text/x-diff': 'text/diff',
|
||||||
|
'application/x-jar': 'application/java-archive',
|
||||||
|
'application/x-javascript': 'application/javascript',
|
||||||
|
'application/x-troff': 'text/troff',
|
||||||
|
'application/x-egroupware-etemplate': 'application/xml'
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
* Set imagemap, called from /phpgwapi/images.php
|
* Set imagemap, called from /phpgwapi/images.php
|
||||||
@ -99,12 +116,12 @@ egw.extend('images', egw.MODULE_GLOBAL, function() {
|
|||||||
*
|
*
|
||||||
* @param {string} _mime
|
* @param {string} _mime
|
||||||
* @param {string} _path vfs path to generate thumbnails for images
|
* @param {string} _path vfs path to generate thumbnails for images
|
||||||
* @param {number} _size defaults to 16 (only supported size currently)
|
* @param {number} _size defaults to 128 (only supported size currently)
|
||||||
* @returns url of image
|
* @returns url of image
|
||||||
*/
|
*/
|
||||||
mime_icon: function(_mime, _path, _size)
|
mime_icon: function(_mime, _path, _size)
|
||||||
{
|
{
|
||||||
if (typeof _size == 'undefined') _size = 16;
|
if (typeof _size == 'undefined') _size = 128;
|
||||||
if (!_mime) _mime = 'unknown';
|
if (!_mime) _mime = 'unknown';
|
||||||
if (_mime == 'httpd/unix-directory') _mime = 'directory';
|
if (_mime == 'httpd/unix-directory') _mime = 'directory';
|
||||||
|
|
||||||
@ -123,7 +140,8 @@ egw.extend('images', egw.MODULE_GLOBAL, function() {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((typeof type[1] == 'undefined' || !(image = this.image('mime'+_size+'_'+type[0]+'_'+type[1], 'etemplate'))) &&
|
if ((typeof type[1] == 'undefined' || !(image = this.image('mime'+_size+'_'+type[0]+'_'+type[1], 'etemplate')) &&
|
||||||
|
!(typeof mime_alias_map[_mime] != 'undefined' && (image=this.mime_icon(mime_alias_map[_mime], _path, _size)))) &&
|
||||||
!(image = this.image('mime'+_size+'_'+type[0], 'etemplate')))
|
!(image = this.image('mime'+_size+'_'+type[0], 'etemplate')))
|
||||||
{
|
{
|
||||||
image = this.image('mime'+_size+'_unknown', 'etemplate');
|
image = this.image('mime'+_size+'_unknown', 'etemplate');
|
||||||
|
Loading…
Reference in New Issue
Block a user