Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e3877270b | ||
|
|
0319b7b102 | ||
|
|
4905e5c61c | ||
|
|
8b21009a47 | ||
|
|
b8b859a1fd | ||
|
|
339c26168c |
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
patreon: ccpprogrammers
|
patreon: ccpprogrammers
|
||||||
open_collective: # Replace with a single Open Collective username
|
open_collective: tinyfilemanager
|
||||||
ko_fi: tinyfilemanager
|
ko_fi: tinyfilemanager
|
||||||
custom: ['https://paypal.me/prasathmani']
|
custom: ['https://paypal.me/prasathmani']
|
||||||
|
|||||||
38
README.md
38
README.md
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
|
|
||||||
[](https://tinyfilemanager.github.io/demo/)
|
[](https://tinyfilemanager.github.io/demo/)
|
||||||
[](https://tinyfilemanager.github.io/)
|
[](https://github.com/prasathmani/tinyfilemanager/wiki)
|
||||||
[](https://github.com/prasathmani/tinyfilemanager/releases)
|
[](https://github.com/prasathmani/tinyfilemanager/releases)
|
||||||
[](https://github.com/prasathmani/tinyfilemanager/blob/master/LICENSE)
|
[](https://github.com/prasathmani/tinyfilemanager/blob/master/LICENSE)
|
||||||
[](https://www.paypal.me/prasathmani)
|
[](https://www.paypal.me/prasathmani)
|
||||||
> It is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes. .
|
> TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
[Demo](https://tinyfilemanager.github.io/demo/)
|
[Demo](https://tinyfilemanager.github.io/demo/)
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
Login Details : admin/admin@123 | user/12345
|
Login Details : admin/admin@123 | user/12345
|
||||||
|
|
||||||
|
|
||||||
## Documents
|
## Documentation
|
||||||
[TinyFileManager.github.io](https://tinyfilemanager.github.io/) | [Password Generater](https://tinyfilemanager.github.io/docs/pwd.html)
|
Tinyfilemanager is highly documented on the [wiki pages](https://github.com/prasathmani/tinyfilemanager/wiki).
|
||||||
<hr>
|
|
||||||
|
|
||||||
[](screenshot.gif)
|
[](screenshot.gif)
|
||||||
|
|
||||||
@@ -34,38 +34,27 @@ You can also change the file name from "tinyfilemanager.php" to something else,
|
|||||||
|
|
||||||
Default username/password: **admin/admin@123** and **user/12345**.
|
Default username/password: **admin/admin@123** and **user/12345**.
|
||||||
|
|
||||||
Warning: Please set your own username and password in `$auth_users` before use. password is encrypted with <code>password_hash()</code>. to generate new password hash [here](https://tinyfilemanager.github.io/docs/pwd.html)
|
:warning: Warning: Please set your own username and password in `$auth_users` before use. password is encrypted with <code>password_hash()</code>. to generate new password hash [here](https://tinyfilemanager.github.io/docs/pwd.html)
|
||||||
|
|
||||||
To enable/disable authentication set `$use_auth` to true or false.
|
To enable/disable authentication set `$use_auth` to true or false.
|
||||||
|
|
||||||
### Supported constants:
|
|
||||||
|
|
||||||
- `FM_ROOT_PATH` - default is `$_SERVER['DOCUMENT_ROOT']`
|
|
||||||
- `FM_ROOT_URL` - default is `'http(s)://site.domain/'`
|
|
||||||
- `FM_SELF_URL` - default is `'http(s)://site.domain/' . $_SERVER['PHP_SELF']`
|
|
||||||
- `FM_ICONV_INPUT_ENC` - default is `'CP1251'`
|
|
||||||
- `FM_USE_HIGHLIGHTJS` - default is `true`
|
|
||||||
- `FM_HIGHLIGHTJS_STYLE` - default is `'vs'`
|
|
||||||
- `FM_DATETIME_FORMAT` - default is `'d.m.y H:i'`
|
|
||||||
- `FM_EXTENSION` - default is `""` //upload files extensions
|
|
||||||
|
|
||||||
|
|
||||||
### :loudspeaker: Features
|
### :loudspeaker: Features
|
||||||
|
|
||||||
- :cd: Open Source, light and extremely simple
|
- :cd: Open Source, light and extremely simple
|
||||||
- :iphone: Mobile friendly view for touch devices
|
- :iphone: Mobile friendly view for touch devices
|
||||||
- :information_source: Basic features likes Create, Delete, Modify, View, Quick View, Download, Copy and Move files
|
- :information_source: Basic features likes Create, Delete, Modify, View, Quick Preview, Download, Copy and Move files
|
||||||
- :arrow_double_up: Ajax Upload, Ability to drag & drop, upload from URL, multiple files upload and file extensions filter
|
- :arrow_double_up: Ajax Upload, Ability to drag & drop, upload from URL, multiple files upload with file extensions filter
|
||||||
- :file_folder: Ability to create folders and files
|
- :file_folder: Ability to create folders and files
|
||||||
- :gift: Ability to compress, extract files (`zip`, `tar`)
|
- :gift: Ability to compress, extract files (`zip`, `tar`)
|
||||||
- :sunglasses: Support user permissions - based on session and each user root folder mapping
|
- :sunglasses: Support user permissions - based on session and each user root folder mapping
|
||||||
- :floppy_disk: Copy direct file URL
|
- :floppy_disk: Copy direct file URL
|
||||||
- :pencil2: Cloud9 IDE - Syntax highlighting for over `150+` languages, Over `35+` themes with your favorite programming style
|
- :pencil2: Cloud9 IDE - Syntax highlighting for over `150+` languages, Over `35+` themes with your favorite programming style
|
||||||
- :page_facing_up: Google/Microsoft doc viewer helps you preview `PDF/DOC/XLS/PPT/etc`. 25 MB can be previewed with the Google Drive viewer
|
- :page_facing_up: Google/Microsoft doc viewer helps you preview `PDF/DOC/XLS/PPT/etc`. 25 MB can be previewed with the Google Drive viewer
|
||||||
- :zap: Backup files and IP white and blacklisting
|
- :zap: Backup files and IP blacklist and whitelist
|
||||||
- :mag_right: Search - Search and Sorting using `datatable js`
|
- :mag_right: Search - Search and filter files using `datatable js`
|
||||||
- :file_folder: Exclude folders from listing
|
- :file_folder: Exclude folders and files from listing
|
||||||
- :globe_with_meridians: Multi-language support (English, Spanish, French, Italian, German, Russian, Thailand, Chinese and more..) for translations `translation.json` is file required
|
- :globe_with_meridians: Multi-language(20+) support and for translations `translation.json` is file required
|
||||||
- :bangbang: lots more...
|
- :bangbang: lots more...
|
||||||
|
|
||||||
|
|
||||||
@@ -75,5 +64,4 @@ To enable/disable authentication set `$use_auth` to true or false.
|
|||||||
- Original concept and development by github.com/alexantr/filemanager
|
- Original concept and development by github.com/alexantr/filemanager
|
||||||
- CDN Used - _jQuery, Bootstrap, Font Awesome, Highlight js, ace js, DropZone js, ekko-lightbox js, and DataTable js_
|
- CDN Used - _jQuery, Bootstrap, Font Awesome, Highlight js, ace js, DropZone js, ekko-lightbox js, and DataTable js_
|
||||||
- To report a bug or request a feature, please file an [issue](https://github.com/prasathmani/tinyfilemanager/issues)
|
- To report a bug or request a feature, please file an [issue](https://github.com/prasathmani/tinyfilemanager/issues)
|
||||||
|
- [Contributors](https://github.com/prasathmani/tinyfilemanager/wiki/Authors-and-Contributors)
|
||||||
|
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":false,"calc_folder":false}';
|
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":false,"calc_folder":false}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H3K | Tiny File Manager V2.4.0
|
* H3K | Tiny File Manager V2.4.1
|
||||||
* CCP Programmers | ccpprogrammers@gmail.com
|
* CCP Programmers | ccpprogrammers@gmail.com
|
||||||
* https://tinyfilemanager.github.io
|
* https://tinyfilemanager.github.io
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//TFM version
|
//TFM version
|
||||||
define('VERSION', '2.4.0');
|
define('VERSION', '2.4.1');
|
||||||
|
|
||||||
//Application Title
|
//Application Title
|
||||||
define('APP_TITLE', 'Tiny File Manager');
|
define('APP_TITLE', 'Tiny File Manager');
|
||||||
@@ -92,7 +92,7 @@ $exclude_items = array();
|
|||||||
// Availabe rules are 'google', 'microsoft' or false
|
// Availabe rules are 'google', 'microsoft' or false
|
||||||
// google => View documents using Google Docs Viewer
|
// google => View documents using Google Docs Viewer
|
||||||
// microsoft => View documents using Microsoft Web Apps Viewer
|
// microsoft => View documents using Microsoft Web Apps Viewer
|
||||||
// false => disable online dov viewer
|
// false => disable online doc viewer
|
||||||
$online_viewer = 'google';
|
$online_viewer = 'google';
|
||||||
|
|
||||||
// Sticky Nav bar
|
// Sticky Nav bar
|
||||||
@@ -414,6 +414,14 @@ if (isset($_POST['ajax']) && !FM_READONLY) {
|
|||||||
die(true);
|
die(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//search : get list of files from the current folder
|
||||||
|
if(isset($_POST['type']) && $_POST['type']=="search") {
|
||||||
|
$dir = FM_ROOT_PATH;
|
||||||
|
$response = scan($_POST['path'], $_POST['content']);
|
||||||
|
echo json_encode($response);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
// backup files
|
// backup files
|
||||||
if (isset($_POST['type']) && $_POST['type'] == "backup") {
|
if (isset($_POST['type']) && $_POST['type'] == "backup") {
|
||||||
$file = $_POST['file'];
|
$file = $_POST['file'];
|
||||||
@@ -789,27 +797,50 @@ if (!empty($_FILES) && !FM_READONLY) {
|
|||||||
$isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;
|
$isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;
|
||||||
|
|
||||||
$targetPath = $path . $ds;
|
$targetPath = $path . $ds;
|
||||||
$fullPath = $path . '/' . $_REQUEST['fullpath'];
|
if ( is_writable($targetPath) ) {
|
||||||
$folder = substr($fullPath, 0, strrpos($fullPath, "/"));
|
$fullPath = $path . '/' . $_REQUEST['fullpath'];
|
||||||
|
$folder = substr($fullPath, 0, strrpos($fullPath, "/"));
|
||||||
|
|
||||||
if(file_exists ($fullPath) && !$override_file_name) {
|
if(file_exists ($fullPath) && !$override_file_name) {
|
||||||
$ext_1 = $ext ? '.'.$ext : '';
|
$ext_1 = $ext ? '.'.$ext : '';
|
||||||
$fullPath = str_replace($ext_1, '', $fullPath) .'_'. date('ymdHis'). $ext_1;
|
$fullPath = str_replace($ext_1, '', $fullPath) .'_'. date('ymdHis'). $ext_1;
|
||||||
}
|
|
||||||
|
|
||||||
if (!is_dir($folder)) {
|
|
||||||
$old = umask(0);
|
|
||||||
mkdir($folder, 0777, true);
|
|
||||||
umask($old);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($f['file']['error']) && !empty($tmp_name) && $tmp_name != 'none' && $isFileAllowed) {
|
|
||||||
if (move_uploaded_file($tmp_name, $fullPath)) {
|
|
||||||
die('Successfully uploaded');
|
|
||||||
} else {
|
|
||||||
die(sprintf('Error while uploading files. Uploaded files: %s', $uploads));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!is_dir($folder)) {
|
||||||
|
$old = umask(0);
|
||||||
|
mkdir($folder, 0777, true);
|
||||||
|
umask($old);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($f['file']['error']) && !empty($tmp_name) && $tmp_name != 'none' && $isFileAllowed) {
|
||||||
|
if (move_uploaded_file($tmp_name, $fullPath)) {
|
||||||
|
// Be sure that the file has been uploaded
|
||||||
|
if ( file_exists($fullPath) ) {
|
||||||
|
$response = array (
|
||||||
|
'status' => 'success',
|
||||||
|
'info' => "file upload successful"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$response = array (
|
||||||
|
'status' => 'error',
|
||||||
|
'info' => 'Couldn\'t upload the requested file.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$response = array (
|
||||||
|
'status' => 'error',
|
||||||
|
'info' => "Error while uploading files. Uploaded files $uploads",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$response = array (
|
||||||
|
'status' => 'error',
|
||||||
|
'info' => 'The specified folder for upload isn\'t writeable.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
// Return the response
|
||||||
|
echo json_encode($response);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1114,7 +1145,10 @@ if (isset($_GET['upload']) && !FM_READONLY) {
|
|||||||
toast('Error: Server Timeout');
|
toast('Error: Server Timeout');
|
||||||
});
|
});
|
||||||
}).on("success", function (res) {
|
}).on("success", function (res) {
|
||||||
console.log('Upload Status >> ', res.status);
|
let _response = JSON.parse(res.xhr.response);
|
||||||
|
if(_response.status == "error") {
|
||||||
|
toast(_response.info);
|
||||||
|
}
|
||||||
}).on("error", function(file, response) {
|
}).on("error", function(file, response) {
|
||||||
toast(response);
|
toast(response);
|
||||||
});
|
});
|
||||||
@@ -1351,7 +1385,7 @@ if (isset($_GET['help'])) {
|
|||||||
<div class="col-xs-12 col-sm-6">
|
<div class="col-xs-12 col-sm-6">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
<li class="list-group-item"><a href="https://tinyfilemanager.github.io/docs/" target="_blank"><i class="fa fa-question-circle"></i> <?php echo lng('Help Documents') ?> </a> </li>
|
<li class="list-group-item"><a href="https://github.com/prasathmani/tinyfilemanager/wiki" target="_blank"><i class="fa fa-question-circle"></i> <?php echo lng('Help Documents') ?> </a> </li>
|
||||||
<li class="list-group-item"><a href="https://github.com/prasathmani/tinyfilemanager/issues" target="_blank"><i class="fa fa-bug"></i> <?php echo lng('Report Issue') ?></a></li>
|
<li class="list-group-item"><a href="https://github.com/prasathmani/tinyfilemanager/issues" target="_blank"><i class="fa fa-bug"></i> <?php echo lng('Report Issue') ?></a></li>
|
||||||
<li class="list-group-item"><a href="javascript:latest_release_info('<?php echo VERSION; ?>');"><i class="fa fa-link"> </i> <?php echo lng('Check Latest Version') ?></a></li>
|
<li class="list-group-item"><a href="javascript:latest_release_info('<?php echo VERSION; ?>');"><i class="fa fa-link"> </i> <?php echo lng('Check Latest Version') ?></a></li>
|
||||||
<?php if(!FM_READONLY) { ?>
|
<?php if(!FM_READONLY) { ?>
|
||||||
@@ -1871,8 +1905,18 @@ $all_files_size = 0;
|
|||||||
</div>
|
</div>
|
||||||
</td><?php endif; ?>
|
</td><?php endif; ?>
|
||||||
<td>
|
<td>
|
||||||
<div class="filename"><a href="<?php echo $filelink ?>" title="File info"><i class="<?php echo $img ?>"></i> <?php echo fm_convert_win($f) ?>
|
<div class="filename">
|
||||||
</a><?php echo($is_link ? ' → <i>' . readlink($path . '/' . $f) . '</i>' : '') ?></div>
|
<?php
|
||||||
|
if (in_array(strtolower(pathinfo($f, PATHINFO_EXTENSION)), array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg'))): ?>
|
||||||
|
<?php $imagePreview = fm_enc(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f); ?>
|
||||||
|
<a href="<?php echo $filelink ?>" data-preview-image="<?php echo $imagePreview ?>" title="<?php echo $f ?>">
|
||||||
|
<?php else: ?>
|
||||||
|
<a href="<?php echo $filelink ?>" title="<?php echo $f ?>">
|
||||||
|
<?php endif; ?>
|
||||||
|
<i class="<?php echo $img ?>"></i> <?php echo fm_convert_win($f) ?>
|
||||||
|
</a>
|
||||||
|
<?php echo($is_link ? ' → <i>' . readlink($path . '/' . $f) . '</i>' : '') ?>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td><span title="<?php printf('%s bytes', $filesize_raw) ?>">
|
<td><span title="<?php printf('%s bytes', $filesize_raw) ?>">
|
||||||
<?php echo $filesize; ?>
|
<?php echo $filesize; ?>
|
||||||
@@ -2674,7 +2718,7 @@ function fm_get_image_exts()
|
|||||||
*/
|
*/
|
||||||
function fm_get_video_exts()
|
function fm_get_video_exts()
|
||||||
{
|
{
|
||||||
return array('webm', 'mp4', 'm4v', 'ogm', 'ogv', 'mov', 'mkv');
|
return array('avi', 'webm', 'wmv', 'mp4', 'm4v', 'ogm', 'ogv', 'mov', 'mkv');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2739,6 +2783,31 @@ function fm_get_onlineViewer_exts()
|
|||||||
return array('doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'ai', 'psd', 'dxf', 'xps', 'rar', 'odt', 'ods');
|
return array('doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'ai', 'psd', 'dxf', 'xps', 'rar', 'odt', 'ods');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function scans the files and folder recursively, and return matching files
|
||||||
|
* @param string $dir
|
||||||
|
* @return json
|
||||||
|
*/
|
||||||
|
function scan($dir, $filter = '') {
|
||||||
|
$path = FM_ROOT_PATH.'/'.$dir;
|
||||||
|
$ite = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
|
||||||
|
$rii = new RegexIterator($ite, "/(".$filter.")/i");
|
||||||
|
|
||||||
|
$files = array();
|
||||||
|
foreach ($rii as $file) {
|
||||||
|
if (!$file->isDir()) {
|
||||||
|
$fileName = $file->getFilename();
|
||||||
|
$location = str_replace(FM_ROOT_PATH, '', $file->getPath());
|
||||||
|
$files[] = array(
|
||||||
|
"name" => $fileName,
|
||||||
|
"type" => "file",
|
||||||
|
"path" => $location,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to work with zip files (using ZipArchive)
|
* Class to work with zip files (using ZipArchive)
|
||||||
*/
|
*/
|
||||||
@@ -3044,8 +3113,11 @@ function fm_show_nav_path($path)
|
|||||||
<li class="nav-item mr-2">
|
<li class="nav-item mr-2">
|
||||||
<div class="input-group input-group-sm mr-1" style="margin-top:4px;">
|
<div class="input-group input-group-sm mr-1" style="margin-top:4px;">
|
||||||
<input type="text" class="form-control" placeholder="<?php echo lng('Search') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon2" id="search-addon">
|
<input type="text" class="form-control" placeholder="<?php echo lng('Search') ?>" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon2" id="search-addon">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append btn-group">
|
||||||
<span class="input-group-text" id="search-addon2"><i class="fa fa-search"></i></span>
|
<span class="input-group-text dropdown-toggle" id="search-addon2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
|
||||||
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
|
<a class="dropdown-item" href="<?php echo $path2 = $path ? $path : '.'; ?>" id="js-search-modal" data-toggle="modal" data-target="#searchModal">Advanced Search</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@@ -3306,6 +3378,11 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
|
|||||||
@keyframes lds-facebook { 0% { top:6px;height:51px }
|
@keyframes lds-facebook { 0% { top:6px;height:51px }
|
||||||
100%,50% { top:19px;height:26px }
|
100%,50% { top:19px;height:26px }
|
||||||
}
|
}
|
||||||
|
ul#search-wrapper { padding-left: 0;border: 1px solid #ecececcc; } ul#search-wrapper li { list-style: none; padding: 5px;border-bottom: 1px solid #ecececcc; }
|
||||||
|
ul#search-wrapper li:nth-child(odd){ background: #f9f9f9cc;}
|
||||||
|
.c-preview-img {
|
||||||
|
max-width: 300px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body class="<?php echo $isStickyNavBar; ?>">
|
<body class="<?php echo $isStickyNavBar; ?>">
|
||||||
@@ -3346,6 +3423,33 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="searchModal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-lg" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title col-10" id="searchModalLabel">
|
||||||
|
<div class="input-group input-group">
|
||||||
|
<input type="text" class="form-control" placeholder="<?php echo lng('Search') ?> a files" aria-label="<?php echo lng('Search') ?>" aria-describedby="search-addon3" id="advanced-search" autofocus required>
|
||||||
|
<div class="input-group-append">
|
||||||
|
<span class="input-group-text" id="search-addon3"><i class="fa fa-search"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form action="" method="post">
|
||||||
|
<div class="lds-facebook"><div></div><div></div><div></div></div>
|
||||||
|
<ul id="search-wrapper">
|
||||||
|
<p class="m-2">Search file in folder and subfolders...</p>
|
||||||
|
</ul>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<script type="text/html" id="js-tpl-modal">
|
<script type="text/html" id="js-tpl-modal">
|
||||||
<div class="modal fade" id="js-ModalCenter-<%this.id%>" tabindex="-1" role="dialog" aria-labelledby="ModalCenterTitle" aria-hidden="true">
|
<div class="modal fade" id="js-ModalCenter-<%this.id%>" tabindex="-1" role="dialog" aria-labelledby="ModalCenterTitle" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
@@ -3494,6 +3598,45 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
|
|||||||
}
|
}
|
||||||
}); return false;
|
}); return false;
|
||||||
}
|
}
|
||||||
|
//Search template
|
||||||
|
function search_template(data) {
|
||||||
|
var response = "";
|
||||||
|
$.each(data, function (key, val) {
|
||||||
|
response += `<li><a href="?p=${val.path}&view=${val.name}">${val.path}/${val.name}</a></li>`;
|
||||||
|
});
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
//search
|
||||||
|
function fm_search() {
|
||||||
|
var searchTxt = $("input#advanced-search").val(), searchWrapper = $("ul#search-wrapper"), path = $("#js-search-modal").attr("href"), _html = "", $loader = $("div.lds-facebook");
|
||||||
|
if(!!searchTxt && searchTxt.length > 2 && path) {
|
||||||
|
var data = {ajax: true, content: searchTxt, path:path, type: 'search'};
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: window.location,
|
||||||
|
data: data,
|
||||||
|
beforeSend: function() {
|
||||||
|
searchWrapper.html('');
|
||||||
|
$loader.addClass('show-me');
|
||||||
|
},
|
||||||
|
success: function(data){
|
||||||
|
$loader.removeClass('show-me');
|
||||||
|
data = JSON.parse(data);
|
||||||
|
if(data && data.length) {
|
||||||
|
_html = search_template(data);
|
||||||
|
searchWrapper.html(_html);
|
||||||
|
} else { searchWrapper.html('<p class="m-2">No result found!<p>'); }
|
||||||
|
},
|
||||||
|
error: function(xhr) { $loader.removeClass('show-me'); searchWrapper.html('<p class="m-2">ERROR: Try again later!</p>'); },
|
||||||
|
failure: function(mes) { $loader.removeClass('show-me'); searchWrapper.html('<p class="m-2">ERROR: Try again later!</p>');}
|
||||||
|
});
|
||||||
|
} else { searchWrapper.html("OOPS: minimum 3 characters required!"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
//on mouse hover image preview
|
||||||
|
!function(s){s.previewImage=function(e){var o=s(document),t=".previewImage",a=s.extend({xOffset:20,yOffset:-20,fadeIn:"fast",css:{padding:"5px",border:"1px solid #cccccc","background-color":"#fff"},eventSelector:"[data-preview-image]",dataKey:"previewImage",overlayId:"preview-image-plugin-overlay"},e);return o.off(t),o.on("mouseover"+t,a.eventSelector,function(e){s("p#"+a.overlayId).remove();var o=s("<p>").attr("id",a.overlayId).css("position","absolute").css("display","none").append(s('<img class="c-preview-img">').attr("src",s(this).data(a.dataKey)));a.css&&o.css(a.css),s("body").append(o),o.css("top",e.pageY+a.yOffset+"px").css("left",e.pageX+a.xOffset+"px").fadeIn(a.fadeIn)}),o.on("mouseout"+t,a.eventSelector,function(){s("#"+a.overlayId).remove()}),o.on("mousemove"+t,a.eventSelector,function(e){s("#"+a.overlayId).css("top",e.pageY+a.yOffset+"px").css("left",e.pageX+a.xOffset+"px")}),this},s.previewImage()}(jQuery);
|
||||||
|
|
||||||
|
|
||||||
// Dom Ready Event
|
// Dom Ready Event
|
||||||
$(document).ready( function () {
|
$(document).ready( function () {
|
||||||
//load config
|
//load config
|
||||||
@@ -3504,9 +3647,14 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
|
|||||||
_targets = (tableLng && tableLng == 7 ) ? [0, 4,5,6] : tableLng == 5 ? [0,4] : [3],
|
_targets = (tableLng && tableLng == 7 ) ? [0, 4,5,6] : tableLng == 5 ? [0,4] : [3],
|
||||||
mainTable = $('#main-table').DataTable({"paging": false, "info": false, "columnDefs": [{"targets": _targets, "orderable": false}]
|
mainTable = $('#main-table').DataTable({"paging": false, "info": false, "columnDefs": [{"targets": _targets, "orderable": false}]
|
||||||
});
|
});
|
||||||
$('#search-addon').on( 'keyup', function () { //Search using custom input box
|
//search
|
||||||
|
$('#search-addon').on( 'keyup', function () {
|
||||||
mainTable.search( this.value ).draw();
|
mainTable.search( this.value ).draw();
|
||||||
});
|
});
|
||||||
|
$("input#advanced-search").on('keyup', function (e) {
|
||||||
|
if (e.keyCode === 13) { fm_search(); }
|
||||||
|
});
|
||||||
|
$('#search-addon3').on( 'click', function () { fm_search(); });
|
||||||
//upload nav tabs
|
//upload nav tabs
|
||||||
$(".fm-upload-wrapper .card-header-tabs").on("click", 'a', function(e){
|
$(".fm-upload-wrapper .card-header-tabs").on("click", 'a', function(e){
|
||||||
e.preventDefault();let target=$(this).data('target');
|
e.preventDefault();let target=$(this).data('target');
|
||||||
@@ -3654,10 +3802,10 @@ function lng($txt) {
|
|||||||
$tr['en']['Settings'] = 'Settings'; $tr['en']['Language'] = 'Language';
|
$tr['en']['Settings'] = 'Settings'; $tr['en']['Language'] = 'Language';
|
||||||
$tr['en']['MemoryUsed'] = 'Memory used'; $tr['en']['PartitionSize'] = 'Partition size';
|
$tr['en']['MemoryUsed'] = 'Memory used'; $tr['en']['PartitionSize'] = 'Partition size';
|
||||||
$tr['en']['ErrorReporting'] = 'Error Reporting'; $tr['en']['ShowHiddenFiles'] = 'Show Hidden Files';
|
$tr['en']['ErrorReporting'] = 'Error Reporting'; $tr['en']['ShowHiddenFiles'] = 'Show Hidden Files';
|
||||||
$tr['en']['Full size'] = 'Full size'; $tr['en']['Help'] = 'Help';
|
$tr['en']['Full size'] = 'Full size'; $tr['en']['Help'] = 'Help';
|
||||||
$tr['en']['Free of'] = 'Free of'; $tr['en']['Preview'] = 'Preview';
|
$tr['en']['Free of'] = 'Free of'; $tr['en']['Preview'] = 'Preview';
|
||||||
$tr['en']['Help Documents'] = 'Help Documents'; $tr['en']['Report Issue'] = 'Report Issue';
|
$tr['en']['Help Documents'] = 'Help Documents'; $tr['en']['Report Issue'] = 'Report Issue';
|
||||||
$tr['en']['Generate'] = 'Generate'; $tr['en']['FullSize'] = 'Full Size';
|
$tr['en']['Generate'] = 'Generate'; $tr['en']['FullSize'] = 'Full Size';
|
||||||
$tr['en']['FreeOf'] = 'free of'; $tr['en']['CalculateFolderSize']= 'Calculate folder size';
|
$tr['en']['FreeOf'] = 'free of'; $tr['en']['CalculateFolderSize']= 'Calculate folder size';
|
||||||
$tr['en']['ProcessID'] = 'Process ID';
|
$tr['en']['ProcessID'] = 'Process ID';
|
||||||
$tr['en']['HideColumns'] = 'Hide Perms/Owner columns';
|
$tr['en']['HideColumns'] = 'Hide Perms/Owner columns';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"appName": "Tiny File Manager",
|
"appName": "Tiny File Manager",
|
||||||
"version": "2.3.8",
|
"version": "2.4.1",
|
||||||
"language": [
|
"language": [
|
||||||
{
|
{
|
||||||
"name": "فارسی",
|
"name": "فارسی",
|
||||||
@@ -1207,6 +1207,71 @@
|
|||||||
"Generate new password hash": "Parola için Hash Üret",
|
"Generate new password hash": "Parola için Hash Üret",
|
||||||
"Hide Perms/Owner columns": "Yetki / Sahip Sütununu Gizle"
|
"Hide Perms/Owner columns": "Yetki / Sahip Sütununu Gizle"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Slovensky",
|
||||||
|
"code": "sk",
|
||||||
|
"translation": {
|
||||||
|
"AppName": "Tiny File Manager",
|
||||||
|
"AppTitle": "File Manager",
|
||||||
|
"Login": "Prihlásiť sa",
|
||||||
|
"Username": "Prihlasovacie meno",
|
||||||
|
"Password": "Heslo",
|
||||||
|
"Logout": "Odhlásiť",
|
||||||
|
"Move": "Presunúť",
|
||||||
|
"Copy": "Kopírovať",
|
||||||
|
"Save": "Uložiť",
|
||||||
|
"SelectAll": "Vybrať všetko",
|
||||||
|
"UnSelectAll": "Zrušiť výber",
|
||||||
|
"File": "Súbor",
|
||||||
|
"Back": "Späť",
|
||||||
|
"Size": "Veľkosť",
|
||||||
|
"Perms": "Oprávnenia",
|
||||||
|
"Modified": "Zmenené",
|
||||||
|
"Owner": "Vlastník",
|
||||||
|
"Search": "Hľadať",
|
||||||
|
"NewItem": "Nový súbor",
|
||||||
|
"Folder": "Priečinok",
|
||||||
|
"Delete": "Zmazať",
|
||||||
|
"Rename": "Premenovať",
|
||||||
|
"CopyTo": "Kopírovať do",
|
||||||
|
"DirectLink": "Priamy odkaz",
|
||||||
|
"UploadingFiles": "Nahrať súbory",
|
||||||
|
"ChangePermissions": "Zmeniť oprávnenia",
|
||||||
|
"Copying": "Kopírovanie",
|
||||||
|
"CreateNewItem": "Vytvoriť nový súbor",
|
||||||
|
"Name": "Názov",
|
||||||
|
"AdvancedEditor": "Pokročilý editor",
|
||||||
|
"RememberMe": "Zapamätať",
|
||||||
|
"Actions": "Akcie",
|
||||||
|
"Upload": "Nahrať",
|
||||||
|
"Cancel": "Zrušiť",
|
||||||
|
"InvertSelection": "Obrátiť výber",
|
||||||
|
"DestinationFolder": "Cieľový priečinok",
|
||||||
|
"ItemType": "Typ súboru",
|
||||||
|
"ItemName": "Názov súboru",
|
||||||
|
"CreateNow": "Vytvoriť",
|
||||||
|
"Download": "Stiahnúť",
|
||||||
|
"Open": "Otvoriť",
|
||||||
|
"UnZip": "Rozbaliť",
|
||||||
|
"UnZipToFolder": "Rozbaliť do",
|
||||||
|
"Edit": "Upraviť",
|
||||||
|
"NormalEditor": "Editor",
|
||||||
|
"BackUp": "Záloha",
|
||||||
|
"SourceFolder": "Zdrojový priečinok",
|
||||||
|
"Files": "Súbory",
|
||||||
|
"Change": "Zmeniť",
|
||||||
|
"Settings": "Nastavenia",
|
||||||
|
"Language": "Jazyk",
|
||||||
|
"MemoryUsed": "Využitá pamäť",
|
||||||
|
"PartitionSize": "Veľkosť oddielu",
|
||||||
|
"ErrorReporting": "Hlásenie chýb",
|
||||||
|
"ShowHiddenFiles": "Zobraziť skryté súbory",
|
||||||
|
"Preview": "Náhľad",
|
||||||
|
"Help": "Pomoc",
|
||||||
|
"FullSize": "Celková veľkosť",
|
||||||
|
"FreeOf": "voľné z"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user