diff --git a/ifm.php b/ifm.php index 6f76870..d52836f 100644 --- a/ifm.php +++ b/ifm.php @@ -35,7 +35,7 @@ class IFMConfig { const showowner = 1; // show file owner? const showgroup = 1; // show file group? const showpath = 0; // show real path of directory (not only root)? - const showrights = 1; // show permissions 0 -> not; 1 -> octal, 2 -> human readable + const showrights = 2; // show permissions 0 -> not; 1 -> octal, 2 -> human readable const showhtdocs = 1; // show .htaccess and .htpasswd const showhiddenfiles = 1; // show files beginning with a dot (e.g. ".bashrc") @@ -376,7 +376,8 @@ min-width:200px; right:0; top:0; } #options ul li:before { content: '\2192\00A0' #filetable tr:hover { background-color: rgba(0, 0, 0, 0.12); } #filetable tbody tr.selected { border: 1px dashed #777 !important; background-color: #FFE4C4; } #filetable tbody tr:last-child { border-bottom: 1px solid #EBEBEB; } -#filetable input[type^=text] { width:50px; text-align:center; } .download-link { font-size: 0.9em; } .overlay { z-index:5; } .overlay fieldset { border: 0; background-color: white;} +#filetable input[type^=text] { width:50px; text-align:center; } #filetable input[type^=text].short { width:50px; } #filetable input[type^=text].long { width: 100px; } +.download-link { font-size: 0.9em; } .overlay { z-index:5; } .overlay fieldset { border: 0; background-color: white;} .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; text-align: center; background-color: rgba(0,0,0,0.7);} .overlay form { width: 80%; margin: 3em auto; text-align: left; } .overlay form fieldset { position:relative; } .overlay form#showFile { height:80%; } .overlay form#showFile fieldset { height:100%; } .overlay select { float:right; margin-top:10px; padding:10px; } @@ -525,6 +526,7 @@ if(!ifm) { newrow += ' onkeypress="ifm.changePermissions(event, \''+data[i].name+'\');"'; else newrow += " readonly"; + newrow += ( data[i].filepermmode.trim() != "" ) ? ' class="' + data[i].filepermmode + '"' : ''; newrow += '>'; } if(data[i].owner) newrow += ''+data[i].owner+''; @@ -1344,6 +1346,7 @@ $(document).ready(function() {ifm.init()}); // init ifm if( IFMConfig::showrights == 1 ) $item["fileperms"] = substr( decoct( fileperms( $result ) ), -3 ); elseif( IFMConfig::showrights == 2 ) $item["fileperms"] = $this->filePermsDecode( fileperms( $result ) ); if( $item["fileperms"] == "" ) $item["fileperms"] = " "; + $item["filepermmode"] = ( IFMConfig::showrights == 1 ) ? "short" : "long"; } if( IFMConfig::showowner == 1 ) { if ( function_exists( "posix_getpwuid" ) && fileowner($result) !== false ) { diff --git a/src/config.php b/src/config.php index fd14ccc..f2cc2b5 100644 --- a/src/config.php +++ b/src/config.php @@ -35,7 +35,7 @@ class IFMConfig { const showowner = 1; // show file owner? const showgroup = 1; // show file group? const showpath = 0; // show real path of directory (not only root)? - const showrights = 1; // show permissions 0 -> not; 1 -> octal, 2 -> human readable + const showrights = 2; // show permissions 0 -> not; 1 -> octal, 2 -> human readable const showhtdocs = 1; // show .htaccess and .htpasswd const showhiddenfiles = 1; // show files beginning with a dot (e.g. ".bashrc") diff --git a/src/ifm.js b/src/ifm.js index 5f5fb15..722092e 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -124,6 +124,7 @@ if(!ifm) { newrow += ' onkeypress="ifm.changePermissions(event, \''+data[i].name+'\');"'; else newrow += " readonly"; + newrow += ( data[i].filepermmode.trim() != "" ) ? ' class="' + data[i].filepermmode + '"' : ''; newrow += '>'; } if(data[i].owner) newrow += ''+data[i].owner+''; diff --git a/src/main.php b/src/main.php index c0004c5..9f34233 100644 --- a/src/main.php +++ b/src/main.php @@ -213,6 +213,7 @@ class IFM { if( IFMConfig::showrights == 1 ) $item["fileperms"] = substr( decoct( fileperms( $result ) ), -3 ); elseif( IFMConfig::showrights == 2 ) $item["fileperms"] = $this->filePermsDecode( fileperms( $result ) ); if( $item["fileperms"] == "" ) $item["fileperms"] = " "; + $item["filepermmode"] = ( IFMConfig::showrights == 1 ) ? "short" : "long"; } if( IFMConfig::showowner == 1 ) { if ( function_exists( "posix_getpwuid" ) && fileowner($result) !== false ) { diff --git a/src/style.css b/src/style.css index 02ace01..36c14fb 100644 --- a/src/style.css +++ b/src/style.css @@ -35,7 +35,8 @@ min-width:200px; right:0; top:0; } #options ul li:before { content: '\2192\00A0' #filetable tr:hover { background-color: rgba(0, 0, 0, 0.12); } #filetable tbody tr.selected { border: 1px dashed #777 !important; background-color: #FFE4C4; } #filetable tbody tr:last-child { border-bottom: 1px solid #EBEBEB; } -#filetable input[type^=text] { width:50px; text-align:center; } .download-link { font-size: 0.9em; } .overlay { z-index:5; } .overlay fieldset { border: 0; background-color: white;} +#filetable input[type^=text] { width:50px; text-align:center; } #filetable input[type^=text].short { width:50px; } #filetable input[type^=text].long { width: 100px; } +.download-link { font-size: 0.9em; } .overlay { z-index:5; } .overlay fieldset { border: 0; background-color: white;} .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; text-align: center; background-color: rgba(0,0,0,0.7);} .overlay form { width: 80%; margin: 3em auto; text-align: left; } .overlay form fieldset { position:relative; } .overlay form#showFile { height:80%; } .overlay form#showFile fieldset { height:100%; } .overlay select { float:right; margin-top:10px; padding:10px; }