37 require_once realpath(dirname(__FILE__)).
"/../field_renderers.inc";
56 $this->hideLabel =
true;
57 if ($field && !
$parent->data->hasField($field))
59 $parent->add($this, $field, $label);
65 $label = isset($this->label) ? $this->label : $this->parent->prettifyFieldName($field);
80 echo
"<input id='{$this->parent->id}_{$field}' type='checkbox' class='checkbox' value='1' name='$field'";
81 if ($this->parent->data->get($field))
85 echo
" {$disable}{$onClick}> <label for='{$this->parent->id}_{$field}' class='label'>";
95 echo
"<td colspan='2'";
96 if ($this->parent->labelCSS) echo
" class='{$this->parent->labelCSS}'";
97 echo
"><input type='checkbox' value='1' name='$field:$mode'";
98 if ($this->parent->params->get($field, $mode))
103 echo $this->parent->prettifyFieldName($field);
104 echo
"</td>\n</tr>\n";
110 $this->hideLabel =
false;
113 echo $this->
format($field);
Field renderer for boolean data fields.
$template
, alternative to readonly; field can be reenabled thru javascript
BooleanFieldRenderer(&$parent, $field=null, $label=null)
Create a new BooleanFieldRenderer.
renderSearchField($field, $mode="match")
FieldRenderers must override this method to provide the HTML implementation of the control displayed ...
addValidatorsToForm($field, $required=false)
This method is called by the AutoForm to add any default input validators that are required by the Fi...
$onClick
Name of Javascript function to be called when checkbox is toggled.
renderField($field)
FieldRenderers must override this method to provide the HTML implementation of the control used to ed...
static format($value, $template="")
FieldRenderer is the abstract base class for all FieldRenderers.
_startField($field, $styles="")
Internal method to generate the starting HTML for the field (including the label)
_getLabel($field, $addSuffix=true)
_endField($field)
Internal method to generate the closing HTML for the field.
FieldRenderer($parent)
Constructor.
RequiredBoolean Validator.