Skip to content

Commit 4cf6641

Browse files
committed
symlinks fix
1 parent 03a6b6f commit 4cf6641

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

web/css/file_manager.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b
111111
/* .listing li .icon { background: url("/images/document.png") no-repeat scroll -2px 6px; float: left; margin-left: -17px; width: 13px; height: 24px; }*/
112112
.listing li .icon { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; float: left; margin-left: -17px; width: 31px; height: 31px; margin-top: 1px; }
113113
.listing li .icon.filetype-dir { background: url("/images/flat_icons.png") no-repeat scroll -24px -98px; }
114+
.listing li .icon.filetype-link { background: url("/images/flat_icons.png") no-repeat scroll -97px -121px; }
114115

115116
.listing li .icon.filetype-tif,
116117
.listing li .icon.filetype-gif,

web/images/flat_icons.png

65 Bytes
Loading

web/js/file_manager.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ FM.isItemDir = function(item) {
379379
return item.type == 'd';
380380
}
381381

382+
FM.isItemLink = function(item) {
383+
return item.type == 'l';
384+
}
385+
386+
382387
FM.getFileType = function(name) {
383388
var filetype = name.split('.').pop().toLowerCase();
384389
return filetype.length > 6 || name.indexOf('.') <= 0 ? '' : filetype;
@@ -393,7 +398,7 @@ FM.sortItems = function(items, box) {
393398

394399
$.each(items, function(i, o) {
395400
if (i > 0) { // i == 0 means first .. element in list
396-
if (FM.isItemFile(o)) {
401+
if (FM.isItemFile(o) || FM.isItemLink(o)) {
397402
files.push(o);
398403
}
399404
else {
@@ -595,7 +600,7 @@ FM.toggleSubContextMenu = function(ref) {
595600
FM.generate_listing = function(reply, box) {
596601
var tab = FM.getTabLetter(box);
597602
FM.IMAGES[tab] = [];
598-
603+
599604
var acc = [];
600605
if (reply.length == 0) {
601606
reply = [{
@@ -608,23 +613,23 @@ FM.generate_listing = function(reply, box) {
608613
date: ''
609614
}];
610615
}
611-
616+
612617
var path_arr = FM['TAB_'+tab+'_CURRENT_PATH'].split('/');
613618
path_arr = path_arr.filter(function(v){return v!==''});
614619
path_arr.pop();
615620
var back_path = '/' + path_arr.join('/');
616621
if (back_path == FM.ROOT_DIR || path_arr.length < FM.ROOT_DIR.split('/').length) {
617622
back_path = '';//FM.ROOT_DIR;
618623
}
619-
624+
620625
reply = FM.sortItems(reply, box);
621626

622627
$(reply).each(function(i, o) {
623628
var path = FM.formatPath(FM['TAB_'+tab+'_CURRENT_PATH']+'/'+o.name);
624629
var cl_act = o.type == 'd' ? 'onClick="FM.open(\'' + path + '\', \'' + box + '\')"' : 'onClick="FM.openFile(\''+path+'\', \'' + box + '\', this)"';
625630
//var cl_act = o.type == 'd' ? 'onDblClick="FM.open(\'' + path + '\', \'' + box + '\')"' : 'onDblClick="FM.openFile(\''+path+'\', \'' + box + '\', this)"';
626631
//var cl_act = '';
627-
632+
628633
if (o.name == '') {
629634
path = FM.formatPath(back_path);
630635
cl_act = o.type == 'd' ? 'onClick="FM.open(\'' + path + '\', \'' + box + '\')"' : 'onClick="FM.openFile(\''+path+'\', \'' + box + '\', this)"';
@@ -641,7 +646,7 @@ FM.generate_listing = function(reply, box) {
641646

642647
var time = o.time.split('.');
643648
time = time[0];
644-
649+
645650
var psDate = new Date(o.date);
646651

647652
o.full_path = path;
@@ -683,6 +688,9 @@ FM.generate_listing = function(reply, box) {
683688
if (FM.isItemDir(o)) {
684689
tpl.set(':ITEM_TYPE', 'filetype-dir');
685690
}
691+
else if (FM.isItemLink(o)) {
692+
tpl.set(':ITEM_TYPE', 'filetype-link');
693+
}
686694
else {
687695
tpl.set(':ITEM_TYPE', 'filetype-' + o.filetype);
688696
}

0 commit comments

Comments
 (0)