From: David F. <da...@d2...> - 2005-05-05 19:54:15
|
Attached is a borderline-2.0 worthy cleanup of openevent/event.php. It simplifies the function by changing the data-passing to use the date/time/uid to then lookup the event info in $master_array in event.php, instead of passing the raw data. It's possibly a precursor to even more cleanup of that whole process, by turning the popups into simple links instead of using the hidden form to pass data around. Note this assumes that the UIDs are unique across calendars, which seems to be a valid assumption given how $master_array is structured (if it's a bogus assumption, then events with the same $uid are going to be overwriting each other anyways). If this is valid, I should also clean up how todo.php works (amusingly, in a totally different fashion, using a base64-encoded get string. lends more validity to "the right way" being removing the hidden form stuff completely, but it's a big enough structure change I want to make sure there wasn't some other valid reason I just don't know about for doing it). This patch also fixes an actual bug - the event.php popup should have had the title be "$calname $lang['l_calendar']" - i.e., "US Holidays Calendar" - it was using the old translation syntax, and thus was just showing up as "US Holidays". Actually, this is probably worth going into 2.0, as I realized it's a decently-smaller HTML render, as now all the event info isn't included in the page for every event (twice). called openevent.patch look, diffstat says it's good! :) davef@rake-l:phpicalendar-working 539 > diffstat openevent.patch functions/date_functions.php | 38 ++++------- functions/draw_functions.php | 2 functions/event.js | 30 ++------ functions/ical_parser.php | 14 ++-- functions/template.php | 148 ++++++++++++++++++------------------------- includes/event.php | 45 +++++-------- templates/default/event.tpl | 2 templates/default/header.tpl | 15 +--- 8 files changed, 118 insertions(+), 176 deletions(-) I'm also working on a post-2.0 enhancement that adds human-readable recurrence info to event.php. Cool feature, needs a decent amount more work to support all the various ways recurrence info could exist. I stuck the function that does this in ical_parser.php, which probably isn't right. Please let me know if you'd like to see the work-in-progress. dave |