From 8e540fe144255b50c9ebce093a6b6a5faedf01dc Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 30 May 2016 20:38:14 +0200 Subject: [PATCH] fix deprecated warnings because of constructor named as class, and dont give a PHP Fatal if old phpgwapi is missing --- calendar/sitemgr/class.module_calendar.inc.php | 9 +++++++-- calendar/sitemgr/class.module_calendar_list.inc.php | 4 ++-- calendar/sitemgr/class.module_calendar_month.inc.php | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/calendar/sitemgr/class.module_calendar.inc.php b/calendar/sitemgr/class.module_calendar.inc.php index ef5d88202e..e483407503 100644 --- a/calendar/sitemgr/class.module_calendar.inc.php +++ b/calendar/sitemgr/class.module_calendar.inc.php @@ -12,9 +12,9 @@ /** * Calendar day selection for sitemgr */ -class module_calendar extends Module +class module_calendar extends Module { - function module_calendar() + function __construct() { $this->arguments = array( 'redirect' => array( @@ -32,6 +32,11 @@ class module_calendar extends Module $date = (int) (strtotime(get_var('date',array('POST','GET')))); $redirect = $arguments['redirect'] ? $arguments['redirect'] : '#'; + if (!file_exists(EGW_SERVER_ROOT.'/phpgwapi')) + { + return 'Requires old phpgwapi!'; + } + return $GLOBALS['egw']->jscalendar->get_javascript(). $GLOBALS['egw']->jscalendar->flat($redirect,$date); } diff --git a/calendar/sitemgr/class.module_calendar_list.inc.php b/calendar/sitemgr/class.module_calendar_list.inc.php index 9149736f8c..d0d094bf16 100644 --- a/calendar/sitemgr/class.module_calendar_list.inc.php +++ b/calendar/sitemgr/class.module_calendar_list.inc.php @@ -85,7 +85,7 @@ class module_calendar_list extends Module */ var $ui; - function module_calendar_list() + function __construct() { $this->arguments = array( 'category' => array( @@ -157,7 +157,7 @@ class module_calendar_list extends Module { //_debug_array($GLOBALS['Common_BO']->sites->current_site); // copied from bookmarks module. - $cat = createobject('phpgwapi.categories','','calendar'); + $cat = new Api\Categories('','calendar'); $cats = $cat->return_array('all',0,False,'','cat_name','',True); $cat_ids = array(); while (list(,$category) = @each($cats)) diff --git a/calendar/sitemgr/class.module_calendar_month.inc.php b/calendar/sitemgr/class.module_calendar_month.inc.php index 8e0ad35dac..f74164f22a 100644 --- a/calendar/sitemgr/class.module_calendar_month.inc.php +++ b/calendar/sitemgr/class.module_calendar_month.inc.php @@ -48,7 +48,7 @@ class module_calendar_month extends Module */ var $default_css = '/calendar/templates/default/app.css'; - function module_calendar_month() + function __construct() { $this->bo = new calendar_bo(); $this->arguments = array(