version 1.128, 2013/05/19 15:48:51
|
version 1.130, 2013/08/27 03:00:38
|
Line 73 sub handler {
|
Line 73 sub handler {
|
my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum); |
my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum); |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
|
|
# ------------------------------------------------------------ Print the screen |
|
|
|
if ($target eq 'tex') { |
|
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
|
} |
|
|
|
# --------------------------------------------------------------- Force Student |
# --------------------------------------------------------------- Force Student |
my ($forceedit,$forcestudent); |
my ($forceedit,$forcestudent); |
if ($env{'form.forceedit'}) { $forceedit=1; } |
if ($env{'form.forceedit'}) { $forceedit=1; } |
Line 124 sub handler {
|
Line 118 sub handler {
|
if ($filecontents eq -1) { |
if ($filecontents eq -1) { |
$r->print(&mt('Syllabus file unavailable')); |
$r->print(&mt('Syllabus file unavailable')); |
} elsif ($filetype eq 'tex') { |
} elsif ($filetype eq 'tex') { |
my $result = &Apache::lontexconvert::converted(\$filecontents, |
if ($target eq 'tex') { |
$env{'form.texengine'}); |
$r->print($filecontents); |
my %args; |
} else { |
&get_breadcrumbs($cdom,$cnum,$crstype,\%args); |
my $result = &Apache::lontexconvert::converted(\$filecontents, |
$r->print(&Apache::loncommon::start_page("Syllabus",undef,\%args). |
$env{'form.texengine'}); |
$result. |
my %args; |
&Apache::loncommon::end_page()); |
&get_breadcrumbs($cdom,$cnum,$crstype,\%args); |
|
$r->print(&Apache::loncommon::start_page("Syllabus",undef,\%args). |
|
$result. |
|
&Apache::loncommon::end_page()); |
|
} |
} else { |
} else { |
my %mystyle; |
my %mystyle; |
|
unless ($target eq 'tex') { |
|
$target = 'web'; |
|
} |
&Apache::structuretags::reset_problem_globals(); |
&Apache::structuretags::reset_problem_globals(); |
my $oldfile = $env{'request.filename'}; |
my $oldfile = $env{'request.filename'}; |
$env{'request.filename'} = $item; |
$env{'request.filename'} = $item; |
my $result = &Apache::lonxml::xmlparse($r,'web',$filecontents, |
my $result = &Apache::lonxml::xmlparse($r,$target,$filecontents, |
'',%mystyle); |
'',%mystyle); |
&Apache::structuretags::reset_problem_globals(); |
&Apache::structuretags::reset_problem_globals(); |
&Apache::lonhomework::finished_parsing(); |
&Apache::lonhomework::finished_parsing(); |
Line 145 sub handler {
|
Line 146 sub handler {
|
$r->print($result); |
$r->print($result); |
} |
} |
} else { |
} else { |
$r->print(&Apache::lonwrapper::wrapper($item)); |
if ($target eq 'tex') { |
|
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}). |
|
' \strut \\\\ \textbf{'.&mt('Syllabus').'} \strut \\\\ '. |
|
&mt('Unsupported file type.').' \strut \\\\ '. |
|
&mt('Print the syllabus directly from your web browser'). |
|
'\end{document}'); |
|
} else { |
|
$r->print(&Apache::lonwrapper::wrapper($item)); |
|
} |
} |
} |
return OK; |
return OK; |
} |
} |
} elsif ($external=~/\w/) { |
} elsif ($external=~/\w/) { |
unless ($allowed && $forceedit) { |
unless ($allowed && $forceedit) { |
$r->print(&Apache::lonwrapper::wrapper($external)); |
if ($target eq 'tex') { |
|
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}). |
|
' \strut \\\\ \textbf{'.&mt('Syllabus').'} \strut \\\\ '.$external.' '. |
|
' \strut \\\\ '.&mt('Print the syllabus directly from your web browser'). |
|
'\end{document}'); |
|
} else { |
|
$r->print(&Apache::lonwrapper::wrapper($external)); |
|
} |
return OK; |
return OK; |
} |
} |
} |
} |
|
|
|
# ------------------------------------------------------------ Print the screen |
|
|
|
if ($target eq 'tex') { |
|
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
|
} |
|
|
# ------------------------------ The buck stops here: internal syllabus display |
# ------------------------------ The buck stops here: internal syllabus display |
# --------------------------------------------------------- The syllabus fields |
# --------------------------------------------------------- The syllabus fields |
Line 406 sub handler {
|
Line 427 sub handler {
|
} |
} |
# ---------------------------------------------------------------- Get syllabus |
# ---------------------------------------------------------------- Get syllabus |
if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) { |
if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) { |
if ($allowed) { |
|
$r->print('<form method="post" action="">'); |
|
} |
|
|
|
my $url_include_handler = sub { |
my $url_include_handler = sub { |
my ($r, $field, $message, $group, $data_ref, $fields_ref, $target, $allowed, $display) = @_; |
my ($r, $field, $message, $group, $data_ref, $fields_ref, $target, $allowed, $display) = @_; |
my %data = %{$data_ref}; |
my %data = %{$data_ref}; |
Line 456 sub handler {
|
Line 473 sub handler {
|
$target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_hash, |
$target, $allowed, Apache::lontemplate->RICH_TEXT_DETECT_HTML, \%custom_hash, |
undef,\%displayfields,\%noshow); |
undef,\%displayfields,\%noshow); |
if ($allowed) { |
if ($allowed) { |
$r->print('</form>'. |
$r->print('</div></form>'. |
&Apache::lonhtmlcommon::htmlareaselectactive()); |
&Apache::lonhtmlcommon::htmlareaselectactive()); |
} |
} |
} else { |
} else { |
Line 1011 sub get_personnel {
|
Line 1028 sub get_personnel {
|
} |
} |
if ($allowed) { |
if ($allowed) { |
my $item = '<span class="LC_nobreak"><label>'. |
my $item = '<span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="hideuser" value="'.$element.'&'.$puname.':'.$pudom.'"'.$checked.' />'. |
'<input type="checkbox" name="hideuser" value="'.$element.'&'.$puname.':'.$pudom.'"'.$checked.' />'. |
&Apache::loncommon::aboutmewrapper($courseperson |
&Apache::loncommon::aboutmewrapper($courseperson |
, |
, |
$puname,$pudom). |
$puname,$pudom). |
Line 1040 sub get_personnel {
|
Line 1057 sub get_personnel {
|
} |
} |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
if ($allowed) { |
if ($allowed) { |
$r->print(&Apache::loncommon::end_data_table_row()); |
$r->print('</td>'.&Apache::loncommon::end_data_table_row()); |
} else { |
} else { |
my $lastclose=$element eq $lastpers?1:0; |
my $lastclose=$element eq $lastpers?1:0; |
$r->print(&Apache::lonhtmlcommon::row_closure($lastclose)); |
$r->print(&Apache::lonhtmlcommon::row_closure($lastclose)); |
Line 1367 sub update_syllabus_env {
|
Line 1384 sub update_syllabus_env {
|
$storehash{'updatedsyllabus'} = $now; |
$storehash{'updatedsyllabus'} = $now; |
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.updatedsyllabus' => $now |
&Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.updatedsyllabus' => $now |
}); |
}); |
|
|
} elsif ($saved eq 'url') { |
} elsif ($saved eq 'url') { |
my $prefix = &home_http_host($cdom,$cnum); |
my $prefix = &home_http_host($cdom,$cnum); |
if ($external =~ m{^\Q$prefix/uploaded/$cdom/$cnum/portfolio/syllabus/\E(.+)$}) { |
if ($external =~ m{^\Q$prefix/uploaded/$cdom/$cnum/portfolio/syllabus/\E(.+)$}) { |
Line 1399 sub update_syllabus_env {
|
Line 1415 sub update_syllabus_env {
|
if (@envkeys > 0) { |
if (@envkeys > 0) { |
foreach my $item (@envkeys) { |
foreach my $item (@envkeys) { |
my $key = $item.'syllabus'; |
my $key = $item.'syllabus'; |
if ($courseenv->{$key}) { |
if ($courseenv->{$key} ne '') { |
&Apache::lonnet::delenv('course.'.$env{'request.course.id'}.'.'.$key); |
&Apache::lonnet::delenv('course.'.$env{'request.course.id'}.'.'.$key); |
$storehash{$key} = ''; |
$storehash{$key} = ''; |
} |
} |