From: Janusz Dobrowolski Date: Thu, 15 Jan 2009 14:55:56 +0000 (+0000) Subject: Separated checkbox generation for indirect display use. X-Git-Tag: v2.4.2~19^2~1613 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=5cf7113e0d3383138e22fc9c88e159b81e774528;p=fa-stable.git Separated checkbox generation for indirect display use. --- diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index b239964a..f604deb8 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -255,13 +255,14 @@ function check_value($name) return 1; } -function check($label, $name, $value=null, $submit_on_change=false, $title=false) +function checkbox($label, $name, $value=null, $submit_on_change=false, $title=false) { global $Ajax; - + + $str = ''; default_focus($name); if ($label) - echo $label . " "; + $str .= $label . " "; if ($submit_on_change !== false) { if ($submit_on_change === true) $submit_on_change = @@ -270,13 +271,20 @@ function check($label, $name, $value=null, $submit_on_change=false, $title=false if ($value === null) $value = get_post($name,0); - echo "\n"; + $str .= "\n"; + $Ajax->addUpdate($name, $name, $value); + return $str; +} + +function check($label, $name, $value=null, $submit_on_change=false, $title=false) +{ + echo checkbox($label, $name, $value, $submit_on_change, $title); } function check_cells($label, $name, $value, $submit_on_change=false, $title=false) @@ -284,14 +292,14 @@ function check_cells($label, $name, $value, $submit_on_change=false, $title=fals if ($label != null) echo "$label\n"; echo ""; - check(null, $name, $value, $submit_on_change, $title); + echo check(null, $name, $value, $submit_on_change, $title); echo ""; } function check_row($label, $name, $value, $submit_on_change=false, $title=false) { echo ""; - check_cells($label, $name, $value, $submit_on_change, $title); + echo check_cells($label, $name, $value, $submit_on_change, $title); echo "\n"; }