Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2141
Modified Files:
NEWS serendipity_functions.inc.php
Log Message:
RFE #832040 - Allow for easier handling of Calendar CSS classes
Remove hardcoded attributes for "today"
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.384
retrieving revision 1.385
diff -u -d -r1.384 -r1.385
--- serendipity_functions.inc.php 5 Aug 2004 16:38:17 -0000 1.384
+++ serendipity_functions.inc.php 8 Aug 2004 15:24:49 -0000 1.385
@@ -452,7 +452,7 @@
// Prepare the table
$link = serendipity_archiveDateUrl($year . sprintf('%02d', $month)) . $base_query;
?>
-<table width="100%" class="serendipity_calendar" cellspacing="1">
+<table width="100%" class="serendipity_calendar" cellspacing="0" cellpadding="0">
<tr>
<td align="left" class="serendipity_calendarHeader">
<?php
@@ -486,7 +486,7 @@
for ($i = 1; $i <= 7; $i++) {
$date = mktime(0,0,0,3,$bow+$i-1,2004);
?>
- <td class="serendipity_weekDayName" align="center"><?php echo substr(strftime("%a", $date),0,2); ?></td>
+ <td class="serendipity_weekDayName" align="center"><?php echo substr(serendipity_formatTime("%a", $date),0,2); ?></td>
<?php
}
?>
@@ -509,54 +509,47 @@
<?php
// Prepare row
for ($y = 0; $y < 7; $y++) {
- // Be able to print borders nicely
- if ($x == $nrOfRows-1 && $y == 6) {
- $cellProp = 'LastInLastRow';
- } else if ($y == 0) {
- $cellProp = 'FirstInRow';
- } else if ($y == 6) {
- $cellProp = 'LastInRow';
- } else if ($x == $nrOfRows-1) {
- $cellProp = 'LastRow';
- } else {
- $cellProp = '';
+ $cellProps = array();
+ $link = '';
+
+ if ($x == 0) {
+ $cellProps[] = 'FirstRow';
}
+ if ($y == 0) {
+ $cellProps[] = 'FirstInRow';
+ }
+ if ($y == 6) {
+ $cellProps[] = 'LastInRow';
+ }
+ if ($x == $nrOfRows-1) {
+ $cellProps[] = 'LastRow';
+ }
- // Start printing
- if (($x > 0 || $y >= $firstDayWeekDay)
- && $currDay <= $nrOfDays) {
+ // If it's not a blank day, we print the day
+ if (($x > 0 || $y >= $firstDayWeekDay) && $currDay <= $nrOfDays) {
- if (isset($activeDays[$currDay]) && $activeDays[$currDay] > 1) {
- $cellProp .= 'Active';
+ $printDay = $currDay;
+
+ if ($today_year == $year && $today_month == $month && $today_day == $currDay) {
+ $cellProps[] = 'Today';
}
- if ($today_year == $year
- && $today_month == $month
- && $today_day == $currDay) {
- $att_start = '<i>';
- $att_end = '</i>';
- } else {
- $att_start = '';
- $att_end = '';
+ if (isset($activeDays[$currDay]) && $activeDays[$currDay] > 1) {
+ $cellProps[] = 'Active';
}
if (isset($activeDays[$currDay]) && $activeDays[$currDay] > 1) {
- $lnk_start = '<a href="' . serendipity_archiveDateUrl(sprintf('%4d%02d%02d', $year, $month, $currDay)) . $base_query . '">'; //?month=".sprintf("%02d",$month)."&year=$year'>");
- $lnk_end = '</a>';
- } else {
- $lnk_start = '';
- $lnk_end = '';
+ $printDay = '<a href="' . serendipity_archiveDateUrl(sprintf('%4d%02d%02d', $year, $month, $currDay)) . $base_query . '">'. $printDay .'</a>';
}
$currDay++;
?>
- <td class="serendipity_calendarDay<?php echo $cellProp; ?>">
- <?php echo $att_start . $lnk_start . ($currDay - 1) . $lnk_end . $att_end; ?>
- </td>
+ <td class="serendipity_calendarDay <?php echo implode(' ', $cellProps); ?>"><?php echo $printDay ?></td>
<?php
+ // If it's a blank day (a day outside the month)
} else {
?>
- <td class="serendipity_calendarBlankDay<?php echo $cellProp; ?>"> </td>
+ <td class="serendipity_calendarDay BlankDay <?php echo implode(' ', $cellProps); ?>"> </td>
<?php
} // end if (print day)
} // end for-loop (inner: days)
Index: NEWS
===================================================================
RCS file: /cvsroot/php-blog/serendipity/NEWS,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -d -r1.196 -r1.197
--- NEWS 5 Aug 2004 22:31:10 -0000 1.196
+++ NEWS 8 Aug 2004 15:24:49 -0000 1.197
@@ -3,6 +3,9 @@
Version 0.7 ()
------------------------------------------------------------------------
+ * RFE #832040 - Allow for easier handling of Calendar CSS classes
+ and remove hardcoded attributes for "today" (tomsommer)
+
* Add detection for support of php_value directives in .htaccess
files (tomsommer)
|