summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-07 08:58:39 (GMT)
committerAleksander Machniak <alec@alec.pl>2013-05-07 08:58:39 (GMT)
commitaae87c8954a10288b8cffdbcf937269b465486e5 (patch)
tree25860eafcee8bfefad15bb6ec883efbd43f1d2ee
parent484e5ad4982bf2b5037a297f314724f053965742 (diff)
downloadroundcubemail-plugins-kolab-aae87c8954a10288b8cffdbcf937269b465486e5.tar.gz
Fix so default categories are used when categories aren't configured
-rw-r--r--plugins/calendar/calendar.php7
-rw-r--r--plugins/calendar/drivers/calendar_driver.php9
-rw-r--r--plugins/calendar/drivers/kolab/kolab_driver.php4
3 files changed, 10 insertions, 10 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index 82f7b3c..1517306 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -58,13 +58,6 @@ class calendar extends rcube_plugin
'calendar_time_indicator' => true,
);
- private $default_categories = array(
- 'Personal' => 'c0c0c0',
- 'Work' => 'ff0000',
- 'Family' => '00ff00',
- 'Holiday' => 'ff6600',
- );
-
private $ics_parts = array();
diff --git a/plugins/calendar/drivers/calendar_driver.php b/plugins/calendar/drivers/calendar_driver.php
index 478a08c..43e1345 100644
--- a/plugins/calendar/drivers/calendar_driver.php
+++ b/plugins/calendar/drivers/calendar_driver.php
@@ -91,6 +91,13 @@ abstract class calendar_driver
public $alarm_absolute = true;
public $last_error;
+ protected $default_categories = array(
+ 'Personal' => 'c0c0c0',
+ 'Work' => 'ff0000',
+ 'Family' => '00ff00',
+ 'Holiday' => 'ff6600',
+ );
+
/**
* Get a list of available calendars from this source
*
@@ -328,7 +335,7 @@ abstract class calendar_driver
public function list_categories()
{
$rcmail = rcube::get_instance();
- return $rcmail->config->get('calendar_categories', array());
+ return $rcmail->config->get('calendar_categories', $this->default_categories);
}
/**
diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php
index 6b980cd..081f2b0 100644
--- a/plugins/calendar/drivers/kolab/kolab_driver.php
+++ b/plugins/calendar/drivers/kolab/kolab_driver.php
@@ -698,7 +698,7 @@ class kolab_driver extends calendar_driver
}
// add new categories to user prefs
- $old_categories = $this->rc->config->get('calendar_categories', array());
+ $old_categories = $this->rc->config->get('calendar_categories', $this->default_categories);
if ($newcats = array_diff(array_map('strtolower', array_keys($categories)), array_map('strtolower', array_keys($old_categories)))) {
foreach ($newcats as $category)
$old_categories[$category] = ''; // no color set yet
@@ -867,7 +867,7 @@ class kolab_driver extends calendar_driver
public function list_categories()
{
// FIXME: complete list with categories saved in config objects (KEP:12)
- return $this->rc->config->get('calendar_categories', array());
+ return $this->rc->config->get('calendar_categories', $this->default_categories);
}
/**