From ff282bb3251f1cf038154e8aa4603ec9a659bd54 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 19 May 2010 17:55:12 +0200 Subject: [PATCH] Add icons to shared calendars. --- kronolith/js/kronolith.js | 21 +++++++++++++++------ kronolith/lib/Kronolith.php | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 8d5024b25..d5cc6b6ff 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -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('►')); } - 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); }, /** diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index e5800f387..82ba11ae1 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -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"), -- 2.11.0