From d48577b0f1f9f71d9add59fed92fe9c228917d85 Mon Sep 17 00:00:00 2001 From: viniciuscb Date: Thu, 25 Nov 2004 20:39:17 +0000 Subject: [PATCH] Changed type of return of input function: can now return an input with html and js together (default, as it had ever been) or can return an array with html and js parts separed. --- phpgwapi/inc/class.jscalendar.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.jscalendar.inc.php b/phpgwapi/inc/class.jscalendar.inc.php index d62c539cfc..19abfeca02 100644 --- a/phpgwapi/inc/class.jscalendar.inc.php +++ b/phpgwapi/inc/class.jscalendar.inc.php @@ -53,7 +53,7 @@ @param $helpmsg a helpmessage for the statusline of the browser @param $options any other options to the inputfield */ - function input($name,$date,$year=0,$month=0,$day=0,$helpmsg='',$options='') + function input($name,$date,$year=0,$month=0,$day=0,$helpmsg='',$options='',$jsreturn=false) { //echo "

jscalendar::input(name='$name', date='$date'='".date('Y-m-d',$date)."', year='$year', month='$month', day='$day')

\n"; @@ -81,6 +81,17 @@ $options .= " onFocus=\"self.status='".addslashes($helpmsg)."'; return true;\"" . " onBlur=\"self.status=''; return true;\""; } + + if ($jsreturn) + { + $return_array = array( + 'html' => '', + 'js' => 'Calendar.setup({inputField : "'.$name.'",button: "'.$name.'-trigger" });' + ); + + return $return_array; + + } return '