Files
webgui/plugins/dynamix/Browse.page

61 lines
2.1 KiB
Plaintext

Title="_(Index of)_ $dir"
Tag="navicon"
Markdown="false"
---
<?PHP
/* Copyright 2005-2023, Lime Technology
* Copyright 2012-2023, Bergware International.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
?>
<?
function cap($dir,$p) {
return mb_substr($dir,$p,1)=='/' ? '/' : '';
}
function truepath($dir) {
$dir = preg_replace('://+:','/',htmlspecialchars_decode($dir));
$bits = array_filter(explode('/',$dir),'mb_strlen');
$path = [];
foreach ($bits as $bit) {
if ($bit=='.') continue;
if ($bit=='..') array_pop($path); else $path[] = $bit;
}
return cap($dir,0).implode('/',$path);
}
$dir = htmlspecialchars(str_replace('\\','\\\\',truepath($dir)));
?>
<style>
.loc{text-align:left!important;padding-left:0!important}
.title span.left{text-transform:none}
</style>
<script>
$(function(){
timers.browse = setTimeout(function(){$('div.spinner.fixed').show('slow');},500);
$.get('/webGui/include/Browse.php',{dir:encodeURIComponent("<?=$dir?>"),path:"<?=$path?>"},function(data){
clearTimeout(timers.browse);
var table = $('table.indexer');
var col = $.cookie('col')||1;
var dir = $.cookie('dir')||0;
table.html(data);
table.bind('sortEnd',function(e,t){
var sort = e.target.config.sortList.toString().split(',');
$.cookie('col',sort[0]);
$.cookie('dir',sort[1]);
});
$('div.spinner.fixed').hide('slow');
table.tablesorter({sortList:[[col,dir],[1,0]],sortAppend:[[1,0]],textAttribute:'data'});
});
});
</script>
<table class="indexer tablesorter shift">
<thead><tr><th>_(Type)_</th><th class='sorter-text'>_(Name)_</th><th>_(Size)_</th><th>_(Last Modified)_</th><th style="width:200px">_(Location)_</th></tr></thead>
<tbody><tr><td colspan="5">&nbsp;</td></tr></tbody>
</table>
<input type="button" value="_(Done)_" onclick="done('Browse')">