Fixed issue with setup block checkbox generator

This commit is contained in:
matthew 2019-07-04 12:56:45 -05:00 committed by Shish
parent c16d55995b
commit a7188a452b

View file

@ -184,15 +184,19 @@ class SetupBlock extends Block
global $config;
$checked = $config->get_bool($name) ? " checked" : "";
$html = "<input type='checkbox' id='$name' name='_config_$name'$checked>\n";
if (!is_null($label)) {
$html = "";
if(!$table_row&&!is_null($label)) {
$html .= "<label for='{$name}'>{$label}</label>";
}
$html .= "<input type='checkbox' id='$name' name='_config_$name'$checked>\n";
if ($table_row && !is_null($label)) {
$html .= "<label for='{$name}'>{$label}</label>";
$label = null;
}
$html .= "<input type='hidden' name='_type_$name' value='bool'>\n";
$this->format_option($name, $html, $label, $table_row);
$this->format_option($name, $html, null, $table_row);
}
// public function add_hidden_option($name, $label=null) {