diff --git a/ifm.php b/ifm.php index 2ecfe34..35adfb4 100644 --- a/ifm.php +++ b/ifm.php @@ -466,6 +466,7 @@ function IFM() { this.IFM_SCFN = ""; this.config = jQuery.parseJSON(''); // serialize the PHP config array, so we can use it in JS too + this.isDocroot = ; this.editor = null; // global ace editor this.fileChanged = false; // flag for check if file was changed already this.currentDir = ""; // this is the global variable for the current directory; it is used for AJAX requests @@ -523,16 +524,20 @@ function IFM() { else if( self.config.edit == 1 && data[i].name.toLowerCase().substr(-4) != ".zip" ) newRow += ' data-eaction="edit"'; newRow += '>"'; + if( self.isDocroot ) { + newRow += ' href="'+self.pathCombine(ifm.currentDir,data[i].name)+'"'; + if( data[i].icon.indexOf( 'file-image' ) !== -1 ) + newRow += ' data-toggle="tooltip" title=" ' + ( data[i].name == '..' ? '[ up ]' : data[i].name ) + ''; if( ( data[i].type != "dir" && self.config.download == 1 ) || ( data[i].type == "dir" && self.config.zipnload == 1 ) ) { - var guid = self.generateGuid(); newRow += '
'; newRow += ''; newRow += ''; diff --git a/src/ifm.js b/src/ifm.js index 109e908..c0a830e 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -5,6 +5,7 @@ function IFM() { this.IFM_SCFN = ""; this.config = jQuery.parseJSON(''); // serialize the PHP config array, so we can use it in JS too + this.isDocroot = ; this.editor = null; // global ace editor this.fileChanged = false; // flag for check if file was changed already this.currentDir = ""; // this is the global variable for the current directory; it is used for AJAX requests @@ -62,16 +63,20 @@ function IFM() { else if( self.config.edit == 1 && data[i].name.toLowerCase().substr(-4) != ".zip" ) newRow += ' data-eaction="edit"'; newRow += '>"'; + if( self.isDocroot ) { + newRow += ' href="'+self.pathCombine(ifm.currentDir,data[i].name)+'"'; + if( data[i].icon.indexOf( 'file-image' ) !== -1 ) + newRow += ' data-toggle="tooltip" title=" ' + ( data[i].name == '..' ? '[ up ]' : data[i].name ) + ''; if( ( data[i].type != "dir" && self.config.download == 1 ) || ( data[i].type == "dir" && self.config.zipnload == 1 ) ) { - var guid = self.generateGuid(); newRow += ''; newRow += ''; newRow += '';