From 08377c2a40f887d30007cbef461c7887b1f7ae5f Mon Sep 17 00:00:00 2001 From: viniciuscb Date: Fri, 26 Nov 2004 13:14:19 +0000 Subject: [PATCH] Change in selection() method to allow non-html return --- phpgwapi/inc/class.uiaccountsel.inc.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.uiaccountsel.inc.php b/phpgwapi/inc/class.uiaccountsel.inc.php index 1016d8d5f3..46444cf01b 100644 --- a/phpgwapi/inc/class.uiaccountsel.inc.php +++ b/phpgwapi/inc/class.uiaccountsel.inc.php @@ -63,9 +63,11 @@ * @param $select array/bool/string array with id's as keys or values. If the id is in the key and the value is a string, * it gets appended to the user-name. Or false if the selectable values for the selectbox are determined by use. * Or a string which gets added as first Option with value=0, eg. lang('all') + * @param $nohtml boolean if true, returns an array with the key 'selected' as the selected participants, + * and with the key 'participants' as the participants data as would fit in a select. * @return the necessary html */ - function selection($name,$element_id,$selected,$use='accounts',$lines=0,$not=False,$options='',$onchange='',$select=False) + function selection($name,$element_id,$selected,$use='accounts',$lines=0,$not=False,$options='',$onchange='',$select=False,$nohtml=false) { //echo "

uiaccountsel::selection('$name',".print_r($selected,True).",'$use',$lines,$not,'$options','$onchange',".print_r($select,True).")

\n"; if (!is_array($selected)) @@ -201,6 +203,14 @@ { $select = array($extra_label) + $select; } + + if ($nohtml) + { + return array( + 'selected' => $selected, + 'participants' => $select + ); + } //echo "

html::select('$name',".print_r($selected,True).",".print_r($select,True).",True,'$options')

\n"; $html = $this->html->select($name,$selected,$select,True,$options.' id="'.$element_id.'"',$lines > 1 ? $lines : 0);