diff --git a/src/config.php b/src/config.php
index 206d47f..fd14ccc 100644
--- a/src/config.php
+++ b/src/config.php
@@ -6,7 +6,7 @@
* License: This project is provided under the terms of the MIT LICENSE
* http://github.com/misterunknown/ifm/blob/master/LICENSE
* =======================================================================
- *
+ *
* config
*/
@@ -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 = 2; // show permissions 0 -> not; 1 -> octal, 2 -> human readable
+ const showrights = 1; // 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 4dc29a8..5f5fb15 100644
--- a/src/ifm.js
+++ b/src/ifm.js
@@ -139,9 +139,9 @@ if(!ifm) {
\
';
if( data[i].name == "." )
- newrow += 'download current directory';
+ //newrow += 'download current directory';
newrow += '\
\
';
diff --git a/src/main.php b/src/main.php
index 37be4c4..ed7c1ab 100644
--- a/src/main.php
+++ b/src/main.php
@@ -6,7 +6,7 @@
* License: This project is provided under the terms of the MIT LICENSE
* http://github.com/misterunknown/ifm/blob/master/LICENSE
* =======================================================================
- *
+ *
* main
*/
@@ -55,28 +55,28 @@ class IFM {
';
// refresh button - always shows
print '
';
// upload button
if(IFMConfig::upload == 1) {
print '
';
}
// create file button
if(IFMConfig::createfile == 1) {
print '
';
}
// create directory button
if(IFMConfig::createdir == 1) {
print '
';
}
// create options button
- print '

';
+ print ' 
';
$options = false;
if(IFMConfig::remoteupload == 1) {
print '- Remote upload
';
@@ -85,7 +85,7 @@ class IFM {
if(IFMConfig::ajaxrequest == 1) {
print '- AJAX Request
';
$options = true;
- }
+ }
if(!$options) print '- No options available
';
print '
';
print 'ver '.IFM::VERSION.'
@@ -292,7 +292,7 @@ class IFM {
$this->chDirIfNecessary( $d['dir'] );
if( file_exists( $d['filename'] ) ) {
$content = @file_get_contents( $d['filename'] );
- $utf8content = mb_convert_encoding( $content, 'UTF-8', mb_detect_encoding( $content, 'UTF-8, ISO-8859-1', true ) );
+ $utf8content = mb_convert_encoding( $content, 'UTF-8', mb_detect_encoding( $content, 'UTF-8, ISO-8859-1', true ) );
echo json_encode( array( "status" => "OK", "data" => array( "filename" => $d['filename'], "content" => $utf8content ) ) );
} else echo json_encode( array( "status" => "ERROR", "message" => "File not found" ) );
}
@@ -313,7 +313,7 @@ class IFM {
echo json_encode( array( "status" => "OK", "message" => "Directoy successful deleted" ) );
}
}
- else{
+ else{
if( @unlink( $d['filename'] ) ) {
echo json_encode( array( "status" => "OK", "message" => "File successful deleted" ) );
} else {
@@ -336,7 +336,7 @@ class IFM {
array_push( $err, $file );
else
$errFLAG = 0;
- } else {
+ } else {
if( @unlink($file) )
$errFLAG = 0;
else
@@ -408,7 +408,7 @@ class IFM {
echo json_encode( array( "status" => "ERROR","message" => "Target directory must not contain slashes" ) );
else {
switch( $d['targetdir'] ){
- case "":
+ case "":
if( $this->unzip( $_POST["filename"] ) )
echo json_encode( array( "status" => "OK","message" => "File successfully extracted." ) );
else
@@ -417,7 +417,7 @@ class IFM {
default:
if( ! mkdir( $d['targetdir'] ) )
echo json_encode( array( "status" => "ERROR","message" => "Could not create target directory" ) );
- else {
+ else {
chdir( $d['targetdir'] );
if( ! $this->unzip( "../" . $d["filename"] ) ) {
chdir( ".." );
@@ -524,10 +524,10 @@ class IFM {
if( $d['filename'] == "." ) {
if( getcwd() == $this->getScriptRoot() )
$d['filename'] = "root";
- else
+ else
$d['filename'] = basename( getcwd() );
}
- header( "Content-Disposition: attachment; filename=\"".$d['filename'].".zip\"" );
+ header( "Content-Disposition: attachment; filename=\"".$d['filename'].".zip\"" );
readfile( $dfile );
} catch ( Exception $e ) {
echo "An error occured: " . $e->getMessage();
@@ -549,21 +549,21 @@ class IFM {
elseif( $d['method']=="curl" && $this->checkCurl( ) == true ) {
$filename = ( isset( $d['filename'] )&&$d['filename']!="" )?$d['filename']:"curl_".uniqid( );
$this->chDirIfNecessary( $d['dir'] );
- $ch = curl_init( );
+ $ch = curl_init( );
if( $ch ) {
if( $this->allowedFileName( $filename ) == false )
echo json_encode( array( "status" => "ERROR", "message" => "This filename is not allowed due to the config." ) );
elseif( filter_var( $d['url'], FILTER_VALIDATE_URL ) === false )
echo json_encode( array( "status" => "ERROR", "message" => "The passed URL is not valid" ) );
else {
- $fp = fopen( $filename, "w" );
+ $fp = fopen( $filename, "w" );
if( $fp ) {
if( !curl_setopt( $ch, CURLOPT_URL, $d['url'] ) || !curl_setopt( $ch, CURLOPT_FILE, $fp ) || !curl_setopt( $ch, CURLOPT_HEADER, 0 ) || !curl_exec( $ch ) )
echo json_encode( array( "status" => "ERROR", "message" => "Failed to set options and execute cURL" ) );
else {
echo json_encode( array( "status" => "OK", "message" => "File sucessfully uploaded" ) );
}
- curl_close( $ch );
+ curl_close( $ch );
fclose( $fp );
} else {
echo json_encode( array( "status" => "ERROR", "message" => "Failed to open file" ) );
@@ -645,11 +645,11 @@ class IFM {
IFM - improved file manager
@@ -683,7 +683,7 @@ class IFM {
array_key_exists( $oct[ 1 ], $masks ) ? $masks[ $oct[ 1 ] ] : '###',
array_key_exists( $oct[ 0 ], $masks ) ? $masks[ $oct[ 0 ] ] : '###')
);
- }
+ }
private function isPathValid($p) {
if( $p == "" ) {
@@ -770,7 +770,7 @@ class IFM {
private function pathCombine( $a, $b ) {
if( $a=="" && $b=="" )
return "";
- else
+ else
return ltrim( rtrim( $a, '/' ) . '/' . ltrim( $b, '/' ), '/' );
}
@@ -806,12 +806,12 @@ class IFM {
// is cURL extention avaliable?
private function checkCurl() {
- if( ! function_exists( "curl_init" ) &&
- !function_exists( "curl_setopt" ) &&
- !function_exists( "curl_exec" ) &&
- !function_exists( "curl_close" ) ) return false;
- else return true;
- }
+ if( ! function_exists( "curl_init" ) &&
+ !function_exists( "curl_setopt" ) &&
+ !function_exists( "curl_exec" ) &&
+ !function_exists( "curl_close" ) ) return false;
+ else return true;
+ }
///helper
}
diff --git a/src/style.css b/src/style.css
index 452b5a4..02ace01 100644
--- a/src/style.css
+++ b/src/style.css
@@ -1,7 +1,9 @@
-* { -moz-box-sizing: border-box; box-sizing: border-box; } html, body { font-family: Arial, non-serif; font-weight: 100; font-size: 12pt; background: #FFF;}
-footer { margin-top:20px; margin-bottom:10px; border:1px #CCC dashed; padding:3px; color:#222; font-size:0.6em; }
-footer a { color:#00E; } a { text-decoration:none; color: #000; cursor: pointer; } a:hover { color: #333; } img { vertical-align:middle; border:0; }
-button > img { width: 19px; } a > img { width: 25px; } #multiseloptions a > img { width:19px; } button { margin: 1px; margin-top: 10px; padding: 10px; border: 1px solid black; }
+* { -moz-box-sizing: border-box; box-sizing: border-box; } html, body { font-family: Monospace, Arial, non-serif; font-weight: 100; font-size: 8pt; background: #FFF;}
+input, select { font-family: Monospace; font-size: 8pt; vertical-align: middle; }
+footer { display: none; margin-top:20px; margin-bottom:10px; border:1px #CCC dashed; padding:3px; color:#222; font-size:0.6em; }
+footer a { color:#00E; } a { text-decoration:none; color: #000; cursor: pointer; } a:hover { color: #a0a0a0; } img { vertical-align:middle; border:0; }
+button > img { width: 15px; cursor: pointer; } a > img { width: 19px; } #multiseloptions a > img { width:18px; }
+button { margin: 3px; margin-top: 10px; padding: 9px 12px; border: 1px solid #444; border-radius: 2px; font-size: 0.9em; font-weight: bold; text-transform: uppercase; cursor: pointer; background: #444; color: #fff; }
#tooltab button, #filetable button { margin:1px; padding:1px 4px; background: none; border: 0; } #version { font-size:0.8em; }
#mess { position: fixed; top: 2em; left: 50%; z-index: 10; }
#mess>div { position:relative; left:-50%;display: inline-block; padding: 25px; background-color: #EEE; border-radius: 10px; box-shadow:#333 3px 3px 10px; }
@@ -18,17 +20,22 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00dd00', end
#tooltab { clear: both; padding: 3px; width: 100%; border-collapse:collapse; margin-bottom:3px; }
#tooltab .cell_content { } #tooltab .cell_buttons { text-align: right; width:300px; } #options ul { text-align: left; }
#tooltab input[type="text"], textarea { width: 75%; margin-left: 5px; } #tooltab tr { height: 50px; } #currentDir { height: 30px; }
-td.cell_buttons > div { position: fixed; top: 10px; right: 10px; background: #FFF; padding: 10px; border-radius: 5px; box-shadow: 1px 1px 10px #000; }
-#options { display: inline-block; position: relative; } #options img { width: 20px; } #options ul { display: none; }
+td.cell_buttons > div { position: fixed; top: 10px; right: 10px; background: #FFF; padding: 10px; border-radius: 3px; box-shadow: 1px 1px 10px rgba(0,0,0,0.15); }
+#options { display: inline-block; position: relative; } #options img { width: 18px; } #options ul { display: none; }
#options:hover>ul { display: inline-block; position: absolute; padding: 3px; border: 1px solid #CCC; background-color: #FFF; list-style-type:none; margin:0;
min-width:200px; right:0; top:0; } #options ul li:before { content: '\2192\00A0' }
-#filetable { padding:5px; width:100%; border-collapse: collapse;} #filetable thead { border: 1px solid #00A3A3; }
+#filetable { padding:5px; width:100%; border-collapse: collapse;} #filetable thead { border: 1px solid #444; }
#filetable td { text-align:left; } #filetable tbody { border: 1px solid #EEE; }
#filetable td:not(:first-child):last-child { text-align: right; } #filetable td:not(:first-child):not(:last-child) { text-align: center; }
-#filetable th { background-color: #00A3A3; color: #FFF; padding: 5px; text-align:left; text-align: center; font-weight: normal; font-size:0.9em;}
-#filetable tr:nth-child(2n) { background-color: #EBEBEB;} #filetable tbody tr.selected { border: 1px dashed #777 !important; background-color: #FFE4C4; }
+#filetable th { background-color: #444; color: #FFF; padding: 5px; text-align:left; text-align: center; font-weight: bold; font-size:1.0em; text-transform:uppercase;}
+/*#filetable tr:nth-child(2n) { background-color: rgba(0, 0, 0, 0.01);} */
+#filetable tr:nth-child(odd) { background-color: rgba(0, 0, 0, 0.02); }
+#filetable tr:nth-child(even) { background-color: rgba(0, 0, 0, 0.05); }
+#filetable tr:first-child { background-color: rgba(0, 0, 0, 0.00); }
+#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:90px; } .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; } .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; }
@@ -38,8 +45,9 @@ min-width:200px; right:0; top:0; } #options ul li:before { content: '\2192\00A0'
#waitqueue>div{padding:5px 10px 5px 5px;}#waitqueue>div>div{width:120px;height:14px;display:inline-block;vertical-align:bottom;} #waitqueue.left { left:5px !important; right:auto; }
#multiseloptions { border:1px solid #000; box-shadow:#333 3px 3px 10px; position:fixed; top:25%; left:60%; background:#FFF; padding:0; z-index:1; overflow:hidden; }
#multiseloptions p { margin:0; padding:2px; background-color:#DDD; } #multiseloptions ul { margin:0;padding:2px 2px 2px 10px;list-style:none; }
-#mdPicPreview{position:absolute;border:1px solid #ccc;background:#333;padding:5px;display:none;color:#fff;max-width:30em;}
+#mdPicPreview{position:absolute;border:1px solid #ccc;background:#FFF;padding:5px;display:none;color:#fff;max-width:30em;}
#mdPicPreview img { max-width:100%;}
+#currentDir { border: 0px; font-weight: bold; position: relative; top: -1px; }
#loading { position:fixed; top:calc(50% - 49px); left:calc(50% - 45px); border-radius:5px; border:1px solid #EEE; padding:12px 15px; background:#FFF; }
#savequestion { position: absolute; top:40%; left:50%; margin-left:-125px;margin-top:-55px; background-color:#FFF; border: 1px solid #CCC; z-index:10; padding:20px; text-align: center; }