Document all possible json event properties.
authorJan Schneider <jan@horde.org>
Tue, 16 Jun 2009 14:28:37 +0000 (16:28 +0200)
committerJan Schneider <jan@horde.org>
Tue, 16 Jun 2009 14:28:37 +0000 (16:28 +0200)
kronolith/js/src/kronolith.js
kronolith/lib/Event.php
kronolith/lib/Event/Horde.php

index ee554ae..b2dbc63 100644 (file)
@@ -1188,10 +1188,9 @@ KronolithCore = {
 
     _setEventText: function(div, event)
     {
-        if (event.icn) {
-            div.insert(new Element('IMG', { 'src': event.icn }));
+        if (event.ic) {
+            div.insert(new Element('IMG', { 'src': event.ic }));
         }
-
         div.insert(event.t);
         if (event.a) {
             div.insert(' ')
index 5544d26..4a91f00 100644 (file)
@@ -1001,6 +1001,30 @@ abstract class Kronolith_Event
      * Returns a simple object suitable for json transport representing this
      * event.
      *
+     * Possible properties are:
+     * - t: title
+     * - c: calendar id
+     * - s: start date
+     * - e: end date
+     * - x: status (Kronolith::STATUS_* constant)
+     * - al: all-day?
+     * - bg: background color
+     * - fg: foreground color
+     * - pe: edit permissions?
+     * - pd: delete permissions?
+     * - a: alarm text
+     * - r: recurrence type (Horde_Date_Recurrence::RECUR_* constant)
+     * - ic: icon
+     * - ln: link
+     * - id: event id
+     * - ty: calendar type (driver)
+     * - l: location
+     * - sd: formatted start date
+     * - st: formatted start time
+     * - ed: formatted end date
+     * - et: formatted end time
+     * - tg: tag list
+     *
      * @param boolean $allDay      If not null, overrides whether the event is
      *                             an all-day event.
      * @param boolean $full        Whether to return all event details.
index a1ba6be..f9fc87d 100644 (file)
@@ -84,10 +84,10 @@ class Kronolith_Event_Horde extends Kronolith_Event
     public function toJson($allDay = null, $full = false, $time_format = 'H:i')
     {
         $json = parent::toJson($allDay, $full, $time_format);
-        $json->icn = $this->external_icon;
+        $json->ic = $this->external_icon;
         // @TODO: What is expected for external calendar links? This is currently
         // broken in the UI.
-        //$json->link = $this->getLink();
+        //$json->ln = $this->getLink();
         return $json;
     }