mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-07-31 18:30:20 +02:00
Files Manager Improvements - Updates #94
This commit is contained in:
@@ -69,9 +69,9 @@ class FilesmanagerAdmin extends Backend
|
||||
|
||||
File::delete($files_path.Request::get('delete_file'));
|
||||
if (!is_file($files_path.Request::get('delete_file'))) {
|
||||
Notification::set('success', __('File was deleted', 'system'));
|
||||
Notification::set('success', __('File was deleted', 'filesmanager'));
|
||||
} else {
|
||||
Notification::set('error', __('File was not deleted', 'system'));
|
||||
Notification::set('error', __('File was not deleted', 'filesmanager'));
|
||||
}
|
||||
Request::redirect($site_url.'/admin/index.php?id=filesmanager&path='.$path);
|
||||
|
||||
@@ -87,9 +87,9 @@ class FilesmanagerAdmin extends Backend
|
||||
Dir::delete($files_path.Request::get('delete_dir'));
|
||||
|
||||
if (!is_dir($files_path.Request::get('delete_dir'))) {
|
||||
Notification::set('success', __('Directory was deleted', 'system'));
|
||||
Notification::set('success', __('Directory was deleted', 'filesmanager'));
|
||||
} else {
|
||||
Notification::set('error', __('Directory was not deleted', 'system'));
|
||||
Notification::set('error', __('Directory was not deleted', 'filesmanager'));
|
||||
}
|
||||
|
||||
Request::redirect($site_url.'/admin/index.php?id=filesmanager&path='.$path);
|
||||
@@ -110,7 +110,7 @@ class FilesmanagerAdmin extends Backend
|
||||
$rename_to = Request::post('rename_to');
|
||||
|
||||
if (empty($rename_to)) {
|
||||
Notification::set('error', __('Can not be empty', 'system'));
|
||||
Notification::set('error', __('Can not be empty', 'filesmanager'));
|
||||
Request::redirect($site_url.'/admin/index.php?id=filesmanager&path='.$path);
|
||||
}
|
||||
|
||||
@@ -118,21 +118,21 @@ class FilesmanagerAdmin extends Backend
|
||||
$rename_to = $files_path . Security::safeName($rename_to).$ext;
|
||||
|
||||
if (is_dir($rename_to)) {
|
||||
Notification::set('error', __('Directory exists', 'system'));
|
||||
Notification::set('error', __('Directory exists', 'filesmanager'));
|
||||
Request::redirect($site_url.'/admin/index.php?id=filesmanager&path='.$path);
|
||||
}
|
||||
|
||||
if (is_file($rename_to)) {
|
||||
Notification::set('error', __('File exists', 'system'));
|
||||
Notification::set('error', __('File exists', 'filesmanager'));
|
||||
Request::redirect($site_url.'/admin/index.php?id=filesmanager&path='.$path);
|
||||
}
|
||||
|
||||
$success = rename($files_path.$rename_from, $rename_to);
|
||||
|
||||
if ($success) {
|
||||
Notification::set('success', __('Renamed successfully', 'system'));
|
||||
Notification::set('success', __('Renamed successfully', 'filesmanager'));
|
||||
} else {
|
||||
Notification::set('error', __('Failure', 'system'));
|
||||
Notification::set('error', __('Failure', 'filesmanager'));
|
||||
}
|
||||
Request::redirect($site_url.'/admin/index.php?id=filesmanager&path='.$path);
|
||||
|
||||
@@ -151,7 +151,7 @@ class FilesmanagerAdmin extends Backend
|
||||
$filepath = $files_path.Security::safeName(basename($_FILES['file']['name'], File::ext($_FILES['file']['name'])), '-', true).'.'.File::ext($_FILES['file']['name']);
|
||||
$uploaded = move_uploaded_file($_FILES['file']['tmp_name'], $filepath);
|
||||
if ($uploaded !== false && is_file($filepath)) {
|
||||
Notification::set('success', __('File was uploaded', 'system'));
|
||||
Notification::set('success', __('File was uploaded', 'filesmanager'));
|
||||
} else {
|
||||
$error = 'File was not uploaded';
|
||||
}
|
||||
@@ -163,7 +163,7 @@ class FilesmanagerAdmin extends Backend
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
Notification::set('error', __($error, 'system'));
|
||||
Notification::set('error', __($error, 'filesmanager'));
|
||||
}
|
||||
|
||||
if (Request::post('dragndrop')) {
|
||||
@@ -195,9 +195,9 @@ class FilesmanagerAdmin extends Backend
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
Alert::error(__('Directory was not created', 'system'));
|
||||
Alert::error(__('Directory was not created', 'filesmanager'));
|
||||
} else {
|
||||
Alert::success(__('Directory was created', 'system'));
|
||||
Alert::success(__('Directory was created', 'filesmanager'));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -240,7 +240,7 @@ class FilesmanagerAdmin extends Backend
|
||||
->assign('fileuploader', array(
|
||||
'uploadUrl' => $site_url.'/admin/index.php?id=filesmanager&path='.$path,
|
||||
'csrf' => Security::token(),
|
||||
'errorMsg' => __('Upload server error', 'system')
|
||||
'errorMsg' => __('Upload server error', 'filesmanager')
|
||||
))->display();
|
||||
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="pull-right">
|
||||
<button class="btn btn-primary" data-toggle="modal" data-target="#createNewDirectory">
|
||||
Create New Directory
|
||||
<?php echo __('Create New Directory', 'filesmanager'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,10 +92,10 @@
|
||||
<button class="btn btn-primary js-rename-dir" data-dirname="<?php echo $dir; ?>" data-path="<?php echo $path; ?>">
|
||||
<?php echo __('Rename', 'filesmanager'); ?>
|
||||
</button>
|
||||
<?php echo Html::anchor(__('Delete', 'filesmanager'),
|
||||
'index.php?id=filesmanager&delete_dir='.$dir.'&path='.$path.'&token='.Security::token(),
|
||||
array('class' => 'btn btn-danger', 'onclick' => "return confirmDelete('".__('Delete directory: :dir', 'filesmanager', array(':dir' => $dir))."')"));
|
||||
?>
|
||||
<?php echo Html::anchor(__('Delete', 'filesmanager'),
|
||||
'index.php?id=filesmanager&delete_dir='.$dir.'&path='.$path.'&token='.Security::token(),
|
||||
array('class' => 'btn btn-danger', 'onclick' => "return confirmDelete('".__('Delete directory: :dir', 'filesmanager', array(':dir' => $dir))."')"));
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -137,18 +137,18 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h4 class="modal-title" id="myModalLabel">Create New Directory</h4>
|
||||
<h4 class="modal-title" id="myModalLabel"><?php echo __('Create New Directory', 'filesmanager'); ?></h4>
|
||||
</div>
|
||||
<form role="form" method="POST">
|
||||
<?php echo Form::hidden('csrf', Security::token()); ?>
|
||||
<div class="modal-body">
|
||||
<label for="directoryName">Directory Name</label>
|
||||
<label for="directoryName"><?php echo __('Directory Name', 'filesmanager'); ?></label>
|
||||
<input type="hidden" name="path" value="<?php echo $path; ?>" />
|
||||
<input type="text" class="form-control" id="directoryName" name="directory_name" />
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Create</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Cancel', 'filesmanager'); ?></button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo __('Create', 'filesmanager'); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -160,12 +160,11 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h4 class="modal-title">Rename</h4>
|
||||
<h4 class="modal-title"><?php echo __('Rename', 'filesmanager'); ?></h4>
|
||||
</div>
|
||||
<form role="form" method="POST">
|
||||
<?php echo Form::hidden('csrf', Security::token()); ?>
|
||||
<div class="modal-body">
|
||||
|
||||
<label for="renameTo">
|
||||
<span id="dirRenameType"><?php echo __('Directory:', 'filesmanager'); ?></span>
|
||||
<span id="fileRenameType"><?php echo __('File:', 'filesmanager'); ?></span>
|
||||
@@ -175,12 +174,11 @@
|
||||
<input type="hidden" name="rename_type" value="" />
|
||||
<input type="hidden" name="rename_from" value="" />
|
||||
<input type="text" class="form-control" id="renameTo" name="rename_to" />
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo __('Rename', 'filesmanager'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Cancel', 'filesmanager'); ?></button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo __('Rename', 'filesmanager'); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user