From cf773147586a7a774299301e94e203f237659369 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Fri, 7 Jun 2013 15:28:02 +0200 Subject: [PATCH] Add new helper API function check_disabled() Prerequisite to fix issue #16024 --- core/helper_api.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/helper_api.php b/core/helper_api.php index 1ffc981753..6329dc9302 100644 --- a/core/helper_api.php +++ b/core/helper_api.php @@ -271,6 +271,18 @@ function check_selected( $p_var, $p_val = true, $p_strict = true ) { } } +/** + * If $p_val is true then we PRINT DISABLED to prevent selection of the + * current option list item + * + * @param bool $p_val + */ +function check_disabled( $p_val = true ) { + if( $p_val ) { + echo ' disabled="disabled" '; + } +} + /** * Set up PHP for a long process execution * The script timeout is set based on the value of the long_process_timeout config option.