aboutsummaryrefslogtreecommitdiffstats
path: root/functions/template.php
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-26 16:59:10 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-26 16:59:10 +0000
commita02ca8fd76dfa6b0f280780f76fb9bfce5a9fd36 (patch)
treecd5c150b2490fdcb9503f4aa581dff868cf9170b /functions/template.php
parentae9ce41d6df68ed6449f296dd8af48590d27157d (diff)
downloadphpicalendar-a02ca8fd76dfa6b0f280780f76fb9bfce5a9fd36.tar.gz
phpicalendar-a02ca8fd76dfa6b0f280780f76fb9bfce5a9fd36.tar.bz2
phpicalendar-a02ca8fd76dfa6b0f280780f76fb9bfce5a9fd36.zip
eliminate negative event lengths and adjust display lengths for short events
Diffstat (limited to 'functions/template.php')
-rw-r--r--functions/template.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/functions/template.php b/functions/template.php
index 4df442c..bf4f340 100644
--- a/functions/template.php
+++ b/functions/template.php
@@ -359,7 +359,6 @@ class Page {
$key = mktime($regs_tmp[1],$regs_tmp[2],0,$this_month,$this_day,$this_year);
$key = date ($timeFormat, $key);
-
if (ereg("([0-9]{1,2}):00", $key)) {
$weekdisplay .= '<tr>';
$weekdisplay .= '<td colspan="4" rowspan="' . (60 / $phpiCal_config->gridLength) . '" align="center" valign="top" width="60" class="timeborder">'.$key.'</td>';
@@ -466,11 +465,14 @@ class Page {
$confirmed .= '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" />&nbsp;';
}
$colspan_width = round((80 / $nbrGridCols[$thisday]) * $drawWidth);
+ $event_temp = $loop_event;
+ $event = openevent($thisday, $cal_time, $uid, $this_time_arr[$uid], $phpiCal_config->week_events_lines, 25, 'ps');
+ # adjust length by rough guess to word wrapping
+ $event_text_lines = ceil((strlen(strip_tags(trim($event))) * 8)/$colspan_width) + 1;
+ if ($event_length[$thisday][$i]['length'] < $event_text_lines) $event_length[$thisday][$i]['length'] = $event_text_lines;
$weekdisplay .= '<td width="'.$colspan_width.'" rowspan="' . $event_length[$thisday][$i]['length'] . '" colspan="' . $drawWidth . '" align="left" valign="top" class="eventbg2_'.$event_calno.'">'."\n";
// Start drawing the event
- $event_temp = $loop_event;
- $event = openevent($thisday, $cal_time, $uid, $this_time_arr[$uid], $phpiCal_config->week_events_lines, 25, 'ps');
$event_temp = str_replace('{EVENT}', $event, $event_temp);
$event_temp = str_replace('{EVENT_START}', $event_start, $event_temp);
$event_temp = str_replace('{CONFIRMED}', $confirmed, $event_temp);

© 2014-2024 Faster IT GmbH | imprint | privacy policy