Changeset:
        a0ba6af5a90a
        
https://sourceforge.net/p/mrbs/hg-code/ci/a0ba6af5a90ac99dfbe2772835f9b0254f79227d
Author:
        Campbell Morrison <[email protected]>
Date:
        Sat Aug 27 15:30:58 2016 +0100
Log message:

Simplified code

diffstat:

 web/month.php |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 68201685dd13 -r a0ba6af5a90a web/month.php
--- a/web/month.php     Sat Aug 27 15:22:34 2016 +0100
+++ b/web/month.php     Sat Aug 27 15:30:58 2016 +0100
@@ -118,6 +118,15 @@
 }
 
 
+function get_blank_day($col)
+{
+  global $weekstarts;
+  
+  $td_class = (is_hidden_day(($col + $weekstarts) % 7)) ? 'hidden_day' : 
'invalid';
+  return "<td class=\"$td_class\"><div 
class=\"cell_container\">&nbsp;</div></td>\n";
+}
+
+
 function month_table_innerhtml($day, $month, $year, $room, $area)
 {
   global $tbl_entry;
@@ -231,8 +240,7 @@
   // Skip days in week before start of month:
   for ($weekcol = 0; $weekcol < $weekday_start; $weekcol++)
   {
-    $td_class = (is_hidden_day(($weekcol + $weekstarts) % 7)) ? 'hidden_day' : 
'invalid';
-    $html .= "<td class=\"$td_class\"><div 
class=\"cell_container\">&nbsp;</div></td>\n";
+    $html .= get_blank_day($weekcol);
   }
 
   // Draw the days of the month:
@@ -370,8 +378,7 @@
   {
     for (; $weekcol < 7; $weekcol++)
     {
-      $td_class = (is_hidden_day(($weekcol + $weekstarts) % 7)) ? 'hidden_day' 
: 'invalid';
-      $html .= "<td class=\"$td_class\"><div 
class=\"cell_container\">&nbsp;</div></td>\n";
+      $html .= get_blank_day($weekcol);
     }
   }
   

------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to