Add icons to shared calendars.
authorJan Schneider <jan@horde.org>
Wed, 19 May 2010 15:55:12 +0000 (17:55 +0200)
committerJan Schneider <jan@horde.org>
Wed, 19 May 2010 17:28:10 +0000 (19:28 +0200)
kronolith/js/kronolith.js
kronolith/lib/Kronolith.php

index 8d5024b..d5cc6b6 100644 (file)
@@ -993,7 +993,7 @@ KronolithCore = {
      */
     insertCalendarInList: function(type, id, cal, div)
     {
-        var noItems;
+        var noItems, calendar;
         if (!div) {
             div = this.getCalendarList(type, cal.owner);
         }
@@ -1007,11 +1007,20 @@ KronolithCore = {
             div.insert(new Element('span', { className: 'kronolithCalEdit' })
                    .insert('&#9658;'));
         }
-        div.insert(new Element('div', { className: cal.show ? 'kronolithCalOn' : 'kronolithCalOff' })
-               .store('calendar', id)
-               .store('calendarclass', type)
-               .setStyle({ backgroundColor: cal.bg, color: cal.fg })
-               .update(cal.name.escapeHTML()));
+        calendar = new Element('div', { className: cal.show ? 'kronolithCalOn' : 'kronolithCalOff' })
+            .store('calendar', id)
+            .store('calendarclass', type)
+            .setStyle({ backgroundColor: cal.bg, color: cal.fg })
+            .insert(cal.name.escapeHTML());
+        if (cal.perms) {
+            $H(cal.perms).each(function(perm) {
+                if (perm.key != 'type' && perm.value) {
+                    calendar.insert(' ').insert(new Element('img', { src: Kronolith.conf.URI_IMG + 'attendees-' + cal.fg.substring(1) + '.png', title: Kronolith.text.shared }));
+                    throw $break;
+                }
+            });
+        }
+        div.insert(calendar);
     },
 
     /**
index e5800f3..82ba11a 100644 (file)
@@ -354,6 +354,7 @@ class Kronolith
             'allday' => _("All day"),
             'more' => _("more..."),
             'prefs' => _("Options"),
+            'shared' => _("Shared"),
             'no_url' => _("You must specify a URL."),
             'wrong_auth' => _("The authentication information you specified wasn't accepted."),
             'geocode_error' => _("Unable to locate requested address"),