mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-10 01:56:30 +02:00
Fix error messages
Signed-off-by: Marco Dickert <marco@misterunknown.de>
This commit is contained in:
@@ -102,10 +102,10 @@ function IFM(params) {
|
||||
*/
|
||||
this.rebuildFileTable = function( data ) {
|
||||
if( data.status == "ERROR" ) {
|
||||
this.showMessage( data.message, "e" );
|
||||
self.showMessage( data.message, "e" );
|
||||
return;
|
||||
} else if ( ! Array.isArray( data ) ) {
|
||||
this.showMessage( self.i18n.invalid_data, "e" );
|
||||
self.showMessage( self.i18n.invalid_data, "e" );
|
||||
return;
|
||||
}
|
||||
data.forEach( function( item ) {
|
||||
@@ -2037,15 +2037,12 @@ function IFM(params) {
|
||||
// handle window.onbeforeunload
|
||||
window.onbeforeunload = self.onbeforeunloadHandler;
|
||||
|
||||
/*
|
||||
// load initial file table
|
||||
if( window.location.hash ) {
|
||||
self.changeDirectory( decodeURIComponent( window.location.hash.substring( 1 ) ) );
|
||||
} else {
|
||||
this.refreshFileTable();
|
||||
}
|
||||
*/
|
||||
console.log("Finished initialisation without file table");
|
||||
};
|
||||
|
||||
this.init = function(id) {
|
||||
|
@@ -340,7 +340,7 @@ f00bar;
|
||||
usort($dirs, [$this, "sortByName"]);
|
||||
usort($files, [$this, "sortByName"]);
|
||||
|
||||
return ["data" => array_merge($dirs, $files)];
|
||||
return array_merge($dirs, $files);
|
||||
}
|
||||
|
||||
private function getItemInformation($name) {
|
||||
@@ -533,11 +533,11 @@ f00bar;
|
||||
if (empty($err)) {
|
||||
return [
|
||||
"status" => "OK",
|
||||
"message" => ($d['action'] == "copy" ? $this->l('copy_success') : $this->l['move_success'] ),
|
||||
"message" => ($d['action'] == "copy" ? $this->l('copy_success') : $this->l('move_success')),
|
||||
"errflag" => "1"
|
||||
];
|
||||
} else {
|
||||
$errmsg = ($d['action'] == "copy" ? $this->l('copy_error') : $this->l['move_error'] ) . "<ul>";
|
||||
$errmsg = ($d['action'] == "copy" ? $this->l('copy_error') : $this->l('move_error')) . "<ul>";
|
||||
foreach ($err as $item)
|
||||
$errmsg .= "<li>".$item."</li>";
|
||||
$errmsg .= "</ul>";
|
||||
@@ -553,7 +553,7 @@ f00bar;
|
||||
if ($d['dirname'] == "" || !$this->isFilenameValid($d['dirname']))
|
||||
throw new IFMException($this->l('invalid_dir'));
|
||||
|
||||
if (@mkdir($dn))
|
||||
if (@mkdir($d['dirname']))
|
||||
return ["status" => "OK", "message" => $this->l('folder_create_success')];
|
||||
else
|
||||
throw new IFMException($this->l('folder_create_error').". ".error_get_last()['message']);
|
||||
|
Reference in New Issue
Block a user