From 7193e5a39589847cd91783e463ed79d9d4d24d7b Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sun, 24 Oct 2010 22:00:53 -0400 Subject: [PATCH] More iCalendar -> Icalendar changes --- framework/Itip/lib/Horde/Itip.php | 2 +- framework/Itip/lib/Horde/Itip/Event.php | 2 +- framework/Itip/lib/Horde/Itip/Response.php | 2 +- framework/Itip/test/Horde/Itip/Integration/ItipTest.php | 4 ++-- .../Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Cache.php | 10 +++++----- framework/SyncML/SyncML/Device/Sync4j.php | 2 +- kronolith/lib/Event.php | 2 +- kronolith/lib/tests/fromicalendar.phpt | 8 ++++---- mnemo/data.php | 2 +- mnemo/lib/Api.php | 14 ++++++-------- mnemo/lib/Driver.php | 10 +++++----- nag/data.php | 4 ++-- nag/lib/Api.php | 2 +- nag/lib/Task.php | 12 ++++++------ 14 files changed, 37 insertions(+), 39 deletions(-) diff --git a/framework/Itip/lib/Horde/Itip.php b/framework/Itip/lib/Horde/Itip.php index 521f1f3ae..edb1372f6 100644 --- a/framework/Itip/lib/Horde/Itip.php +++ b/framework/Itip/lib/Horde/Itip.php @@ -68,7 +68,7 @@ class Horde_Itip * @param string $product_id The ID that should be set as * the iCalendar product id. * - * @return Horde_iCalendar The response object. + * @return Horde_Icalendar The response object. */ public function getIcalendarResponse( Horde_Itip_Response_Type $type, diff --git a/framework/Itip/lib/Horde/Itip/Event.php b/framework/Itip/lib/Horde/Itip/Event.php index 6c2e13f3e..f098dda63 100644 --- a/framework/Itip/lib/Horde/Itip/Event.php +++ b/framework/Itip/lib/Horde/Itip/Event.php @@ -32,7 +32,7 @@ interface Horde_Itip_Event /** * Returns the event as vEvent. * - * @return Horde_iCalendar_vevent The wrapped event. + * @return Horde_Icalendar_Vevent The wrapped event. */ public function getVevent(); diff --git a/framework/Itip/lib/Horde/Itip/Response.php b/framework/Itip/lib/Horde/Itip/Response.php index 66074c03b..396042a8e 100644 --- a/framework/Itip/lib/Horde/Itip/Response.php +++ b/framework/Itip/lib/Horde/Itip/Response.php @@ -79,7 +79,7 @@ class Horde_Itip_Response * Return the response as an iCalendar vEvent object. * * @param Horde_Itip_Response_Type $type The response type. - * @param Horde_iCalendar|boolean $vCal The parent container or false if not + * @param Horde_Icalendar|boolean $vCal The parent container or false if not * provided. * * @return Horde_Icalendar_Vevent The response object. diff --git a/framework/Itip/test/Horde/Itip/Integration/ItipTest.php b/framework/Itip/test/Horde/Itip/Integration/ItipTest.php index b7a0ed839..23d3af683 100644 --- a/framework/Itip/test/Horde/Itip/Integration/ItipTest.php +++ b/framework/Itip/test/Horde/Itip/Integration/ItipTest.php @@ -81,8 +81,8 @@ extends PHPUnit_Framework_TestCase public function testForCopiedDurationFromRequestToResponse() { - $vCal = new Horde_iCalendar(); - $inv = Horde_iCalendar::newComponent('VEVENT', $vCal); + $vCal = new Horde_Icalendar(); + $inv = Horde_Icalendar::newComponent('VEVENT', $vCal); $inv->setAttribute('METHOD', 'REQUEST'); $inv->setAttribute('UID', '1'); $inv->setAttribute('SUMMARY', 'Test Invitation'); diff --git a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Cache.php b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Cache.php index bf42cdaf0..f08ca7919 100644 --- a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Cache.php +++ b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Cache.php @@ -279,7 +279,7 @@ class Horde_Kolab_FreeBusy_Cache { * relevant access * parameters. * - * @return Horde_iCalender The remote free/busy information. + * @return Horde_Icalender The remote free/busy information. */ function &_fetchRemote($servers, $access) { @@ -935,7 +935,7 @@ class Horde_Kolab_FreeBusy_Cache_File_pvcal extends Horde_Kolab_FreeBusy_Cache_F /** * Store partial free/busy infomation in the cache file. * - * @param Horde_iCalendar $pvcal A reference to the data object. + * @param Horde_Icalendar $pvcal A reference to the data object. * * @return boolean|PEAR_Error True if successful. */ @@ -949,7 +949,7 @@ class Horde_Kolab_FreeBusy_Cache_File_pvcal extends Horde_Kolab_FreeBusy_Cache_F * * @param boolean $extended Should the extended information be retrieved? * - * @return Horde_iCalendar|PEAR_Error The data retrieved from the cache file. + * @return Horde_Icalendar|PEAR_Error The data retrieved from the cache file. */ function &loadPVcal($extended) { @@ -1030,7 +1030,7 @@ class Horde_Kolab_FreeBusy_Cache_File_vcal extends Horde_Kolab_FreeBusy_Cache_Fi /** * Store free/busy infomation in the cache file. * - * @param Horde_iCalendar $vcal A reference to the data object. + * @param Horde_Icalendar $vcal A reference to the data object. * @param array $mtimes A list of modification times for the * partial free/busy cache times. * @@ -1046,7 +1046,7 @@ class Horde_Kolab_FreeBusy_Cache_File_vcal extends Horde_Kolab_FreeBusy_Cache_Fi /** * Load the free/busy information from the cache. * - * @return Horde_iCalendar|PEAR_Error The retrieved free/busy information. + * @return Horde_Icalendar|PEAR_Error The retrieved free/busy information. */ function &loadVcal() { diff --git a/framework/SyncML/SyncML/Device/Sync4j.php b/framework/SyncML/SyncML/Device/Sync4j.php index b55b47857..ecc6731f3 100644 --- a/framework/SyncML/SyncML/Device/Sync4j.php +++ b/framework/SyncML/SyncML/Device/Sync4j.php @@ -6,7 +6,7 @@ /** Horde_Date */ require_once 'Horde/Date.php'; -/** Horde_iCalendar */ +/** Horde_Icalendar */ require_once 'Horde/Icalendar.php'; /** diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index eb9bc0467..e9cbb9df4 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -513,7 +513,7 @@ abstract class Kronolith_Event /** * Exports this event in iCalendar format. * - * @param Horde_Icalendar $calendar A Horde_iCalendar object that acts as + * @param Horde_Icalendar $calendar A Horde_Icalendar object that acts as * a container. * * @return array An array of Horde_Icalendar_Vevent objects for this event. diff --git a/kronolith/lib/tests/fromicalendar.phpt b/kronolith/lib/tests/fromicalendar.phpt index 9d3b24247..06344b1cb 100644 --- a/kronolith/lib/tests/fromicalendar.phpt +++ b/kronolith/lib/tests/fromicalendar.phpt @@ -21,18 +21,18 @@ require 'Date/Calc.php'; require 'Horde/Date.php'; require 'Horde/Date/Recurrence.php'; require 'Horde/Util.php'; -require 'Horde/iCalendar.php'; +require 'Horde/Icalendar.php'; -$iCal = new Horde_iCalendar(); +$iCal = new Horde_Icalendar(); $iCal->parsevCalendar(file_get_contents(dirname(__FILE__) . '/fromicalendar.ics')); $components = $iCal->getComponents(); -$iCal2 = new Horde_iCalendar(); +$iCal2 = new Horde_Icalendar(); define('KRONOLITH_BASE', dirname(__FILE__) . '/../..'); require KRONOLITH_BASE . '/lib/Kronolith.php'; require KRONOLITH_BASE . '/lib/Driver.php'; foreach ($components as $content) { - if (is_a($content, 'Horde_iCalendar_vevent')) { + if (is_a($content, 'Horde_Icalendar_Vevent')) { $event = new Kronolith_Event(new Driver); $event->fromiCalendar($content); echo $event->start->rfc3339DateTime() . "\n"; diff --git a/mnemo/data.php b/mnemo/data.php index f3bbc5cda..50c9de9f7 100644 --- a/mnemo/data.php +++ b/mnemo/data.php @@ -130,7 +130,7 @@ if (is_array($next_step)) { } /* Check if we need to convert from iCalendar data into an array. */ - if (is_a($row, 'Horde_iCalendar_vnote')) { + if (is_a($row, 'Horde_Icalendar_vnote')) { $row = $storage->fromiCalendar($row); } diff --git a/mnemo/lib/Api.php b/mnemo/lib/Api.php index 2fd70ea91..b0583b4a1 100644 --- a/mnemo/lib/Api.php +++ b/mnemo/lib/Api.php @@ -222,9 +222,8 @@ class Mnemo_Api extends Horde_Registry_Api break; case 'text/x-vnote': - if (!is_a($content, 'Horde_iCalendar_vnote')) { - require_once 'Horde/iCalendar.php'; - $iCal = new Horde_iCalendar(); + if (!is_a($content, 'Horde_Icalendar_Vnote')) { + $iCal = new Horde_Icalendar(); if (!$iCal->parsevCalendar($content)) { return PEAR::raiseError(_("There was an error importing the iCalendar data.")); } @@ -241,7 +240,7 @@ class Mnemo_Api extends Horde_Registry_Api default: $ids = array(); foreach ($components as $content) { - if (is_a($content, 'Horde_iCalendar_vnote')) { + if (is_a($content, 'Horde_Icalendar_Vnote')) { $note = $storage->fromiCalendar($content); $noteId = $storage->add($note['desc'], $note['body'], @@ -316,7 +315,7 @@ class Mnemo_Api extends Horde_Registry_Api require_once 'Horde/iCalendar.php'; // Create the new iCalendar container. - $iCal = new Horde_iCalendar('1.1'); + $iCal = new Horde_Icalendar('1.1'); $iCal->setAttribute('VERSION', '1.1'); $iCal->setAttribute('PRODID', '-//The Horde Project//Mnemo ' . Mnemo::VERSION . '//EN'); $iCal->setAttribute('METHOD', 'PUBLISH'); @@ -397,9 +396,8 @@ class Mnemo_Api extends Horde_Registry_Api return $storage->modify($memo['memo_id'], $storage->getMemoDescription($content), $content, null); case 'text/x-vnote': - if (!is_a($content, 'Horde_iCalendar_vnote')) { - require_once 'Horde/iCalendar.php'; - $iCal = new Horde_iCalendar(); + if (!is_a($content, 'Horde_Icalendar_Vnote')) { + $iCal = new Horde_Icalendar(); if (!$iCal->parsevCalendar($content)) { return PEAR::raiseError(_("There was an error importing the iCalendar data.")); } diff --git a/mnemo/lib/Driver.php b/mnemo/lib/Driver.php index 0d92ee06b..20a7c2ce8 100644 --- a/mnemo/lib/Driver.php +++ b/mnemo/lib/Driver.php @@ -252,15 +252,15 @@ class Mnemo_Driver { * Export this memo in iCalendar format. * * @param array memo the memo (hash array) to export - * @param object vcal a Horde_iCalendar object that acts as container. + * @param object vcal a Horde_Icalendar object that acts as container. * - * @return object Horde_iCalendar_vnote object for this event. + * @return object Horde_Icalendar_Vnote object for this event. */ function toiCalendar($memo, &$calendar) { global $prefs; - $vnote = &Horde_iCalendar::newComponent('vnote', $calendar); + $vnote = Horde_Icalendar::newComponent('vnote', $calendar); $vnote->setAttribute('UID', $memo['uid']); $vnote->setAttribute('BODY', $memo['body']); @@ -298,9 +298,9 @@ class Mnemo_Driver { } /** - * Create a memo (hash array) from a Horde_iCalendar_vnote object. + * Create a memo (hash array) from a Horde_Icalendar_Vnote object. * - * @param Horde_iCalendar_vnote $vnote The iCalendar data to update from. + * @param Horde_Icalendar_Vnote $vnote The iCalendar data to update from. * * @return array Memo (hash array) created from the vNote. */ diff --git a/nag/data.php b/nag/data.php index 72d9ff5a8..c0da90e88 100644 --- a/nag/data.php +++ b/nag/data.php @@ -117,7 +117,7 @@ case 'export': exit; case Horde_Data::EXPORT_ICALENDAR: - $iCal = new Horde_iCalendar(); + $iCal = new Horde_Icalendar(); $iCal->setAttribute( 'PRODID', '-//The Horde Project//Nag ' . $registry->getVersion() . '//EN'); @@ -176,7 +176,7 @@ if (is_array($next_step)) { } if (!is_array($row)) { - if (!is_a($row, 'Horde_iCalendar_vtodo')) { + if (!is_a($row, 'Horde_Icalendar_Vtodo')) { continue; } $task = new Nag_Task(); diff --git a/nag/lib/Api.php b/nag/lib/Api.php index 09cff9f69..271aa2730 100644 --- a/nag/lib/Api.php +++ b/nag/lib/Api.php @@ -784,7 +784,7 @@ class Nag_Api extends Horde_Registry_Api $ids = array(); foreach ($components as $content) { - if ($content instanceof Horde_iCalendar_vtodo) { + if ($content instanceof Horde_Icalendar_Vtodo) { $task = new Nag_Task(); $task->fromiCalendar($content); if (isset($task->uid) && diff --git a/nag/lib/Task.php b/nag/lib/Task.php index 5fca4eaa2..8f30de6b1 100644 --- a/nag/lib/Task.php +++ b/nag/lib/Task.php @@ -783,14 +783,14 @@ class Nag_Task { /** * Exports this task in iCalendar format. * - * @param Horde_iCalendar $calendar A Horde_iCalendar object that acts as + * @param Horde_Icalendar $calendar A Horde_Icalendar object that acts as * the container. * - * @return Horde_iCalendar_vtodo A vtodo component of this task. + * @return Horde_Icalendar_Vtodo A vtodo component of this task. */ function toiCalendar($calendar) { - $vTodo = Horde_iCalendar::newComponent('vtodo', $calendar); + $vTodo = Horde_Icalendar::newComponent('vtodo', $calendar); $v1 = $calendar->getAttribute('VERSION') == '1.0'; $vTodo->setAttribute('UID', $this->uid); @@ -830,7 +830,7 @@ class Nag_Task { if ($v1) { $vTodo->setAttribute('AALARM', $this->due - $this->alarm * 60); } else { - $vAlarm = Horde_iCalendar::newComponent('valarm', $vTodo); + $vAlarm = Horde_Icalendar::newComponent('valarm', $vTodo); $vAlarm->setAttribute('ACTION', 'DISPLAY'); $vAlarm->setAttribute('TRIGGER;VALUE=DURATION', '-PT' . $this->alarm . 'M'); $vTodo->addComponent($vAlarm); @@ -935,9 +935,9 @@ class Nag_Task { } /** - * Creates a task from a Horde_iCalendar_vtodo object. + * Creates a task from a Horde_Icalendar_Vtodo object. * - * @param Horde_iCalendar_vtodo $vTodo The iCalendar data to update from. + * @param Horde_Icalendar_Vtodo $vTodo The iCalendar data to update from. */ function fromiCalendar($vTodo) { -- 2.11.0