From: Michael J. Rubinsky Date: Wed, 2 Sep 2009 17:19:03 +0000 (-0400) Subject: Store the value of display_cal parameter in the session. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=20bfe432dca165b68d45fd817c69a83fbd28cd0b;p=horde.git Store the value of display_cal parameter in the session. This makes display_cal do what it was originally inteneded to do. Does not update user prefs (that's what toggle_calendar is for), but just makes sure that ONLY the calendar(s) in the parameter are displayed. Must pass an empty value for display_cal to clear the session value. Still need to work out how to trigger the emptying of the value...probably will replace the calendar panel with a 'close' link or similar when the session variable contains data. This also solves the issue of dealing with the user changing the calendars displayed via the panel while showing only display_cal. --- diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 000039812..39bb89df2 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -695,11 +695,20 @@ class Kronolith /* Update preferences for which calendars to display. If the * user doesn't have any selected calendars to view then fall - * back to an available calendar. */ + * back to an available calendar. An empty string passed in this + * parameter will clear any existing session value.*/ if (($calendarId = Horde_Util::getFormData('display_cal')) !== null) { + $_SESSION['kronolith']['display_cal'] = $calendarId; + } + if (!empty($_SESSION['kronolith']['display_cal'])) { + /* Specifying a value for display_cal is always to make sure + * that only the specified calendars are shown. Use the + * "toggle_calendar" argument to toggle the state of a single + * calendar. */ $GLOBALS['display_calendars'] = array(); $GLOBALS['display_remote_calendars'] = array(); $GLOBALS['display_external_calendars'] = array(); + $calendarId = $_SESSION['kronolith']['display_cal']; if (is_array($calendarId)) { $calendars = $calendarId; foreach ($calendars as $calendarId) {