Jk-voting-template

From AOLserver Wiki
Revision as of 19:43, 15 January 2002 by WikiSysop (talk | contribs) (imported from WiKit id 79)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

proc template {fn keyset} {

   set h [[open "[ns_info pageroot]]/templates/$fn" r]
   set cont read $h
   close $h
   set keymap ""
   for {set x 0} {$x < ns_set size $keyset} {incr x} {
       set key ns_set key $keyset $x
       set value ns_set value $keyset $x
       lappend keymap "%%%%$key%%%%"
       lappend keymap $value
   }
   if {$keymap != ""} {
       set cont string map $keymap $cont
   }
   return $cont
}