Merge pull request #111 from alecos71/patch-12

Added Memory Used
This commit is contained in:
Prasath Mani 2018-12-25 20:15:37 +05:30 committed by GitHub
commit acf1958350
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,7 +102,14 @@ if ($report_errors == true) {
@ini_set('display_errors', 0);
}
//Set Cookie
// Show Memory Used
function fm_memory($size) {
$unit = array('Byte', 'KB', 'MB', 'GB', 'TB', 'PB');
return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $unit[$i];
}
$memory = fm_memory(memory_get_usage(true));
// Set Cookie
setcookie('fm_cache', true, 2147483647, "/");
// if fm included
@ -1701,6 +1708,7 @@ $all_files_size = 0;
<a href="javascript:document.getElementById('a-tar').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-file-archive-o"></i> <?php echo lng('Tar') ?> </a></li>
<li class="list-inline-item"><input type="submit" class="hidden" name="copy" id="a-copy" value="Copy">
<a href="javascript:document.getElementById('a-copy').click();" class="btn btn-small btn-outline-primary btn-2"><i class="fa fa-files-o"></i> <?php echo lng('Copy') ?> </a></li>
<li class="list-inline-item"><?php echo lng('MemoryUsed'); echo $memory; ?></li>
</ul>
</div>
<div class="col-3 d-none d-sm-block"><a href="https://tinyfilemanager.github.io" target="_blank" class="float-right text-muted">Tiny File Manager v2.2</a></div>
@ -3375,6 +3383,8 @@ function lng($txt) {
$tr['en']['SourceFolder'] = 'Source Folder'; $tr['en']['Files'] = 'Files';
$tr['en']['Move'] = 'Move'; $tr['en']['Change'] = 'Change';
$tr['en']['Settings'] = 'Settings'; $tr['en']['Language'] = 'Language';
$tr['en']['MemoryUsed'] = 'Memory used: ';
// French Language
$tr['fr']['AppName'] = 'Tiny File Manager'; $tr['fr']['AppTitle'] = 'File Manager';
@ -3403,6 +3413,7 @@ function lng($txt) {
$tr['fr']['SourceFolder'] = 'Dossier Source'; $tr['fr']['Files'] = 'Fichiers';
$tr['fr']['Move'] = 'Déplacer'; $tr['fr']['Change'] = 'Modifier';
$tr['fr']['Settings'] = 'Réglages'; $tr['fr']['Language'] = 'Langue';
$tr['fr']['MemoryUsed'] = 'Mémoire utilisée: ';
// Italian Language
$tr['it']['AppName'] = 'Tiny File Manager'; $tr['it']['AppTitle'] = 'File Manager';
@ -3431,6 +3442,7 @@ function lng($txt) {
$tr['it']['SourceFolder'] = 'Cartella di Origine'; $tr['it']['Files'] = 'File';
$tr['it']['Move'] = 'Sposta'; $tr['it']['Change'] = 'Cambia';
$tr['it']['Settings'] = 'Impostazioni'; $tr['it']['Language'] = 'Lingua';
$tr['it']['MemoryUsed'] = 'Memoria utilizzata: ';
// Russian Language
$tr['ru']['AppName'] = 'Файловый менеджер'; $tr['ru']['AppTitle'] = 'Файловый менеджер';
@ -3459,6 +3471,7 @@ function lng($txt) {
$tr['ru']['SourceFolder'] = 'Путь папки'; $tr['ru']['Files'] = 'Файлы';
$tr['ru']['Move'] = 'Переместить'; $tr['ru']['Change'] = 'Изменения';
$tr['ru']['Settings'] = 'Свойства'; $tr['ru']['Language'] = 'Язык';
$tr['ru']['MemoryUsed'] = 'Используемая память: ';
if (!strlen($lang)) $lang = 'en';
if (isset($tr[$lang][$txt])) return fm_enc($tr[$lang][$txt]);