webif/var/mongoose/lib/browse.class
hummypkg 7172c7c107 auto mpg extract, fix rename
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1325 2a923420-c742-0410-a762-8d5b09965624
2013-01-08 22:43:43 +00:00

62 lines
1.4 KiB
Plaintext

require system.class
#if {![exists -proc class]} { package require oo }
#class browse {}
set _flatten [system pkginst flatten]
proc _addicon {img {hover ""} {class va}} {
set icon "<img src=$img class=\"$class\" height=21"
if {$hover ne ""} {
append icon " alt=\"$hover\" title=\"$hover\""
}
append icon ">"
return $icon
}
proc {dir iconset} {dir} {
set icons {}
set attrs {}
set noflat 0
if $::_flatten {
if {[string match {\[*\]} [file tail $dir]]} { set noflat 1 }
if {[file exists "$dir/.noflatten"]} { set noflat 1 }
if $noflat { lappend icons \
[_addicon "/img/flat-tyre.png" "No-flatten" }
lappend attrs "noflat=$noflat"
}
set autoshrink 0
if {[file exists "$dir/.autoshrink"]} {
set autoshrink 1
lappend icons [_addicon "/img/compress.png" "Auto-shrink"]
lappend attrs "autoshrink=$autoshrink"
}
set autodedup 0
if {[file exists "$dir/.autodedup"]} {
set autodedup 1
lappend icons [_addicon "/img/dedup.png" "Auto-dedup"]
lappend attrs "autodedup=$autodedup"
}
set autodecrypt 0
if {[file exists "$dir/.autodecrypt"]} {
set autodecrypt 1
lappend icons [_addicon "/img/decrypt.png" "Auto-decrypt"]
lappend attrs "autodecrypt=$autodecrypt"
}
set autompg 0
if {[file exists "$dir/.autompg"]} {
set autompg 1
lappend icons [_addicon "/img/mpg.png" "Auto-MPG Extract"]
lappend attrs "autompg=$autompg"
}
return [list $icons $attrs]
}