forked from hummypkg/webif
20 lines
442 B
Plaintext
20 lines
442 B
Plaintext
|
|
proc eval_plugins {hook {verbose 0} {callback ""}} {
|
|
foreach plugin [lsort [glob -nocomplain /mod/webif/plugin/*]] {
|
|
if {[file exists "$plugin/.disabled"]} continue
|
|
if {[file isfile "$plugin/$hook.hook"]} {
|
|
if {$callback ne ""} {
|
|
uplevel $callback $plugin $hook.hook
|
|
continue
|
|
}
|
|
if {[catch \
|
|
{uplevel source "$plugin/$hook.hook"} msg]} {
|
|
if {$verbose} {
|
|
puts "$plugin/$hook - $msg"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|