version 1.56, 2006/10/23 20:25:45
|
version 1.63, 2008/01/16 17:13:57
|
Line 66 sub handler {
|
Line 66 sub handler {
|
|
|
# ------------------------------------------------------------ Print the screen |
# ------------------------------------------------------------ Print the screen |
|
|
my $rss_link = |
|
&Apache::lonrss::rss_link('http://'.$ENV{'HTTP_HOST'}.'/public/'.$cdom.'/'.$cnum.'/Course_Announcements.rss'); |
|
|
|
if ($target eq 'tex') { |
if ($target eq 'tex') { |
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
} |
} |
Line 112 sub handler {
|
Line 109 sub handler {
|
|
|
# ----------------------------------------------------------------- Make header |
# ----------------------------------------------------------------- Make header |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
|
my $rss_link = &Apache::lonrss::rss_link($cnum,$cdom); |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page("Syllabus", $rss_link, |
&Apache::loncommon::start_page("Syllabus", $rss_link, |
{'function' => $forcestudent, |
{'function' => $forcestudent, |
Line 120 sub handler {
|
Line 118 sub handler {
|
$env{'form.register'},}); |
$env{'form.register'},}); |
|
|
$r->print($start_page.'<h1>'.$courseenv{'description'}.'</h1><h3>'. |
$r->print($start_page.'<h1>'.$courseenv{'description'}.'</h1><h3>'. |
$Apache::lonnet::domaindescription{$cdom}.'</h3>'); |
&Apache::lonnet::domain($cdom,'description').'</h3>'); |
} else { |
} else { |
$r->print('\noindent{\large\textbf{'.$courseenv{'description'}.'}}\\\\\\\\\textbf{'. |
$r->print('\noindent{\large\textbf{'.$courseenv{'description'}.'}}\\\\\\\\\textbf{'. |
$Apache::lonnet::domaindescription{$cdom}.'}\\\\'); |
&Apache::lonnet::domain($cdom,'description').'}\\\\'); |
} |
} |
# -------------------------------------------------------------- Announcements? |
# -------------------------------------------------------------- Announcements? |
my $day = &Apache::lonannounce::showday(time,2, |
my $day = &Apache::lonannounce::showday(time,2, |
Line 137 sub handler {
|
Line 135 sub handler {
|
# -------------------------------------------------------- Get course personnel |
# -------------------------------------------------------- Get course personnel |
my %coursepersonnel=&Apache::lonnet::get_course_adv_roles($cdom.'/'.$cnum); |
my %coursepersonnel=&Apache::lonnet::get_course_adv_roles($cdom.'/'.$cnum); |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('<table border="2">'); |
$r->print(&Apache::loncommon::start_data_table()); |
} else { |
} else { |
$r->print('\begin{tabular}{|p{0.45\textwidth}|p{0.45\textwidth}|}\hline'); |
$r->print('\begin{tabular}{|p{0.45\textwidth}|p{0.45\textwidth}|}\hline'); |
} |
} |
foreach my $element (sort keys %coursepersonnel) { |
foreach my $element (sort keys %coursepersonnel) { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('<tr><td>'.$element.'</td><td>'); |
$r->print(&Apache::loncommon::start_data_table_row(). |
|
'<td>'.$element.'</td><td>'); |
} else { |
} else { |
$r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$element).' & '); |
$r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$element).' & '); |
} |
} |
Line 159 sub handler {
|
Line 158 sub handler {
|
} |
} |
} |
} |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('</td></tr>'); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} else { |
} else { |
$r->print('\\\\ \hline'); |
$r->print('\\\\ \hline'); |
} |
} |
} |
} |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('</table>'); |
$r->print(&Apache::loncommon::end_data_table()); |
} else { |
} else { |
$r->print('\end{tabular}\\\\'); |
$r->print('\end{tabular}\\\\'); |
} |
} |
Line 190 sub handler {
|
Line 189 sub handler {
|
} |
} |
if ($allowed) { |
if ($allowed) { |
$r->print('<p>'. |
$r->print('<p>'. |
&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'</p><p>'.&mt('This syllabus can be publicly viewed at') |
&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'</p><p>'.&mt('This syllabus can be publicly viewed at') |
.' <tt>http://'. |
.' <tt>http://'. |
$Apache::lonnet::hostname{$homeserver}.$r->uri.'</tt>'. |
&Apache::lonnet::hostname($homeserver).$r->uri.'</tt>'. |
&Apache::loncommon::help_open_topic('Syllabus_ExtLink').'</p>'. |
&Apache::loncommon::help_open_topic('Syllabus_ExtLink').'</p>'. |
'<p>'.&mt('You can specify an external URL as Syllabus in the [_1].','<a href="/adm/parmset?action=crsenv">'.&mt('Course Parameters').'</a>').'</p>'. |
'<p>'.&mt('You can specify an external URL as Syllabus in the [_1].','<a href="/adm/parmset?action=crsenv">'.&mt('Course Parameters').'</a>').'</p>'. |
'<p><a href="'.$r->uri.'?forcestudent=1"><font size="+1">'. |
'<p><a href="'.$r->uri.'?forcestudent=1"><font size="+1">'. |
Line 225 sub handler {
|
Line 224 sub handler {
|
my $host = $1; |
my $host = $1; |
my $remainder=$2; |
my $remainder=$2; |
# remove the hostname from internal URLs |
# remove the hostname from internal URLs |
foreach my $possible_host (keys(%Apache::lonnet::hostname)) { |
my $hostname = &Apache::lonnet::hostname($host); |
if ($possible_host =~ |
my %all_hostnames = &Apache::lonnet::all_hostnames(); |
/\Q$Apache::lonnet::hostname{$host}\E/i) { |
foreach my $possible_host (keys(%all_hostnames)) { |
|
if ($possible_host =~ /\Q$hostname\E/i) { |
$url=$remainder; |
$url=$remainder; |
} |
} |
} |
} |
Line 260 sub handler {
|
Line 260 sub handler {
|
$syllabus{'uploaded.domain'}); |
$syllabus{'uploaded.domain'}); |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print('<table><tr><td>'.&mt('Last updated').':</td><td>'. |
$r->print('<table><tr><td>'.&mt('Last updated').':</td><td>'. |
$lastmod.'</td><td>'.&mt('by').' '.$who. |
$lastmod.'</td><td>'. |
|
($who ? &mt('by').' '.$who |
|
: '' ). |
'</td></tr></table><p>'); |
'</td></tr></table><p>'); |
} else { |
} else { |
$r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '.&mt('by').'\\\\ '. |
$r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '. |
&Apache::loncommon::plainname($syllabus{'uploaded.name'}, |
($who? &mt('by').'\\\\ '. |
$syllabus{'uploaded.domain'}).'\\\\'); |
&Apache::loncommon::plainname($syllabus{'uploaded.name'},$syllabus{'uploaded.domain'}) |
|
:'') |
|
.'\\\\'); |
} |
} |
if ($allowed) { |
if ($allowed) { |
$r->print('<form method="post">'. |
$r->print('<form method="post">'. |
Line 323 sub handler {
|
Line 327 sub handler {
|
if ($allowed) { |
if ($allowed) { |
$r->print('<br /><textarea cols="80" rows="12" name="'.$field.'" id="'.$field.'">'. |
$r->print('<br /><textarea cols="80" rows="12" name="'.$field.'" id="'.$field.'">'. |
&HTML::Entities::encode($syllabus{$field},'"&<>'). |
&HTML::Entities::encode($syllabus{$field},'"&<>'). |
'</textarea> <input type="submit" name="storesyl" value="Store" />'); |
'</textarea> <input type="submit" name="storesyl" value="'.&mt('Save').'" />'); |
} |
} |
} |
} |
} |
} |
Line 334 sub handler {
|
Line 338 sub handler {
|
if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');} |
if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');} |
} else { |
} else { |
if ($target ne 'tex') {$r->print('<p>');} else {$r->print('\par ');} |
if ($target ne 'tex') {$r->print('<p>');} else {$r->print('\par ');} |
$r->print('No syllabus information provided.'); |
$r->print(&mt('No syllabus information provided.')); |
if ($target ne 'tex') {$r->print('</p>');} |
if ($target ne 'tex') {$r->print('</p>');} |
} |
} |
if ($target ne 'tex') { |
if ($target ne 'tex') { |