From 3faa6471944db14f272c5bd171d2f253e4fddf09 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 24 Jul 2009 11:35:34 +0000 Subject: [PATCH] "fixed call to old php4 constructor" --- phpgwapi/inc/class.jscalendar.inc.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/phpgwapi/inc/class.jscalendar.inc.php b/phpgwapi/inc/class.jscalendar.inc.php index 16f4b7623b..c522d0052f 100644 --- a/phpgwapi/inc/class.jscalendar.inc.php +++ b/phpgwapi/inc/class.jscalendar.inc.php @@ -37,22 +37,30 @@ class jscalendar * @param string $path='jscalendar' * @return jscalendar */ - function __construct($do_header=True,$path='jscalendar',$scriptreturn=false) + function __construct($do_header=True,$path='jscalendar') { $this->jscalendar_url = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/'.$path; $this->dateformat = $GLOBALS['egw_info']['user']['preferences']['common']['dateformat']; - $js= + if ($do_header && (strpos($GLOBALS['egw_info']['flags']['java_script'],'jscalendar')===false)) + { + $GLOBALS['egw_info']['flags']['java_script'] .= $this->get_javascript(); + } + } + + /** + * return javascript needed for jscalendar + * + * @return string + */ + function get_javascript() + { + return ' '; - if ($do_header && (strpos($GLOBALS['egw_info']['flags']['java_script'],'jscalendar')===false)) - { - $GLOBALS['egw_info']['flags']['java_script'] .=$js; - } - if ($scriptreturn==true) return $js; //if the header is already send to the Browser } /** @@ -140,7 +148,7 @@ Calendar.setup( */ function flat($url,$date=null,$weekUrl='',$weekTTip='',$monthUrl='',$monthTTip='',$id='calendar-container') { - $javascript=$this->jscalendar(false,'jscalendar',true); + $javascript = $this->get_javascript(); if ($date) // string if format YYYYmmdd or timestamp { $date = is_int($date) ? adodb_date('m/d/Y',$date) :