version 1.132, 2013/09/01 01:12:01
|
version 1.137, 2014/06/17 23:22:14
|
Line 35 use Apache::loncommon;
|
Line 35 use Apache::loncommon;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lontexconvert; |
use Apache::lontexconvert; |
use Apache::lonfeedback; |
use Apache::lonfeedback; |
|
use Apache::lonhtmlgateway; |
use Apache::lonannounce; |
use Apache::lonannounce; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonhtmlcommon; |
use Apache::lonhtmlcommon; |
Line 98 sub handler {
|
Line 99 sub handler {
|
my $minimal=$courseenv{'minimalsyllabus'}; |
my $minimal=$courseenv{'minimalsyllabus'}; |
|
|
if (($minimal =~/\w/) || ($uploaded =~/\w/)) { |
if (($minimal =~/\w/) || ($uploaded =~/\w/)) { |
my $item; |
my ($item,$is_pdf); |
if ($minimal =~/\w/) { |
if ($minimal =~/\w/) { |
if ($external =~ m{\Q$minimal\E$}) { |
if ($external =~ m{\Q$minimal\E$}) { |
undef($external); |
undef($external); |
Line 109 sub handler {
|
Line 110 sub handler {
|
undef($external); |
undef($external); |
} |
} |
$item = $uploaded; |
$item = $uploaded; |
|
if ($item =~ /\.pdf$/i) { |
|
$is_pdf = 1; |
|
} |
} |
} |
unless ($allowed && $forceedit) { |
unless ($allowed && $forceedit) { |
my $file=&Apache::lonnet::filelocation("",$item); |
my $file=&Apache::lonnet::filelocation("",$item); |
Line 128 sub handler {
|
Line 132 sub handler {
|
if ($env{'form.only_body'}) { |
if ($env{'form.only_body'}) { |
$args{'only_body'} = 1; |
$args{'only_body'} = 1; |
} |
} |
|
if ($env{'request.use_absolute'}) { |
|
$args{'use_absolute'} = $env{'request.use_absolute'}; |
|
} |
$r->print(&Apache::loncommon::start_page("Syllabus",undef,\%args). |
$r->print(&Apache::loncommon::start_page("Syllabus",undef,\%args). |
$result. |
$result. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
Line 156 sub handler {
|
Line 163 sub handler {
|
&mt('Print the syllabus directly from your web browser'). |
&mt('Print the syllabus directly from your web browser'). |
'\end{document}'); |
'\end{document}'); |
} else { |
} else { |
$r->print(&Apache::lonwrapper::wrapper($item)); |
$r->print(&Apache::lonwrapper::wrapper($item,undef,$env{'request.use_absolute'}, |
|
undef,$is_pdf,&mt('Syllabus'))); |
} |
} |
} |
} |
return OK; |
return OK; |
Line 169 sub handler {
|
Line 177 sub handler {
|
' \strut \\\\ '.&mt('Print the syllabus directly from your web browser'). |
' \strut \\\\ '.&mt('Print the syllabus directly from your web browser'). |
'\end{document}'); |
'\end{document}'); |
} else { |
} else { |
$r->print(&Apache::lonwrapper::wrapper($external)); |
my $is_ext = 1; |
|
my $is_pdf; |
|
if ($external =~ /\.pdf$/i) { |
|
$is_pdf = 1; |
|
} |
|
$r->print(&Apache::lonwrapper::wrapper($external,undef,$env{'request.use_absolute'}, |
|
$is_ext,$is_pdf,&mt('Syllabus'))); |
} |
} |
return OK; |
return OK; |
} |
} |
Line 409 sub handler {
|
Line 423 sub handler {
|
} |
} |
$rsslinktext = &mt('Manage Course RSS Feeds/Blogs'); |
$rsslinktext = &mt('Manage Course RSS Feeds/Blogs'); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$rsslinktext = &mt('Manage Communiity RSS Feeds/Blogs'); |
$rsslinktext = &mt('Manage Community RSS Feeds/Blogs'); |
} |
} |
} |
} |
my $editurl= &Apache::lonnet::absolute_url().'/adm/'.$cdom.'/'.$cnum.'/_rss.html'; |
my $editurl= &Apache::lonnet::absolute_url().'/adm/'.$cdom.'/'.$cnum.'/_rss.html'; |
Line 694 ENDSCRIPT
|
Line 708 ENDSCRIPT
|
onload => 'setTemplateBoxes();', |
onload => 'setTemplateBoxes();', |
); |
); |
$args->{'add_entries'} = \%loaditem; |
$args->{'add_entries'} = \%loaditem; |
|
} else { |
|
if ($env{'request.use_absolute'}) { |
|
$args->{'use_absolute'} = $env{'request.use_absolute'}; |
|
} |
} |
} |
if ($env{'form.only_body'}) { |
if ($env{'form.only_body'}) { |
$args->{'only_body'} = 1; |
$args->{'only_body'} = 1; |
Line 1174 sub save_changes {
|
Line 1192 sub save_changes {
|
foreach my $syl_field (keys(%{$syllabusfields})) { |
foreach my $syl_field (keys(%{$syllabusfields})) { |
my $field=$env{'form.'.$syl_field}; |
my $field=$env{'form.'.$syl_field}; |
chomp($field); |
chomp($field); |
$field=~s/\s+$//s; |
my $gateway = Apache::lonhtmlgateway->new(); |
$field=~s/^\s+//s; |
$field = $gateway->process_incoming_html($field,1); |
$field=~s/\<br\s*\/*\>$//s; |
|
$field=&Apache::lonfeedback::clear_out_html($field,1); |
|
#here it will be stored |
#here it will be stored |
$syllabus->{$syl_field}=$field; |
$syllabus->{$syl_field}=$field; |
if ($syl_field eq 'lll_includeurl') { # clean up included URLs |
if ($syl_field eq 'lll_includeurl') { # clean up included URLs |
Line 1272 sub save_changes {
|
Line 1288 sub save_changes {
|
($url,$needlink) = &process_upload(\$output,$cnum,$cdom, |
($url,$needlink) = &process_upload(\$output,$cnum,$cdom, |
\%allfiles,\%codebase); |
\%allfiles,\%codebase); |
} else { |
} else { |
$output = '<div class="LC_info">'; |
$output = '<div class="LC_info">'. |
&mt('No file uploaded'). |
&mt('No file uploaded'). |
'</div>'; |
'</div>'; |
} |
} |
Line 1504 sub home_http_host {
|
Line 1520 sub home_http_host {
|
if ($home ne 'no_host') { |
if ($home ne 'no_host') { |
my $protocol = $Apache::lonnet::protocol{$home}; |
my $protocol = $Apache::lonnet::protocol{$home}; |
$protocol = 'http' if ($protocol ne 'https'); |
$protocol = 'http' if ($protocol ne 'https'); |
return $protocol.'://'.$home; |
return $protocol.'://'.&Apache::lonnet::hostname($home); |
} |
} |
return; |
return; |
} |
} |