version 1.100, 2013/01/15 14:14:31
|
version 1.102, 2013/06/10 03:12:24
|
Line 36 use strict;
|
Line 36 use strict;
|
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon(); |
use Apache::loncommon(); |
|
use Apache::lonhtmlcommon; |
use Apache::lonxml(); |
use Apache::lonxml(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonmenu; |
use Apache::lonmenu; |
Line 264 ENDEXT
|
Line 265 ENDEXT
|
my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$src); |
my $symb=&Apache::lonnet::encode_symb($hash{'map_id_'.$mapid},$resid,$src); |
|
|
my $prefix=$_.'_'; |
my $prefix=$_.'_'; |
|
my $idprefix= join('_',($mapid,$resid,'')); |
my %posthash=('request.prefix' => $prefix, |
my %posthash=('request.prefix' => $prefix, |
'LONCAPA_INTERNAL_no_discussion' => 'true', |
'LONCAPA_INTERNAL_no_discussion' => 'true', |
'symb' => $symb); |
'symb' => $symb); |
Line 369 ENDEXT
|
Line 371 ENDEXT
|
} |
} |
$output=~ |
$output=~ |
s/\<((?:input|select|button|textarea)[^\>]+)name\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 name="$prefix$2" $3\>/gsi; |
s/\<((?:input|select|button|textarea)[^\>]+)name\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 name="$prefix$2" $3\>/gsi; |
|
$output=~ |
|
s/\<((?:input|select|button|textarea)[^\>]+)id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\>]*)\>/\<$1 id="$idprefix$2" $3\>/gsi; |
if ($nuploads) { |
if ($nuploads) { |
$output=~ |
$output=~ |
s/\<(input[^\>]+name=\"\Q$prefix\EHWFILE[^\>]+)\s*id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\)]*)\>/\<$1 id="$prefix$2" $3\>/gsi; |
s/\<(input[^\>]+name=\"\Q$prefix\EHWFILE[^\>]+)\s*id\s*\=\s*[\'\"]*([^\'\"]+)[\'\"]*([^\)]*)\>/\<$1 id="$prefix$2" $3\>/gsi; |
Line 431 ENDEXT
|
Line 435 ENDEXT
|
if (($nforms) && ($nuploads)) { |
if (($nforms) && ($nuploads)) { |
$allscript .= &Apache::lonhtmlcommon::file_submissionchk_js(\%turninpaths,\%multiresps); |
$allscript .= &Apache::lonhtmlcommon::file_submissionchk_js(\%turninpaths,\%multiresps); |
} |
} |
|
if (($nforms) && (&Apache::lonhtmlcommon::htmlareabrowser())) { |
|
my %textarea_args = ( |
|
dragmath => 'math', |
|
); |
|
$allscript .= &Apache::lonhtmlcommon::htmlareaselectactive(\%textarea_args); |
|
} |
# ------------------------------------------------------------------ Start body |
# ------------------------------------------------------------------ Start body |
$r->print(&Apache::loncommon::start_page(undef,$allscript, |
$r->print(&Apache::loncommon::start_page(undef,$allscript, |
{'force_register' => 1, |
{'force_register' => 1, |
Line 480 ENDEXT
|
Line 490 ENDEXT
|
my $avespan=$lcm/($#colcont+1); |
my $avespan=$lcm/($#colcont+1); |
for ($j=0;$j<=$#colcont;$j++) { |
for ($j=0;$j<=$#colcont;$j++) { |
my $rid=$colcont[$j]; |
my $rid=$colcont[$j]; |
|
|
my $metainfo =&get_buttons(\%hash,$rid).'<br />'; |
my $metainfo =&get_buttons(\%hash,$rid).'<br />'; |
unless (($target eq 'tex') || ($target eq 'tex_answer')) { |
unless (($target eq 'tex') || ($target eq 'tex_answer')) { |
$r->print('<td colspan="'.$avespan.'"'); |
$r->print('<td colspan="'.$avespan.'"'); |
Line 658 sub get_buttons {
|
Line 667 sub get_buttons {
|
'</a>'; |
'</a>'; |
} |
} |
} |
} |
|
if (($env{'request.course.id'}) && (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $file=&Apache::lonnet::declutter($hash->{'src_'.$rid}); |
|
my ($cfile,$home,$switchserver,$forceedit,$forceview) = |
|
&Apache::lonnet::can_edit_resource($file,$cnum,$cdom,$hash->{'src_'.$rid},$symb); |
|
if ($cfile ne '') { |
|
my $jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver, |
|
$forceedit,1,$symb,undef, |
|
&escape($env{'form.title'})); |
|
if ($jscall) { |
|
my $icon = 'pcstr.png'; |
|
my $label = &mt('Edit'); |
|
my $title = &mt('Edit this resource'); |
|
my $pic = '<img src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$icon).'"'. |
|
' class="LC_icon" alt="'.$label.'" title="'.$title.'" />'; |
|
$metainfo .= ' <a href="javascript:'.$jscall.';">'.$pic.'</a>'; |
|
} |
|
} |
|
} |
return $metainfo; |
return $metainfo; |
} |
} |
|
|