1
0
Fork 0
template/functions/checkbox.php

24 lines
783 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-09-23 20:40:19 +02:00
?>