Add code for embedding on the calendar edit dialog
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 25 Jun 2010 21:02:19 +0000 (17:02 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 25 Jun 2010 21:02:19 +0000 (17:02 -0400)
kronolith/js/kronolith.js
kronolith/lib/Kronolith.php
kronolith/templates/chunks/calendar.php

index fd8ccae..3c54fdf 100644 (file)
@@ -2846,6 +2846,7 @@ KronolithCore = {
                     $('kronolithCalendar' + type + 'LinkImport').up('li').hide();
                 }
                 $('kronolithCalendar' + type + 'UrlFeed').setValue(info.feed);
+                $('kronolithCalendar' + type + 'EmbedUrl').setValue(info.embed);
                 // Fall through.
             case 'tasklists':
                 $('kronolithCalendar' + type + 'Description').setValue(info.desc);
index f3d8c48..280e19b 100644 (file)
@@ -270,6 +270,7 @@ class Kronolith
                         'edit' => $calendar->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::EDIT),
                         'sub' => $subscriptionCals . ($calendar->get('owner') ? $calendar->get('owner') : '-system-') . '/' . $calendar->getName() . '.ics',
                         'feed' => (string)Kronolith::feedUrl($calendar->getName()),
+                        'embed' => self::embedCode($id),
                         'tg' => array_values($tagger->getTags($calendar->getName(), 'calendar')));
                     if ($owner) {
                         $code['conf']['calendars']['internal'][$id]['perms'] = self::permissionToJson($calendar->getPermission());
index 4841000..3901ccc 100644 (file)
@@ -87,6 +87,11 @@ $file_upload = $GLOBALS['browser']->allowFileUploads();
       <span class="kronolithSeparator">&mdash; <?php echo _("Subscribe from a feed reader") ?></span><br />
       <input type="text" id="kronolithCalendarinternalUrlFeed" class="kronolithLongField" onfocus="this.select()" /><br />
     </div>
+    <div>
+      <label for="kronolithCalendarinternalEmbedUrl"><?php echo _("Embed Script") ?></label>
+      <span class="kronolithSeparator">&mdash; <?php echo _("Embed calendar on external website") ?></span><br />
+      <input type="text" id="kronolithCalendarinternalEmbedUrl" class="kronolithLongField" onfocus="this.select()" /><br />
+    </div>
   </div>
 </div>