From 73d4db845e28864ffa84beb0cdb5be45d56208d1 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 31 Aug 2006 16:55:48 +0000 Subject: [PATCH] New function choose_from_menu_yesno --- lib/weblib.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index d48ea68c38..386a3e481e 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -758,6 +758,16 @@ function choose_from_menu ($options, $name, $selected='', $nothing='choose', $sc } } +/** + * Choose value 0 or 1 from a menu with options 'No' and 'Yes'. + * Other options like choose_from_menu. + */ +function choose_from_menu_yesno($name, $selected, $script = '', + $return = false, $disabled = false, $tabindex = 0) { + return choose_from_menu(array(get_string('no'), get_string('yes')), $name, + $selected, '', $script, '0', $return, $disabled, $tabindex); +} + /** * Just like choose_from_menu, but takes a nested array (2 levels) and makes a dropdown menu * including option headings with the first level. @@ -5236,4 +5246,4 @@ function page_doc_link($text='', $iconpath='') { // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140: -?> +?> \ No newline at end of file -- 2.39.5