1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-11 18:43:58 +02:00

Provide file extension to client, disallow image editing

This commit is contained in:
Jannis Rondorf
2017-07-24 08:09:20 +02:00
parent 64365dbc4f
commit 72110c866d
2 changed files with 4 additions and 3 deletions

View File

@@ -102,17 +102,17 @@ function IFM( params ) {
item.download.icon = "icon icon-download";
if( item.icon.indexOf( 'file-image' ) !== -1 && self.config.isDocroot )
item.tooltip = 'data-toggle="tooltip" title="<img src=\'' + self.pathCombine( self.currentDir, item.name ) + '\' class=\'imgpreview\'>"';
if( item.name.toLowerCase().substr(-4) == ".zip" )
if( item.ext == ".zip" )
item.eaction = "extract";
else
item.eaction = "edit";
if( self.config.edit && item.name.toLowerCase().substr(-4) != ".zip" )
if( self.config.edit && item.ext != ".zip" && item.icon.indexOf( 'file-image' ) == -1)
item.button.push({
action: "edit",
icon: "icon icon-pencil",
title: "edit"
});
if( self.config.extract && item.name.toLowerCase().substr(-4) == ".zip" )
if( self.config.extract && item.ext == ".zip" )
item.button.push({
action: "extract",
icon: "icon icon-archive",

View File

@@ -260,6 +260,7 @@ f00bar;
$item["type"] = "file";
$type = substr( strrchr( $result, "." ), 1 );
$item["icon"] = $this->getTypeIcon( $type );
$item["ext"] = strtolower($type);
}
if( $this->config['showlastmodified'] == 1 ) { $item["lastmodified"] = date( "d.m.Y, G:i e", filemtime( $result ) ); }
if( $this->config['showfilesize'] == 1 ) {