summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-01-22 17:17:33 (GMT)
committerAleksander Machniak <machniak@kolabsys.com>2015-01-22 17:17:33 (GMT)
commit7c565bff0cb64349ace42b021934ad4ee335b721 (patch)
tree6484063e600d0a24f1a4a3d9acea088e8cfb4181
parent23e4d1b25aa0cbcf72bde36eda4340e0623fab85 (diff)
downloadroundcubemail-plugins-kolab-7c565bff0cb64349ace42b021934ad4ee335b721.tar.gz
Fix typo in function name (parse_alarm_value)
-rw-r--r--plugins/calendar/calendar.php4
-rw-r--r--plugins/calendar/drivers/database/database_driver.php2
-rw-r--r--plugins/libcalendaring/libcalendaring.php12
-rw-r--r--plugins/libcalendaring/libvcalendar.php4
-rw-r--r--plugins/libcalendaring/tests/libcalendaring.php14
-rw-r--r--plugins/libcalendaring/tests/libvcalendar.php6
-rw-r--r--plugins/tasklist/drivers/database/tasklist_database_driver.php2
7 files changed, 22 insertions, 22 deletions
diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php
index f84d07a..cde78fc 100644
--- a/plugins/calendar/calendar.php
+++ b/plugins/calendar/calendar.php
@@ -497,7 +497,7 @@ class calendar extends rcube_plugin
foreach (array('-M','-H','-D','+M','+H','+D') as $trigger)
$select_offset->add(rcube_label('trigger' . $trigger, 'libcalendaring'), $trigger);
- $preset = libcalendaring::parse_alaram_value($this->rc->config->get('calendar_default_alarm_offset', '-15M'));
+ $preset = libcalendaring::parse_alarm_value($this->rc->config->get('calendar_default_alarm_offset', '-15M'));
$p['blocks']['view']['options']['alarmoffset'] = array(
'title' => html::label($field_id . 'value', Q($this->gettext('defaultalarmoffset'))),
'content' => $input_value->show($preset[0]) . ' ' . $select_offset->show($preset[1]),
@@ -665,7 +665,7 @@ class calendar extends rcube_plugin
foreach (array('-M','-H','-D') as $trigger)
$select_offset->add(rcube_label('trigger' . $trigger, 'libcalendaring'), $trigger);
- $preset = libcalendaring::parse_alaram_value($this->rc->config->get('calendar_birthdays_alarm_offset', '-1D'));
+ $preset = libcalendaring::parse_alarm_value($this->rc->config->get('calendar_birthdays_alarm_offset', '-1D'));
$p['blocks']['birthdays']['options']['birthdays_alarmoffset'] = array(
'title' => html::label($field_id . 'value', rcube::Q($this->gettext('showalarms'))),
'content' => $select_type->show($this->rc->config->get('calendar_birthdays_alarm_type', '')) . ' ' . $input_value->show($preset[0]) . '&nbsp;' . $select_offset->show($preset[1]),
diff --git a/plugins/calendar/drivers/database/database_driver.php b/plugins/calendar/drivers/database/database_driver.php
index e4bdd68..e7b5ab1 100644
--- a/plugins/calendar/drivers/database/database_driver.php
+++ b/plugins/calendar/drivers/database/database_driver.php
@@ -1163,7 +1163,7 @@ class database_driver extends calendar_driver
// convert legacy alarms data
else if (strlen($alarms)) {
list($trigger, $action) = explode(':', $alarms, 2);
- if ($trigger = libcalendaring::parse_alaram_value($trigger)) {
+ if ($trigger = libcalendaring::parse_alarm_value($trigger)) {
$valarms = array(array('action' => $action, 'trigger' => $trigger[3] ?: $trigger[0]));
}
}
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index b9055b1..e33edbd 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -341,7 +341,7 @@ class libcalendaring extends rcube_plugin
$select_offset->add($this->gettext('trigger@'), '@');
// pre-set with default values from user settings
- $preset = self::parse_alaram_value($this->rc->config->get('calendar_default_alarm_offset', '-15M'));
+ $preset = self::parse_alarm_value($this->rc->config->get('calendar_default_alarm_offset', '-15M'));
$hidden = array('style' => 'display:none');
$html = html::span('edit-alarm-set',
$select_type->show($this->rc->config->get('calendar_default_alarm_type', '')) . ' ' .
@@ -421,7 +421,7 @@ class libcalendaring extends rcube_plugin
* Helper function to convert alarm trigger strings
* into two-field values (e.g. "-45M" => 45, "-M")
*/
- public static function parse_alaram_value($val)
+ public static function parse_alarm_value($val)
{
if ($val[0] == '@') {
return array(new DateTime($val));
@@ -452,7 +452,7 @@ class libcalendaring extends rcube_plugin
if ($alarm['trigger'] instanceof DateTime) {
$alarm['trigger'] = '@' . $alarm['trigger']->format('U');
}
- else if ($trigger = libcalendaring::parse_alaram_value($alarm['trigger'])) {
+ else if ($trigger = libcalendaring::parse_alarm_value($alarm['trigger'])) {
$alarm['trigger'] = $trigger[2];
}
return $alarm;
@@ -472,7 +472,7 @@ class libcalendaring extends rcube_plugin
}
catch (Exception $e) { /* handle this ? */ }
}
- else if ($trigger = libcalendaring::parse_alaram_value($alarm['trigger'])) {
+ else if ($trigger = libcalendaring::parse_alarm_value($alarm['trigger'])) {
$alarm['trigger'] = $trigger[3];
}
return $alarm;
@@ -538,7 +538,7 @@ class libcalendaring extends rcube_plugin
'vars' => array('datetime' => $rcube->format_date($m[1]))
));
}
- else if ($val = self::parse_alaram_value($trigger)) {
+ else if ($val = self::parse_alarm_value($trigger)) {
// TODO: for all-day events say 'on date of event at XX' ?
if ($val[0] == 0)
$text .= ' ' . $rcube->gettext('libcalendaring.triggerattime');
@@ -577,7 +577,7 @@ class libcalendaring extends rcube_plugin
// support legacy format
if (!$rec['valarms']) {
list($trigger, $action) = explode(':', $rec['alarms'], 2);
- if ($alarm = self::parse_alaram_value($trigger)) {
+ if ($alarm = self::parse_alarm_value($trigger)) {
$rec['valarms'] = array(array('action' => $action, 'trigger' => $alarm[3] ?: $alarm[0]));
}
}
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 787ca72..b81ae99 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -588,7 +588,7 @@ class libvcalendar implements Iterator
$alarm['trigger'] = $prop->getDateTime();
}
}
- if (!$trigger && ($values = libcalendaring::parse_alaram_value($prop->value))) {
+ if (!$trigger && ($values = libcalendaring::parse_alarm_value($prop->value))) {
$trigger = $values[2];
}
@@ -1057,7 +1057,7 @@ class libvcalendar implements Iterator
else if ($event['alarms']) {
$va = VObject\Component::create('VALARM');
list($trigger, $va->action) = explode(':', $event['alarms']);
- $val = libcalendaring::parse_alaram_value($trigger);
+ $val = libcalendaring::parse_alarm_value($trigger);
if ($val[3])
$va->add('TRIGGER', $val[3]);
else if ($val[0] instanceof DateTime)
diff --git a/plugins/libcalendaring/tests/libcalendaring.php b/plugins/libcalendaring/tests/libcalendaring.php
index 6b52617..b4373ad 100644
--- a/plugins/libcalendaring/tests/libcalendaring.php
+++ b/plugins/libcalendaring/tests/libcalendaring.php
@@ -29,29 +29,29 @@ class libcalendaring_test extends PHPUnit_Framework_TestCase
}
/**
- * libcalendaring::parse_alaram_value()
+ * libcalendaring::parse_alarm_value()
*/
- function test_parse_alaram_value()
+ function test_parse_alarm_value()
{
- $alarm = libcalendaring::parse_alaram_value('-15M');
+ $alarm = libcalendaring::parse_alarm_value('-15M');
$this->assertEquals('15', $alarm[0]);
$this->assertEquals('-M', $alarm[1]);
$this->assertEquals('-PT15M', $alarm[3]);
- $alarm = libcalendaring::parse_alaram_value('-PT5H');
+ $alarm = libcalendaring::parse_alarm_value('-PT5H');
$this->assertEquals('5', $alarm[0]);
$this->assertEquals('-H', $alarm[1]);
- $alarm = libcalendaring::parse_alaram_value('P0DT1H0M0S');
+ $alarm = libcalendaring::parse_alarm_value('P0DT1H0M0S');
$this->assertEquals('1', $alarm[0]);
$this->assertEquals('+H', $alarm[1]);
// FIXME: this should return something like (1140 + 120 + 30)M
- $alarm = libcalendaring::parse_alaram_value('-P1DT2H30M');
+ $alarm = libcalendaring::parse_alarm_value('-P1DT2H30M');
// $this->assertEquals('1590', $alarm[0]);
// $this->assertEquals('-M', $alarm[1]);
- $alarm = libcalendaring::parse_alaram_value('@1420722000');
+ $alarm = libcalendaring::parse_alarm_value('@1420722000');
$this->assertInstanceOf('DateTime', $alarm[0]);
}
diff --git a/plugins/libcalendaring/tests/libvcalendar.php b/plugins/libcalendaring/tests/libvcalendar.php
index 81b2120..9e2f03b 100644
--- a/plugins/libcalendaring/tests/libvcalendar.php
+++ b/plugins/libcalendaring/tests/libvcalendar.php
@@ -177,7 +177,7 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
$event = $events[0];
$this->assertEquals('-12H:DISPLAY', $event['alarms'], "Serialized alarms string");
- $alarm = libcalendaring::parse_alaram_value($event['alarms']);
+ $alarm = libcalendaring::parse_alarm_value($event['alarms']);
$this->assertEquals('12', $alarm[0], "Alarm value");
$this->assertEquals('-H', $alarm[1], "Alarm unit");
@@ -189,7 +189,7 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
$event = $events[0];
$this->assertEquals('-30M:DISPLAY', $event['alarms'], "Stripped alarm string");
- $alarm = libcalendaring::parse_alaram_value($event['alarms']);
+ $alarm = libcalendaring::parse_alarm_value($event['alarms']);
$this->assertEquals('30', $alarm[0], "Alarm value");
$this->assertEquals('-M', $alarm[1], "Alarm unit");
$this->assertEquals('-30M', $alarm[2], "Alarm string");
@@ -242,7 +242,7 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
// alarms
$this->assertEquals('-45M:AUDIO', $event['alarms'], "Relative alarm string");
- $alarm = libcalendaring::parse_alaram_value($event['alarms']);
+ $alarm = libcalendaring::parse_alarm_value($event['alarms']);
$this->assertEquals('45', $alarm[0], "Alarm value");
$this->assertEquals('-M', $alarm[1], "Alarm unit");
diff --git a/plugins/tasklist/drivers/database/tasklist_database_driver.php b/plugins/tasklist/drivers/database/tasklist_database_driver.php
index a1e1c97..48a3327 100644
--- a/plugins/tasklist/drivers/database/tasklist_database_driver.php
+++ b/plugins/tasklist/drivers/database/tasklist_database_driver.php
@@ -770,7 +770,7 @@ class tasklist_database_driver extends tasklist_driver
// convert legacy alarms data
else if (strlen($alarms)) {
list($trigger, $action) = explode(':', $alarms, 2);
- if ($trigger = libcalendaring::parse_alaram_value($trigger)) {
+ if ($trigger = libcalendaring::parse_alarm_value($trigger)) {
$valarms = array(array('action' => $action, 'trigger' => $trigger[3] ?: $trigger[0]));
}
}