public static function unsubscribeRemoteCalendar($url)
{
$url = trim($url);
if (!strlen($url)) {
return false;
}
$remote_calendars = unserialize($GLOBALS['prefs']->getValue('remote_cals'));
$remote_calendar = null;
foreach ($remote_calendars as $key => $calendar) {
if ($calendar['url'] == $url) {
$remote_calendar = $calendar;
unset($remote_calendars[$key]);
break;
}
}
if (!$remote_calendar) {
throw new Kronolith_Exception(_("The remote calendar was not found."));
}
$GLOBALS['prefs']->setValue('remote_cals', serialize($remote_calendars));
return $remote_calendar;
}