From: Jan Schneider Date: Fri, 13 Mar 2009 14:20:45 +0000 (+0100) Subject: Show timeObjects. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=55dfcfc322a4188c11532a5ae73d21466c53d3c7;p=horde.git Show timeObjects. --- diff --git a/kronolith/js/src/kronolith.js b/kronolith/js/src/kronolith.js index d3bcaaf30..e69180817 100644 --- a/kronolith/js/src/kronolith.js +++ b/kronolith/js/src/kronolith.js @@ -461,11 +461,10 @@ KronolithCore = { */ updateCalendarList: function() { - var internal = $H(Kronolith.conf.calendars.internal), - remote = $H(Kronolith.conf.calendars.remote), - my = 0, shared = 0, div; + var my = 0, shared = 0, ext = {}, extNames = {}, + remote, api, div; - internal.each(function(cal) { + $H(Kronolith.conf.calendars.internal).each(function(cal) { if (cal.value.owner) { my++; div = $('kronolithMyCalendars'); @@ -486,6 +485,30 @@ KronolithCore = { $('kronolithSharedCalendars').hide(); } + $H(Kronolith.conf.calendars.external).each(function(cal) { + api = cal.key.split('/'); + if (typeof ext[api[0]] == 'undefined') { + ext[api[0]] = {}; + } + ext[api[0]][api[1]] = cal.value; + extNames[api[0]] = cal.value.api; + }); + $H(ext).each(function(api) { + $('kronolithExternalCalendars') + .insert(new Element('H3') + .insert(new Element('A', { 'class': 'kronolithAdd' }) + .update('+')) + .insert({ bottom: extNames[api.key] })) + .insert(new Element('DIV', { 'id': 'kronolithExternalCalendar' + api.key, 'class': 'kronolithCalendars' })); + $H(api.value).each(function(cal) { + $('kronolithExternalCalendar' + api.key) + .insert(new Element('DIV', { 'calendar': api.key + '/' + cal.key, 'calendarclass': 'external', 'class': cal.value.show ? 'kronolithCalOn' : 'kronolithCalOff' }) + .setStyle({ backgroundColor: cal.value.bg, color: cal.value.fg }) + .update(cal.value.name)); + }); + }); + + remote = $H(Kronolith.conf.calendars.remote); remote.each(function(cal) { $('kronolithRemoteCalendars').appendChild(new Element('DIV', { 'calendar': cal.key, 'calendarclass': 'remote', 'class': cal.value.show ? 'kronolithCalOn' : 'kronolithCalOff' }).setStyle({ backgroundColor: cal.value.bg, color: cal.value.fg }).update(cal.value.name)); }); diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 0c3d4fe5f..984c462f8 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -161,6 +161,8 @@ class Kronolith $calendar = $api . '/' . $id; $code['conf']['calendars']['external'][$calendar] = array( 'name' => $name, + 'fg' => '#000', + 'bg' => '#ddd', 'api' => $GLOBALS['registry']->get('name', $GLOBALS['registry']->hasInterface($api)), 'show' => in_array($calendar, $GLOBALS['display_external_calendars'])); } diff --git a/kronolith/templates/index/index.inc b/kronolith/templates/index/index.inc index f3dc11526..2bf9fdaa9 100644 --- a/kronolith/templates/index/index.inc +++ b/kronolith/templates/index/index.inc @@ -62,6 +62,8 @@ +
+

+