aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/calendar_monthly.class.php2
-rw-r--r--include/calendar_weekly.class.php2
-rw-r--r--include/functions_calendar.inc.php7
3 files changed, 7 insertions, 4 deletions
diff --git a/include/calendar_monthly.class.php b/include/calendar_monthly.class.php
index b9c845536..9ab38aee7 100644
--- a/include/calendar_monthly.class.php
+++ b/include/calendar_monthly.class.php
@@ -38,7 +38,7 @@ define('CDAY', 2);
/**
* Monthly calendar style (composed of years/months and days)
*/
-class Calendar extends CalendarBase
+class CalendarMonthly extends CalendarBase
{
/**
* Initialize the calendar.
diff --git a/include/calendar_weekly.class.php b/include/calendar_weekly.class.php
index d35e294b5..346f658d4 100644
--- a/include/calendar_weekly.class.php
+++ b/include/calendar_weekly.class.php
@@ -38,7 +38,7 @@ define('CDAY', 2);
/**
* Weekly calendar style (composed of years/week in years and days in week)
*/
-class Calendar extends CalendarBase
+class CalendarWeekly extends CalendarBase
{
/**
* Initialize the calendar
diff --git a/include/functions_calendar.inc.php b/include/functions_calendar.inc.php
index 30cdb0db0..850ccdccf 100644
--- a/include/functions_calendar.inc.php
+++ b/include/functions_calendar.inc.php
@@ -114,11 +114,13 @@ WHERE id IN (' . implode(',',$page['items']) .')';
'monthly' => array(
'include' => 'calendar_monthly.class.php',
'view_calendar' => true,
+ 'classname' => 'CalendarMonthly',
),
// Weekly style
'weekly' => array(
'include' => 'calendar_weekly.class.php',
'view_calendar' => false,
+ 'classname' => 'CalendarWeekly',
),
);
@@ -133,9 +135,10 @@ WHERE id IN (' . implode(',',$page['items']) .')';
$page['chronology_style'] = 'monthly';
}
$cal_style = $page['chronology_style'];
+ $classname = $styles[$cal_style]['classname'];
+
include(PHPWG_ROOT_PATH.'include/'. $styles[$cal_style]['include']);
- // TODO : class name overlap, rename them in CalendarMonth and CalendarWeek
- $calendar = new Calendar();
+ $calendar = new $classname();
// Retrieve view