Permalink
Browse files

Improve readonly rendering for checkboxes

  • Loading branch information...
flack committed Dec 3, 2018
1 parent 70fa18f commit 4473581ac70e179cc4671f0cf0a29d5e0870108a
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/midcom/datamanager/template/form.php
@@ -284,6 +284,15 @@ public function radio_widget(FormView $view, array $data)
public function checkbox_widget(FormView $view, array $data)
{
if (!empty($data['attr']['readonly'])) {
$string = '<img src="' . MIDCOM_STATIC_URL . '/stock-icons/16x16/';
if ($data['checked']) {
$string .= 'ok.png" alt="selected" />';
} else {
$string .= 'cancel.png" alt="not selected" />';
}
return $string . $this->renderer->block($view, 'form_widget_simple', ['type' => "hidden"]);
}
$string = '<input type="checkbox"';
$string .= $this->renderer->block($view, 'widget_attributes');
if (isset($data['value'])) {

0 comments on commit 4473581

Please sign in to comment.