function render()
{
$disabled = "";
$inputclass = "";
$groupclass = "";
$onchange = "";
$helpblock = "";
$popover = "";
$value = $this->value();
$checked = $value === true ? " checked=\"checked\" " : "";
$label = $this->option("label");
$prop = $this->option("prop");
if ($this->option("readonly") === true) {
$inputclass .= " disabled";
$disabled = " disabled";
}
if ($this->option("error") === true) {
$groupclass .= " error";
}
if (($sHelp = trim($this->option("help"))) !== "") {
$helpblock = "<p class=\"help-block\">" . $sHelp . "</p>";
}
if (($aPopover = $this->option("popover")) !== "") {
$inputclass .= " popover-hover ";
$popover = " title=\"" . htmlspecialchars($aPopover["title"]) . "\" ";
$popover .= " data-content=\"" . htmlspecialchars($aPopover["content"]) . "\" ";
}
if ($this->option("refreshonchange") === true) {
$onchange = " onchange=\"document.getElementsByTagName('form')[0].elements['refreshed'].value=1;document.getElementsByTagName('form')[0].submit();\" ";
}
$sHtml = <<<HTML
<div class="control-group{$groupclass}">
\t<label class="control-label" for="{$prop}">{$label}</label>
\t<div class="controls">
\t\t<input type="checkbox" class="input-xlarge{$inputclass}" id="{$prop}" name="data[{$prop}]" value="1"{$checked}{$disabled}{$popover}{$onchange}/>
\t\t{$helpblock}
\t</div>
</div>
HTML;
return $sHtml . $this->renderWitness();
}