Example #1
0
function check_box($name, $value = '1', $options = array())
{
    $v = isset($_REQUEST[$name]) ? $_REQUEST[$name] : '';
    $p = build_attributes($options);
    $checked = $v === $value ? ' checked="checked"' : '';
    return "<input type=\"checkbox\" name=\"{$name}\" value=\"{$value}\"{$p}{$checked} />";
}
 public function tag($id = "tag", $title = "Tag")
 {
     $options = build_tag('&mdash;', build_attributes(array('value' => '')), 'option');
     $tags = get_tags();
     foreach ($tags as $tag) {
         $options .= $this->option($tag->slug, $tag->name, $this->form_instance[$id]);
     }
     $dropdown = build_tag($options, $this->field_meta($id, $style = 'max-width: 98%;'), 'select');
     echo build_tag($this->label($id, $title) . '<br>' . $dropdown);
 }