--- /dev/null
+<?php
+/**
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Jan Schneider <jan@horde.org>
+ */
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('kronolith');
+
+$calendar = Horde_Util::getFormData('calendar');
+$url = Horde::url('', true);
+if (Kronolith::showAjaxView()) {
+ $url->setAnchor('calendar:internal|' . $calendar);
+} else {
+ $url->setAnchor('calendar:' . $calendar);
+ if (!in_array($display_calendars, $calendar)) {
+ $url->add('toggle_calendar', $calendar);
+ }
+}
+$url->redirect();
'fg' => $calendar->foreground(),
'bg' => $calendar->background(),
'show' => false,
- 'perms' => Kronolith::permissionToJson($calendar->permission()),
'edit' => $calendar->hasPermission(Horde_Perms::EDIT),
'tg' => array_values($tagger->getTags($this->_vars->cal, 'calendar')));
return $result;
$perm->removeCreatorPermission(Kronolith::PERMS_DELEGATE, false);
}
+ // Build subscription link if necessary.
+ $subscription = $sublink = '';
+ if ($GLOBALS['conf']['share']['hidden']) {
+ $sublink = Horde::url('calendars/subscribe.php', true)->add('calendar', $share->getName());
+ $subscription = "\n"
+ . _("To subscribe to this calendar, you need to click the following link:")
+ . ' ' . $sublink;
+ }
+
// Process user permissions.
$u_names = Horde_Util::getFormData('u_names');
$u_show = Horde_Util::getFormData('u_show');
->create($user)
->getDefaultFromAddress(true);
try {
- $message = Horde::callHook('shareUserNotification', array($user, $share));
+ $message = Horde::callHook('shareUserNotification', array($user, $share, $sublink));
} catch (Horde_Exception_HookNotSet $e) {
$message = sprintf(_("%s has given you access to \"%s\"."),
$userName,
- $share->get('name'));
+ $share->get('name'))
+ . $subscription;
}
$mail->addHeader('To', $to, 'UTF-8', false);
$mail->setBody($message, 'UTF-8');
$groupOb = $GLOBALS['injector']->getInstance('Horde_Group')->getGroupById($group);
if (!empty($groupOb->data['email'])) {
try {
- $message = Horde::callHook('shareGroupNotification', array($group, $share));
+ $message = Horde::callHook('shareGroupNotification', array($group, $share, $sublink));
} catch (Horde_Exception_HookNotSet $e) {
$message = sprintf(_("%s has given your group \"%s\" access to \"%s\"."),
$userName,
$groupOb->getName(),
- $share->get('name'));
+ $share->get('name'))
+ . $subscription;
}
$mail->addHeader('To', $groupOb->getName() . ' <' . $groupOb->data['email'] . '>', 'UTF-8', false);
$mail->setBody($message, 'UTF-8');