From 6acca71ce976d35bd0a1dcc1c4cb93e30d3d2aba 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 ac1b127f50..7abb0322d8 100644 --- a/core/helper_api.php +++ b/core/helper_api.php @@ -314,6 +314,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.