Only start with classic view for text browsers or when requested
authorJoey Schulze <joey@infodrom.org>
Wed, 31 Oct 2018 11:55:11 +0000 (12:55 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 31 Oct 2018 11:55:11 +0000 (12:55 +0100)
src/Infodrom/calendar/index.wml

index ceb4b41..3bacff8 100644 (file)
@@ -118,8 +118,15 @@ div.popup_body div#log div:hover
 }
 </style>
 
+<?php
+  $textbrowser = strpos($_SERVER['HTTP_USER_AGENT'], 'Lynx/') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'w3m/') !== false;
+?>
+
 <input type="hidden" id="thismonth">
 <div id="termine">
+<?php
+  if ($textbrowser || (isset($_GET['month']) && $_GET['month'] == 'normal')) {
+?>
 <table id="calendar" width="100%" class="smallfont border" cellspacing="0" summary="">
 <tr class="head">
 <th width="5%">KW</th>
@@ -149,6 +156,8 @@ div.popup_body div#log div:hover
     $newmonth = $start->format('F Y');
     if ($month != $newmonth) {
       $month = $newmonth;
+      if ($textbrowser)
+         printf('<tr><td colspan="4">&nbsp;</td></tr>');
       printf('<tr class="month" month="%s"><td colspan="4">%s</td></tr>',
             $start->format('Y-m'), $month);
       $kw = '';
@@ -178,6 +187,9 @@ div.popup_body div#log div:hover
 ?>
 
 </table>
+<?php
+  } // $textbrowser || month == 'monat'
+?>
 </div>
 <div class="clear"></div>