From: Jan Schneider Date: Fri, 9 Apr 2010 15:49:40 +0000 (+0100) Subject: Display subscription URLs. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=618d8d393d168b0380d01bd95ce8fe50739843c3;p=horde.git Display subscription URLs. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 7bf4aa3fb..1d9e2fe5a 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2367,6 +2367,7 @@ KronolithCore = { $('kronolithC' + type + 'PAdvanced').select('tr').findAll(function(tr) { return tr.retrieve('remove'); }).invoke('remove'); + $('kronolithCalendar' + type + 'Urls').hide(); } var newCalendar = !calendar; @@ -2428,6 +2429,9 @@ KronolithCore = { } else { $('kronolithCalendar' + type + 'LinkImport').up('li').hide(); } + $('kronolithCalendar' + type + 'UrlFeed') + .writeAttribute('href', info.feed) + .update(info.feed.escapeHTML()); // Fall through. case 'tasklists': $('kronolithCalendar' + type + 'Description').setValue(info.desc); @@ -2435,6 +2439,10 @@ KronolithCore = { $('kronolithCalendar' + type + 'Export').href = type == 'internal' ? Kronolith.conf.URI_CALENDAR_EXPORT + '=' + calendar : Kronolith.conf.tasks.URI_TASKLIST_EXPORT + '=' + calendar.substring(6); + $('kronolithCalendar' + type + 'Urls').show(); + $('kronolithCalendar' + type + 'UrlSub') + .writeAttribute('href', info.sub) + .update(info.sub.escapeHTML()); break; case 'remote': $('kronolithCalendarremoteUrl').setValue(calendar); diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index b531df23c..6d2cfe8fe 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -240,6 +240,9 @@ class Kronolith $code['conf']['tasks'] = $registry->tasks->ajaxDefaults(); } + $subscriptionCals = Horde::url($registry->get('webroot', 'horde') . ($GLOBALS['conf']['urls']['pretty'] == 'rewrite' ? '/rpc/kronolith/' : '/rpc.php/kronolith/'), true, -1); + $subscriptionTasks = Horde::url($registry->get('webroot', 'horde') . ($GLOBALS['conf']['urls']['pretty'] == 'rewrite' ? '/rpc/nag/' : '/rpc.php/nag/'), true, -1); + // Calendars foreach (array(true, false) as $my) { foreach ($GLOBALS['all_calendars'] as $id => $calendar) { @@ -261,6 +264,8 @@ class Kronolith 'show' => in_array($id, $GLOBALS['display_calendars']), 'perms' => $calendar->getPermission()->data, 'edit' => $calendar->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT), + 'sub' => $subscriptionCals . ($calendar->get('owner') ? $calendar->get('owner') : '-system-') . '/' . $calendar->getName() . '.ics', + 'feed' => (string)Kronolith::feedUrl($calendar->getName()), 'tg' => array_values($tagger->getTags($calendar->getName(), 'calendar'))); } } @@ -287,7 +292,8 @@ class Kronolith 'bg' => self::backgroundColor($tasklist), 'show' => in_array('tasks/' . $id, $GLOBALS['display_external_calendars']), 'perms' => $tasklist->getPermission()->data, - 'edit' => $tasklist->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)); + 'edit' => $tasklist->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT), + 'sub' => $subscriptionTasks . ($tasklist->get('owner') ? $tasklist->get('owner') : '-system-') . '/' . $tasklist->getName() . '.ics'); } } } diff --git a/kronolith/templates/chunks/calendar.php b/kronolith/templates/chunks/calendar.php index c464c55d4..30713a807 100644 --- a/kronolith/templates/chunks/calendar.php +++ b/kronolith/templates/chunks/calendar.php @@ -41,6 +41,17 @@ $file_upload = $GLOBALS['browser']->allowFileUploads(); + +
+ +