1
0
Fork 0
template/functions/checkbox.php

25 lines
784 B
PHP
Raw Normal View History

2024-04-25 21:55:08 +02:00
<?php
function checkbox($string, $id, $desc = null, $variable = null, $disabled = false) {
$content = '<div class="checkbox'.(!empty($desc) ? '' : ' nodesc').'">';
$content .= '<div>';
$content .= '<input type="checkbox" name="check-'.$id.'" id="'.$id.'"';
$content .= ($variable == true ? ' checked' : null);
$content .= ($disabled == false ? null : ' disabled').'>';
$content .= '<div class="icon-checkbox is-unchecked">'.svgicon('unchecked').'</div>';
$content .= '<div class="icon-checkbox is-checked">'.svgicon('checked').'</div>';
$content .= '<label for="'.$id.'">'.$string.'</label>';
$content .= '</div>';
if(!empty($desc)) {
$content .= '<div class="desc">'.$desc.'</div>';
}
$content .= '</div>';
return $content;
}
2024-04-28 14:31:08 +02:00
?>