[LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm

raeburn raeburn@source.lon-capa.org
Sat, 13 Feb 2010 16:47:38 -0000


raeburn		Sat Feb 13 16:47:38 2010 EDT

  Modified files:              
    /loncom/interface	lonannounce.pm 
  Log:
  - xhtml
  - unbalanced <p> tag replaced with <div></div>
  - Link to "Download your Calendar as iCalendar File" before call to &loncommon::end_page().
  
  
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.80 loncom/interface/lonannounce.pm:1.81
--- loncom/interface/lonannounce.pm:1.80	Wed Nov  4 20:01:24 2009
+++ loncom/interface/lonannounce.pm	Sat Feb 13 16:47:38 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Announce
 #
-# $Id: lonannounce.pm,v 1.80 2009/11/04 20:01:24 raeburn Exp $
+# $Id: lonannounce.pm,v 1.81 2010/02/13 16:47:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -420,6 +420,7 @@
 sub dialscript {
     return (<<ENDDIA);
 <script type="text/javascript" language="JavaScript">
+// <![CDATA[
 function dialin(day,month,year) {
 	opener.document.$env{'form.formname'}.$env{'form.element'}\_year.value=year;
     var slct=opener.document.$env{'form.formname'}.$env{'form.element'}\_month;
@@ -431,6 +432,7 @@
     opener.$env{'form.element'}\_checkday();
     self.close();
 }
+// ]]>
 </script>
 ENDDIA
 }
@@ -506,8 +508,8 @@
 
 # ---------------------------------------------- See if we are in pickdate mode
     my $pickdatemode=($env{'form.pickdate'} eq 'yes');
-    my $pickinfo='&pickdate=yes&formname='.$env{'form.formname'}.
-	'&element='.$env{'form.element'};
+    my $pickinfo='&amp;pickdate=yes&amp;formname='.$env{'form.formname'}.
+	'&amp;element='.$env{'form.element'};
 # --------------------------------------------- Find out first day of the month
 
     my $tk = &Apache::loncommon::maketime( 'day' => 1,
@@ -522,6 +524,7 @@
 # ------------------------------------------------------------ Print the screen
     my $js = <<ENDDOCUMENT;
 <script type="text/javascript" language="JavaScript">
+// <![CDATA[
 
     function trysubmit() {
         document.anno.action.value="new";
@@ -532,6 +535,7 @@
         document.anno.action.value="del";
 	document.anno.submit();
     }
+// ]]>
 </script>
 ENDDOCUMENT
 
@@ -667,7 +671,7 @@
                  .&mt('No calendar available for this date.')
                  .'</p>'
                  .'<a href="/adm/announcements?month='.$todayhash{'month'}
-                 .'&year='.$todayhash{'year'}.'">'.&mt('Current Month').'</a>'
+                 .'&amp;year='.$todayhash{'year'}.'">'.&mt('Current Month').'</a>'
 		 .&Apache::loncommon::end_page());
 	return OK;
     }
@@ -706,14 +710,14 @@
     }
 
     $r->print(
- '<a href="/adm/announcements?month='.$pm.'&year='.$py.
+ '<a href="/adm/announcements?month='.$pm.'&amp;year='.$py.
  ($pickdatemode?$pickinfo:'').'">'.&mt('Previous Month').'</a> '.
- '<a href="/adm/announcements?month='.$fm.'&year='.$fy.
+ '<a href="/adm/announcements?month='.$fm.'&amp;year='.$fy.
  ($pickdatemode?$pickinfo:'').'">'.&mt('Next Month').'</a>'.
  '&nbsp;&nbsp;&nbsp;<a href="/adm/announcements?month='.$todayhash{'month'}.
- '&year='.$todayhash{'year'}.
- ($pickdatemode?$pickinfo:'').'">'.&mt('Current Month').'</a><p>'.
-        '<table class="'.$class.'" cols="7" rows="5"><tr>');
+ '&amp;year='.$todayhash{'year'}.
+ ($pickdatemode?$pickinfo:'').'">'.&mt('Current Month').'</a><div>'.
+        '<table class="'.$class.'"><tr>');
     for (my $i=0; $i<@localdays; $i++) {
         $r->print('<th>'.&mt($localdays[$i]).'</th>');
     }
@@ -753,22 +757,23 @@
         }
     }
 # ------------------------------------------------------------------- End table
-    $r->print('</table>');
+    $r->print('</table></div>');
 # ----------------------------------------------------------------- Check marks
     undef(%showedcheck);
 # --------------------------------------------------------------- Remove button
     if ($allowed) { $r->print('<br /><input type="button" onClick="removesub()" value="'.&mt('Remove Checked Entries').'">'.
 			      &Apache::loncommon::help_open_topic('Calendar_Remove_Announcement').'</form>'); }
     $r->print('<p>'.
- '<a href="/adm/announcements?month='.$pm.'&year='.$py.
+ '<a href="/adm/announcements?month='.$pm.'&amp;year='.$py.
  ($pickdatemode?$pickinfo:'').'">'.&mt('Previous Month').'</a> '.
- '<a href="/adm/announcements?month='.$fm.'&year='.$fy.
+ '<a href="/adm/announcements?month='.$fm.'&amp;year='.$fy.
  ($pickdatemode?$pickinfo:'').'">'.&mt('Next Month').'</a>'.
  '&nbsp;&nbsp;&nbsp;<a href="/adm/announcements?month='.$todayhash{'month'}.
- '&year='.$todayhash{'year'}.
+ '&amp;year='.$todayhash{'year'}.
  ($pickdatemode?$pickinfo:'').'">'.&mt('Current Month').'</a></p>'.
- ($pickdatemode?'</font>':'').&Apache::loncommon::end_page());
-    $r->print('<a href="/adm/announcements.ics">'.&mt('Download your Calendar as iCalendar File').'</a>');
+ ($pickdatemode?'</font>':'').
+ '<a href="/adm/announcements.ics">'.&mt('Download your Calendar as iCalendar File').'</a>'.
+    &Apache::loncommon::end_page());
     return OK;
 }