diff --git a/src/ifm.js b/src/ifm.js index e48233a..b6b5b6d 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -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=""'; - 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", diff --git a/src/main.php b/src/main.php index acb9538..b71e73a 100644 --- a/src/main.php +++ b/src/main.php @@ -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 ) {