support variable dustbin name

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@663 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2012-01-14 00:12:07 +00:00
parent 3312a76cc6
commit 602f96e1ac
2 changed files with 5 additions and 2 deletions

View File

@ -30,13 +30,15 @@ if {$order eq "-"} {
[settings new] sortorder $order [settings new] sortorder $order
} }
set dustbin [system dustbin 1]
proc directory {file bfile} { proc directory {file bfile} {
global flatten global flatten
regsub -all " +" $bfile "" tbfile regsub -all " +" $bfile "" tbfile
puts "<div class=va>" puts "<div class=va>"
set img "/images/711_1_09_Media_Folder.png" set img "/images/711_1_09_Media_Folder.png"
if {$bfile eq "_dustbin"} { set img "/img/Dustbin_Folder.png" } if {$bfile eq $::dustbin} { set img "/img/Dustbin_Folder.png" }
puts "<img border=0 class=va id=\"img$tbfile\" src=$img>" puts "<img border=0 class=va id=\"img$tbfile\" src=$img>"
puts "<input class=\"fs fsdir\" type=checkbox>" puts "<input class=\"fs fsdir\" type=checkbox>"
puts "<a class=dbf puts "<a class=dbf

View File

@ -50,12 +50,13 @@ proc {system mediaroot} {} {
return "" return ""
} }
proc {system dustbin} {} { proc {system dustbin} {{short 0}} {
set dustbin "_dustbin" set dustbin "_dustbin"
if {![catch {set fd [open "/mod/boot/dustbin.name" r]}]} { if {![catch {set fd [open "/mod/boot/dustbin.name" r]}]} {
set dustbin [lindex [split [read $fd] "\n"] 0] set dustbin [lindex [split [read $fd] "\n"] 0]
$fd close $fd close
} }
if {$short} { return $dustbin }
return "[system mediaroot]/$dustbin" return "[system mediaroot]/$dustbin"
} }