[LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm
bisitz
lon-capa-cvs-allow@mail.lon-capa.org
Mon, 13 Oct 2008 15:33:05 -0000
bisitz Mon Oct 13 11:33:05 2008 EDT
Modified files:
/loncom/interface lonannounce.pm
Log:
Server announcement and calendar:
- Localization: Added missing &mt() calls
- Added headline to calendar
- Standard headline usage
- Use standard warning style for out-of-date warning
- Moved <br /> from start of list to end of list
Index: loncom/interface/lonannounce.pm
diff -u loncom/interface/lonannounce.pm:1.72 loncom/interface/lonannounce.pm:1.73
--- loncom/interface/lonannounce.pm:1.72 Wed Sep 24 21:39:29 2008
+++ loncom/interface/lonannounce.pm Mon Oct 13 11:33:02 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Announce
#
-# $Id: lonannounce.pm,v 1.72 2008/09/25 01:39:29 raeburn Exp $
+# $Id: lonannounce.pm,v 1.73 2008/10/13 15:33:02 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -54,13 +54,14 @@
'enddate',
$end);
my $help=&Apache::loncommon::help_open_menu('Calendar Add Announcement','Calendar_Add_Announcement',274,'Communication Tools');
- my %lt=&Apache::lonlocal::texthash('post' => 'Post Announcement',
+ my %lt=&Apache::lonlocal::texthash('annon' => 'Course Announcements',
+ 'post' => 'Post Announcement',
'start' => 'Starting date',
'end' => 'Ending date',
'incrss' => 'Include in course RSS newsfeed');
$r->print(<<ENDFORM);
-$help
+<h2>$lt{'annon'} $help</h2>
<form name="anno" method="post">
<input type="hidden" value='' name="action" />
<table><tr><td>$lt{'start'}:</td><td>$startdateform</td></tr>
@@ -567,27 +568,27 @@
}
}
}
- $r->print(<<SERVERANNOUNCE);
-<form name="serveranno" method="post">
-<h3>Post Server Announcements</h3>
-Post announcements to the system login and roles screen<br />
-<i>(leave blank to delete announcement)</i><br />
-<textarea name="serverannnounce" cols="60" rows="5"></textarea><br />
-Check machines:<br />
-SERVERANNOUNCE
+ $r->print('<form name="serveranno" method="post">'
+ .'<h2>'.&mt('Post Server Announcements').'</h2>'
+ .&mt('Post announcements to the system login and roles screen').'<br />'
+ .'<i>'.&mt('(leave blank to delete announcement)').'</i><br />'
+ .'<textarea name="serverannnounce" cols="60" rows="5"></textarea><br />'
+ .&mt('Check machines:').'<br />'
+ );
# list servers
my %hostname = &Apache::lonnet::all_hostnames();
foreach my $host (sort(keys(%hostname))) {
if (&Apache::lonnet::allowed('psa',
&Apache::lonnet::host_domain($host))) {
- $r->print ('<br /><label><input type="checkbox" name="postto_'.$host.'" /> '.
+ $r->print ('<label><input type="checkbox" name="postto_'.$host.'" /> '.
$host.' <tt>'.$hostname{$host}.'</tt> '.
'</label><a href="http://'.$hostname{$host}.
- '/announcement.txt?time='.time.'" target="annowin">current</a>');
+ '/announcement.txt?time='.time.'" target="annowin">'.
+ &mt('Current Announcement').'</a><br />');
}
}
$r->print(
- '<br /><input type="submit" name="serveraction" value="Post"></form><hr />');
+ '<br /><input type="submit" name="serveraction" value="'.&mt('Post').'"></form><hr />');
}
if ($allowed) {
my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'};
@@ -640,18 +641,21 @@
if ($pm<1) { ($pm,$py)=(12,$year-1); }
if ($fm>12){ ($fm,$fy)=(1,$year+1); }
- $r->print('<h1>'.('',&mt('January'),&mt('February'),&mt('March'),
+ $r->print('<h2>'.&mt('Calendar').'</h2>'
+ .'<h3>'.('',&mt('January'),&mt('February'),&mt('March'),
&mt('April'),&mt('May'),
&mt('June'),&mt('July'),&mt('August'),
&mt('September'),&mt('October'),
&mt('November'),&mt('December'))[$month].' '.
- $year.' '.&show_timezone().'</h1>');
+ $year.' '.&show_timezone().'</h3>');
# Reached the end of times, give up
if (($year<1970) || ($year>2037)) {
- $r->print('<h3>No calendar available for this date.</h3>'.
- '<a href="/adm/announcements?month='.$todayhash{'month'}.
- '&year='.$todayhash{'year'}.'">Current Month</a>'.
- &Apache::loncommon::end_page());
+ $r->print('<p class="LC_warning">'
+ .&mt('No calendar available for this date.')
+ .'</p>'
+ .'<a href="/adm/announcements?month='.$todayhash{'month'}
+ .'&year='.$todayhash{'year'}.'">'.&mt('Current Month').'</a>'
+ .&Apache::loncommon::end_page());
return OK;
}
@@ -740,7 +744,7 @@
# ----------------------------------------------------------------- Check marks
undef(%showedcheck);
# --------------------------------------------------------------- Remove button
- if ($allowed) { $r->print('<input type="button" onClick="removesub()" value="Remove Checked Entries">'.
+ 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.