1 <?php
3 class TemplateWidget_checkbox extends TemplateWidget
4 {
5 function render()
6 {
7 $str = "";
8 $str .= "<input type='checkbox' value='1' name='{$this->postName}' ";
9 if($this->value) $str .= " checked ";
10 $str .= ">";
11 return($str);
12 }
14 function save_object()
15 {
16 $this->value = isset($_POST[$this->postName]);
17 }
18 }
19 ?>