fix deprecated warnings because of constructor named as class, and dont give a PHP Fatal if old phpgwapi is missing

This commit is contained in:
Ralf Becker 2016-05-30 20:38:14 +02:00
parent ab4cd83b41
commit 8e540fe144
3 changed files with 10 additions and 5 deletions

View File

@ -14,7 +14,7 @@
*/
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);
}

View File

@ -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))

View File

@ -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(