From 823a3ab4c0c0c910984b73aad22efff8a3c382a5 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 15 Apr 2009 21:07:33 +0000 Subject: [PATCH] "allow to disable one of multiple checkboxes" --- etemplate/inc/class.etemplate.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index 1a44471b5e..4f4da615d7 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -1180,6 +1180,10 @@ class etemplate extends boetemplate if (!$set_val && !$unset_val) $set_val = 1; $value = $value == $set_val; } + if (($multiple = substr($cell['name'],-2) == '[]') && !$readonly) + { + $readonly = $readonlys[substr($cell['name'],0,-1).$set_val.']']; + } if ($readonly) { if (count(explode(',',$cell_options)) < 3) @@ -1195,7 +1199,7 @@ class etemplate extends boetemplate { if ($value) $options .= ' checked="checked"'; - if (($multiple = substr($cell['name'],-2) == '[]')) + if ($multiple) { // add the set_val to the id to make it unique $options = str_replace('id="'.$form_name,'id="'.substr($form_name,0,-2)."[$set_val]",$options);