From 303521d14c57b066445e4e43dbcfa1e500de3488 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Jan 2012 04:12:15 +0800 Subject: [PATCH] New: add possibility to disable or show/hide another elements --- htdocs/core/lib/ajax.lib.php | 44 ++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index e01ae8ef04e..c38b957a813 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -221,60 +221,70 @@ function ajax_combobox($htmlname) * @param string $code Name of constant * @param array $input Input element * @param int $entity Entity to set - * TODO add different method for other input (show/hide, disable, ..) + * @return void */ function ajax_constantonoff($code,$input=array(),$entity=false) { global $conf, $langs; - + $entity = ((! empty($entity) && is_numeric($entity) && $entity > 0) || $entity == 0 ? $entity : $conf->entity); $out= '