From eaeaf964dc4110c33212076dde3e32e9953f1958 Mon Sep 17 00:00:00 2001 From: moquist Date: Thu, 10 Aug 2006 04:33:55 +0000 Subject: [PATCH] Added $return=false parameter to close_window_button() and choose_from_radio(). --- lib/weblib.php | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 2e5ecbe447..9dc6893fe9 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -655,20 +655,27 @@ function button_to_popup_window ($url, $name='popup', $linkname='click here', /** * Prints a simple button to close a window */ -function close_window_button($name='closewindow') { - - echo '
' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '
' . "\n"; +function close_window_button($name='closewindow', $return=false) { + $output = ''; + + $output .= '
' . "\n"; + $output .= '' . "\n"; + $output .= '' . "\n"; + $output .= '
' . "\n"; + + if ($return) { + return $output; + } else { + echo $output; + } } /* @@ -802,7 +809,7 @@ function choose_from_menu_nested($options,$name,$selected='',$nothing='choose',$ * @param string $name Name of the radiogroup (unique in the form) * @param string $checked The value that is already checked */ -function choose_from_radio ($options, $name, $checked='') { +function choose_from_radio ($options, $name, $checked='', $return=false) { static $idcounter = 0; @@ -832,7 +839,11 @@ function choose_from_radio ($options, $name, $checked='') { $output .= '' . "\n"; - echo $output; + if ($return) { + return $output; + } else { + echo $output; + } } /** Display an standard html checkbox with an optional label @@ -884,7 +895,7 @@ function print_checkbox ($name, $value, $checked = true, $label = '', $alt = '', * @param string $label The label to be showed near the text field * @param string $alt The info to be inserted in the alt tag */ -function print_textfield ($name, $value, $alt = '',$size=50,$maxlength= 0,$return=false) { +function print_textfield ($name, $value, $alt = '',$size=50,$maxlength=0, $return=false) { static $idcounter = 0; -- 2.39.5