[webaccessibile] calendario accessibile in php

diaframma multimediaLAB info a diaframma.net
Ven 2 Mar 2007 16:12:16 CET


Ciao a tutti,
ho un problema con un calendario settato in php  che non riesco a rendere perfettamente accessibile.
posto la parte del codice che interessa:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$str = "\t<table summary=\"tabella calendario mensile formata da sette colonne. \" class=\"cal_table\" width=\"".CAL_WIDTH."\">\n";
        $str.= "\t<tr><td>\n";
        // tabella intestazione
        $str.= "\t\t<table summary=\"mese corrente\" class=\"cal_header_table\" width=\"100%\">\n";
            // mese precedente
        $str.= "\t\t\t<tr><td class=\"cal_arrow\">";
        $str.= "\t\t\t\t<a title=\"mese precedente\" href=\"".$prevUrl."\">&lt;&lt;</a>\n";
        $str.= "\t\t\t</td>\n";
            // nome mese e link a mese corrente
        $str.= "\t\t\t<td colspan=\"5\" class=\"cal_header\">\n";
  //$str.= "\t\t\t\t<a href=\"".$baseUrl."\">".$stringaMese."</a>\n";
  $str.= "\t\t\t\t<a title=\"nome del mese e link al mese corrente\" href=\"".$baseUrl."\">".$stringaMese."</a>\n";
        $str.= "\t\t\t</td>\n";
            // mese successivo
        $str.= "\t\t\t<td class=\"cal_arrow\">\n";
        $str.= "\t\t\t\t<a title=\"mese successivo\" href=\"".$nextUrl."\">&gt;&gt;</a>\n";
        $str.= "\t\t\t</td></tr></table></td></tr>\n";
  $str.= "\t\t</table>\n";


        // tabella per i giorni del mese
        $str.= "\t\t<table summary=\"giorni della settimana. \" class=\"cal_table\" width=\"100%\">\n";
            // intestazioni dei giorni della settimana
        $str.= "\t\t\t<tr>\n";
        while(list($k, $v) = each($giorniSett))
            $str.= "\t\t\t\t<td class=\"cal_day_header\">".$v."</td>\n";
        $str.= "\t\t\t</tr>\n";
            // giorni del mese
        $str.= "\t\t\t<tr>\n";

            // stabilisce se visualizzare un giorno come corrente
        $thisDay = -1;
        if($mese == $today['mon'] && $anno == $today['year'])
            $thisDay = $today['mday'];

        for ($j = 1, $i = 1; $j <= $giorni; $i++) {
         if ($i <= $iniziomese % 7) {
             $str.= "<td class=\"cal_day\">&nbsp;</td>";
         }
            else
            { 
            
            $giorno  = $j;
            $m = $mese;
            if ($giorno < 10) $giorno = "0".$j;
            if ($m < 10) $m = "0".$mese;
            if (strlen($giorno)>2) $giorno = substr($giorno,strlen($giorno),strlen($giorno)-2); 
            if (strlen($m)>2) $m = substr($m,strlen($m),strlen($m)-2);
   $data = $anno."-".$m."-".$giorno;
      $h = initConnection();
   $sql = 'SELECT * FROM calendar_events WHERE Date="'.$data.'"';
       $result = mysql_query($sql);
       if (mysql_num_rows($result) > 0) {
       $spanstr = "<span>";
   while ($row = mysql_fetch_array($result)){
   $spanstr.= $row['Event']."<br>";
   $url = $row['Url'];
   }
   $spanstr.="</span>";
   
   if($j == $thisDay)
    $str.= "<td class=\"cal_this_day\"><a class=info href=\"".$url."\">".$j.$spanstr."</a> </td>";
             else
              $str.= "<td class=\"cal_day_highlight\"><a class=info href=\"".$url."\">".$j.$spanstr."</a></td>";
           mysql_close($h);
   }
   else
             {
                if($j == $thisDay)
                 $str.= "<td class=\"cal_this_day\">".$j."</td>";
                else
                 $str.= "<td class=\"cal_day\">".$j."</td>";
                 }
             $j++;
            }
    
            if ( $i % 7 == 0) {
             $str.= "</tr><tr>";
            }
        }
        $str.= "\t\t\t</tr>\n";

  $str.= "\t</table>\n";

        return ($str);
    }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

il calendario è qui: http://www.comune.bussi.pe.it
Grazie in anticipo e buon week end a tutti ;-)
Tonio 
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: http://itlists.org/pipermail/webaccessibile/attachments/20070302/2cade19f/attachment.htm 


Maggiori informazioni sulla lista webaccessibile