diff options
author | Jason Oster <parasytic@users.sourceforge.net> | 2009-05-14 21:45:44 +0000 |
---|---|---|
committer | Jason Oster <parasytic@users.sourceforge.net> | 2009-05-14 21:45:44 +0000 |
commit | 3a4d086ec1d1b6a89d0b0f8ed6018d2080ca9f82 (patch) | |
tree | d291770d55cc87515c5bee76532151a3880a8a59 | |
parent | e20689a1388a3da61d57e566ea2529e53f27620f (diff) | |
download | phpicalendar-3a4d086ec1d1b6a89d0b0f8ed6018d2080ca9f82.tar.gz phpicalendar-3a4d086ec1d1b6a89d0b0f8ed6018d2080ca9f82.tar.bz2 phpicalendar-3a4d086ec1d1b6a89d0b0f8ed6018d2080ca9f82.zip |
Fix table column spanning and HTML errors in week view
-rw-r--r-- | functions/template.php | 11 | ||||
-rw-r--r-- | templates/default/day.tpl | 2 | ||||
-rw-r--r-- | templates/default/default.css | 1 | ||||
-rw-r--r-- | templates/default/week.tpl | 14 | ||||
-rw-r--r-- | templates/green/day.tpl | 2 | ||||
-rw-r--r-- | templates/green/default.css | 1 | ||||
-rw-r--r-- | templates/grey/day.tpl | 2 | ||||
-rw-r--r-- | templates/grey/default.css | 1 | ||||
-rw-r--r-- | templates/red/day.tpl | 2 | ||||
-rw-r--r-- | templates/red/default.css | 1 | ||||
-rw-r--r-- | templates/tan/day.tpl | 2 | ||||
-rw-r--r-- | templates/tan/default.css | 1 |
12 files changed, 21 insertions, 19 deletions
diff --git a/functions/template.php b/functions/template.php index 42cf1f5..a7f183c 100644 --- a/functions/template.php +++ b/functions/template.php @@ -348,7 +348,7 @@ class Page { $weekreplace .= $replace; } */ - $this->page = preg_replace('!<\!-- loop alldaysofweek on -->.*<\!-- loop alldaysofweek off -->!Uis', $weekreplace, $this->page); + $this->page = preg_replace('!<\!-- loop allday row on -->.*<\!-- loop allday row off -->!Uis', $weekreplace, $this->page); // Replaces the daysofweek preg_match("!<\!-- loop daysofweek on -->(.*)<\!-- loop daysofweek off -->!Uis", $this->page, $match1); @@ -461,8 +461,7 @@ class Page { $dayborder = 0; } $drawWidth = 1; - $colspan_width = round((80 / $nbrGridCols[$thisday]) * $drawWidth); - $weekdisplay .= '<td width="' . $colspan_width . '" colspan="' . $nbrGridCols[$thisday] . '" ' . $class . '> </td>'."\n"; + $weekdisplay .= '<td colspan="' . $nbrGridCols[$thisday] . '" ' . $class . '> </td>'."\n"; } else { # have events $emptyWidth = $nbrGridCols[$thisday]; @@ -490,10 +489,9 @@ class Page { if ($event_status != '') { $confirmed .= '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; } - $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'); - $weekdisplay .= '<td width="'.$colspan_width.'" rowspan="' . $event_length[$thisday][$i]['length'] . '" colspan="' . $drawWidth . '" align="left" valign="top" class="eventbg2_'.$event_calno.'">'."\n"; + $weekdisplay .= '<td rowspan="' . $event_length[$thisday][$i]['length'] . '" colspan="' . $drawWidth . '" align="left" valign="top" class="eventbg2_'.$event_calno.'">'."\n"; // Start drawing the event $event_temp = str_replace('{EVENT}', $event, $event_temp); @@ -704,8 +702,7 @@ class Page { $confirmed = ''; if (is_array($event_recur)) $confirmed .= '<img src="images/recurring.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; if ($event_status != '') $confirmed .= '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; - $colspan_width = round((460 / $nbrGridCols) * $drawWidth); - $daydisplay .= '<td rowspan="' . $event_length[$i]['length'] . '" width="'.$colspan_width.'" colspan="' . $drawWidth . '" align="left" valign="top" class="eventbg2_'.$event_calno.'">'."\n"; + $daydisplay .= '<td rowspan="' . $event_length[$i]['length'] . '" colspan="' . $drawWidth . '" align="left" valign="top" class="eventbg2_'.$event_calno.'">'."\n"; // Start drawing the event $event_temp = $loop_event; diff --git a/templates/default/day.tpl b/templates/default/day.tpl index a1db506..c66d40f 100644 --- a/templates/default/day.tpl +++ b/templates/default/day.tpl @@ -24,7 +24,7 @@ </tr> <tr> <td colspan="2"> - <table width="100%" border="0" cellspacing="0" cellpadding="2"> + <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tfixed"> <tr> <td align="left" valign="top" width="20" class="rowOff2" onmouseover="this.className='rowOn2'" onmouseout="this.className='rowOff2'" onclick="window.location.href='day.php?cal={CAL}&getdate={PREV_DAY}'"> <span class="V12"><a class="psf" href="day.php?cal={CAL}&getdate={PREV_DAY}">«</a></span> diff --git a/templates/default/default.css b/templates/default/default.css index 857b998..65ac720 100644 --- a/templates/default/default.css +++ b/templates/default/default.css @@ -72,6 +72,7 @@ table, td {font: 11px Verdana, Arial, sans-serif; color: #000;} .eventborder { background-image: url(images/day_title.gif); border: 1px #006699 solid; }
.eventbg { background-color: #6699CC; }
+.tfixed { table-layout: fixed; } .calborder { background-color: #fff; border: 1px #A1A5A9 solid; }
.dateback { background-color: #eee; }
.weekborder { border-top: 1px dashed #A1A5A9; border-right: 1px solid #A1A5A9; }
diff --git a/templates/default/week.tpl b/templates/default/week.tpl index 375b180..e84632c 100644 --- a/templates/default/week.tpl +++ b/templates/default/week.tpl @@ -2,13 +2,13 @@ <center> <table border="0" width="770" cellspacing="0" cellpadding="0"> <tr> - <td width="610" valign="top"> - <table width="610" border="0" cellspacing="0" cellpadding="0" class="calborder"> + <td valign="top"> + <table border="0" cellspacing="0" cellpadding="0" class="calborder"> <tr> <td align="center" valign="middle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> - <td align="left" width="490" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span></td> + <td align="left" class="title"><h1>{DISPLAY_DATE}</h1><span class="V9G">{CALENDAR_NAME} {L_CALENDAR}</span></td> <td valign="top" align="right" width="120" class="navback"> <div style="padding-top: 3px;"> <table width="120" border="0" cellpadding="0" cellspacing="0"> @@ -30,7 +30,7 @@ <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B"> <tr> <td align="center" valign="top"> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tfixed"> <tr> <td align="left" valign="top" width="15" class="rowOff2" onmouseover="this.className='rowOn2'" onmouseout="this.className='rowOff2'" onclick="window.location.href='week.php?cal={CAL}&getdate={PREV_WEEK}'"> <div class="V12"> <a class="psf" href="week.php?cal={CAL}&getdate={PREV_WEEK}">«</a></div> @@ -46,7 +46,7 @@ </td> <td width="1"></td> <!-- loop daysofweek on --> - <td width="80" {COLSPAN} align="center" class="{ROW1}" onmouseover="this.className='{ROW2}'" onmouseout="this.className='{ROW3}'" onclick="window.location.href='week.php?cal={CAL}&getdate={DAYLINK}'"> + <td {COLSPAN} align="center" class="{ROW1}" onmouseover="this.className='{ROW2}'" onmouseout="this.className='{ROW3}'" onclick="window.location.href='week.php?cal={CAL}&getdate={DAYLINK}'"> <a class="ps3" href="day.php?cal={CAL}&getdate={DAYLINK}"><span class="V9BOLD">{DAY}</span></a> </td> <!-- loop daysofweek off --> @@ -56,11 +56,11 @@ <td width="60" class="rowOff2" colspan="4"><img src="images/spacer.gif" width="60" height="1" alt=" " /></td> <td width="1"></td> <!-- loop alldaysofweek on --> - <td width="80" {COLSPAN} class="rowOff"> + <td {COLSPAN} class="rowOff"> <!-- loop allday on --> <div class="alldaybg_{CALNO}"> {ALLDAY} - <img src="images/spacer.gif" width="80" height="1" alt=" " /> + <img src="images/spacer.gif" width="1" height="1" alt=" " /> </div> <!-- loop allday off --> </td> diff --git a/templates/green/day.tpl b/templates/green/day.tpl index a1db506..c66d40f 100644 --- a/templates/green/day.tpl +++ b/templates/green/day.tpl @@ -24,7 +24,7 @@ </tr> <tr> <td colspan="2"> - <table width="100%" border="0" cellspacing="0" cellpadding="2"> + <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tfixed"> <tr> <td align="left" valign="top" width="20" class="rowOff2" onmouseover="this.className='rowOn2'" onmouseout="this.className='rowOff2'" onclick="window.location.href='day.php?cal={CAL}&getdate={PREV_DAY}'"> <span class="V12"><a class="psf" href="day.php?cal={CAL}&getdate={PREV_DAY}">«</a></span> diff --git a/templates/green/default.css b/templates/green/default.css index 9626f6e..96c47f0 100644 --- a/templates/green/default.css +++ b/templates/green/default.css @@ -92,6 +92,7 @@ table, td {font: 11px Verdana, Arial, sans-serif; color: #000;} .eventbg { background-color: #339933; }
+.tfixed { table-layout: fixed; } .calborder { background-color: #ffffff; border: 1px #A1A5A9 solid; }
.dateback { background-color: #eee; }
diff --git a/templates/grey/day.tpl b/templates/grey/day.tpl index a1db506..c66d40f 100644 --- a/templates/grey/day.tpl +++ b/templates/grey/day.tpl @@ -24,7 +24,7 @@ </tr> <tr> <td colspan="2"> - <table width="100%" border="0" cellspacing="0" cellpadding="2"> + <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tfixed"> <tr> <td align="left" valign="top" width="20" class="rowOff2" onmouseover="this.className='rowOn2'" onmouseout="this.className='rowOff2'" onclick="window.location.href='day.php?cal={CAL}&getdate={PREV_DAY}'"> <span class="V12"><a class="psf" href="day.php?cal={CAL}&getdate={PREV_DAY}">«</a></span> diff --git a/templates/grey/default.css b/templates/grey/default.css index fd37358..af09e5c 100644 --- a/templates/grey/default.css +++ b/templates/grey/default.css @@ -71,6 +71,7 @@ table, td {font: 11px Verdana, Arial, sans-serif; color: #000;} .eventborder { background-image: url(images/day_title.gif); border: 1px #006699 solid; }
.eventbg { background-color: #6699CC; }
+.tfixed { table-layout: fixed; } .calborder { background-color: #fff; border: 1px #A1A5A9 solid; }
.dateback { background-color: #eee; }
.weekborder { border-top: 1px dashed #A1A5A9; border-right: 1px solid #A1A5A9; }
diff --git a/templates/red/day.tpl b/templates/red/day.tpl index a1db506..c66d40f 100644 --- a/templates/red/day.tpl +++ b/templates/red/day.tpl @@ -24,7 +24,7 @@ </tr> <tr> <td colspan="2"> - <table width="100%" border="0" cellspacing="0" cellpadding="2"> + <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tfixed"> <tr> <td align="left" valign="top" width="20" class="rowOff2" onmouseover="this.className='rowOn2'" onmouseout="this.className='rowOff2'" onclick="window.location.href='day.php?cal={CAL}&getdate={PREV_DAY}'"> <span class="V12"><a class="psf" href="day.php?cal={CAL}&getdate={PREV_DAY}">«</a></span> diff --git a/templates/red/default.css b/templates/red/default.css index c0779fb..a7af46d 100644 --- a/templates/red/default.css +++ b/templates/red/default.css @@ -70,6 +70,7 @@ table, td {font: 11px Verdana, Arial, sans-serif; color: #000;} .eventborder { background-image: url(images/day_title.gif); border: 1px #006699 solid; }
.eventbg { background-color: #6699CC; }
+.tfixed { table-layout: fixed; } .calborder { background-color: #fff; border: 1px #A1A5A9 solid; }
.dateback { background-color: #eee; }
.weekborder { border-top: 1px dashed #A1A5A9; border-right: 1px solid #A1A5A9; }
diff --git a/templates/tan/day.tpl b/templates/tan/day.tpl index a1db506..c66d40f 100644 --- a/templates/tan/day.tpl +++ b/templates/tan/day.tpl @@ -24,7 +24,7 @@ </tr> <tr> <td colspan="2"> - <table width="100%" border="0" cellspacing="0" cellpadding="2"> + <table width="100%" border="0" cellspacing="0" cellpadding="2" class="tfixed"> <tr> <td align="left" valign="top" width="20" class="rowOff2" onmouseover="this.className='rowOn2'" onmouseout="this.className='rowOff2'" onclick="window.location.href='day.php?cal={CAL}&getdate={PREV_DAY}'"> <span class="V12"><a class="psf" href="day.php?cal={CAL}&getdate={PREV_DAY}">«</a></span> diff --git a/templates/tan/default.css b/templates/tan/default.css index 54300b6..3f5b303 100644 --- a/templates/tan/default.css +++ b/templates/tan/default.css @@ -90,6 +90,7 @@ table, td {font: 11px Verdana, Arial, sans-serif; color: #000;} .eventborder { background-image: url(images/day_title.gif); border: 1px #006699 solid; }
.eventbg { background-color: #6699CC; }
+.tfixed { table-layout: fixed; } .calborder { background-color: #fff; border: 1px #A1A5A9 solid; }
.dateback { background-color: #eee; }
.weekborder { border-top: 1px dashed #A1A5A9; border-right: 1px solid #A1A5A9; }
|