Difference between revisions of "Jk-voting-template"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 79)
 
m (Reverted edit of 69.146.41.187, changed back to last version by Vkurup)
 
(3 intermediate revisions by 3 users not shown)
(No difference)

Latest revision as of 13:06, 24 March 2006

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
}