version 1.380, 2009/07/14 12:27:52
|
version 1.381, 2009/07/14 17:33:43
|
Line 1273 sub print_paste_buffer {
|
Line 1273 sub print_paste_buffer {
|
my ($r,$container) = @_; |
my ($r,$container) = @_; |
return if (!defined($env{'docs.markedcopy_url'})); |
return if (!defined($env{'docs.markedcopy_url'})); |
|
|
$r->print(<<ENDPASTE); |
$r->print('<fieldset>' |
<form name="pasteform" action="/adm/coursedocs" method="post"><p> |
.'<legend>'.&mt('Clipboard').'</legend>' |
ENDPASTE |
.'<form name="pasteform" action="/adm/coursedocs" method="post">' |
$r->print('<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> '); |
.'<input type="submit" name="pastemarked" value="'.&mt('Paste').'" /> ' |
|
); |
|
|
my $type; |
my $type; |
if ($env{'docs.markedcopy_url'} =~ m{^(?:/adm/wrapper/ext|(?:http|https)(?::|:))//} ) { |
if ($env{'docs.markedcopy_url'} =~ m{^(?:/adm/wrapper/ext|(?:http|https)(?::|:))//} ) { |
Line 1305 ENDPASTE
|
Line 1306 ENDPASTE
|
<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" /> |
<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" /> |
'); |
'); |
} |
} |
$r->print('</p></form>'); |
$r->print('</form></fieldset>'); |
} |
} |
|
|
sub do_paste_from_buffer { |
sub do_paste_from_buffer { |
Line 1588 sub editor {
|
Line 1589 sub editor {
|
my $idx=0; |
my $idx=0; |
my $shown=0; |
my $shown=0; |
if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) { |
if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) { |
$r->print('<p>'.&mt('Parameters').':<ul>'. |
$r->print('<div class="LC_Box">'. |
($randompick>=0?'<li>'.&mt('randomly pick [_1] resources',$randompick).'</li>':''). |
'<p>'.&mt('Parameters:'). |
|
'<ul>'. |
|
($randompick>=0?'<li>'.&mt('randomly pick [quant,_1,resource]',$randompick).'</li>':''). |
($ishidden?'<li>'.&mt('contents hidden').'</li>':''). |
($ishidden?'<li>'.&mt('contents hidden').'</li>':''). |
($isencrypted?'<li>'.&mt('URLs hidden').'</li>':''). |
($isencrypted?'<li>'.&mt('URLs hidden').'</li>':''). |
|
($is_random_order?'<li>'.&mt('random order').'</li>':''). |
'</ul></p>'); |
'</ul></p>'); |
|
if ($randompick>=0) { |
|
$r->print('<p class="LC_warning">' |
|
.&mt('Caution: this folder is set to randomly pick a subset' |
|
.' of resources. Adding or removing resources from this' |
|
.' folder will change the set of resources that the' |
|
.' students see, resulting in spurious or missing credit' |
|
.' for completed problems, not limited to ones you' |
|
.' modify. Do not modify the contents of this folder if' |
|
.' it is in active student use.') |
|
.'</p>' |
|
); |
|
} |
|
if ($is_random_order) { |
|
$r->print('<p class="LC_warning">' |
|
.&mt('Caution: this folder is set to randomly order its' |
|
.' contents. Adding or removing resources from this folder' |
|
.' will change the order of resources shown.') |
|
.'</p>' |
|
); |
|
} |
|
$r->print('</div>'); |
} |
} |
if ($randompick>=0) { |
|
$r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>'); |
my $output; |
} |
|
if ($is_random_order) { |
|
$r->print('<p>'.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown.').'</p>'); |
|
} |
|
$r->print(&Apache::loncommon::start_data_table()); |
|
foreach my $res (@LONCAPA::map::order) { |
foreach my $res (@LONCAPA::map::order) { |
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); |
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); |
$name=&LONCAPA::map::qtescape($name); |
$name=&LONCAPA::map::qtescape($name); |
$url=&LONCAPA::map::qtescape($url); |
$url=&LONCAPA::map::qtescape($url); |
unless ($name) { $name=(split(/\//,$url))[-1]; } |
unless ($name) { $name=(split(/\//,$url))[-1]; } |
unless ($name) { $idx++; next; } |
unless ($name) { $idx++; next; } |
$r->print(&entryline($idx,$name,$url,$folder,$allowed,$res, |
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$coursenum)); |
$coursenum); |
$idx++; |
$idx++; |
$shown++; |
$shown++; |
} |
} |
unless ($shown) { |
if ($shown) { |
$r->print('<tr><td><p class="LC_info">' |
$r->print(&Apache::loncommon::start_data_table() |
.&mt('Currently no documents.') |
.&Apache::loncommon::start_data_table_header_row() |
.'</p></td></tr>'); |
.'<th colspan="2">'.&mt('Move').'</th>' |
|
.'<th>'.&mt('Actions').'</th>' |
|
.'<th colspan="2">'.&mt('Document').'</th>' |
|
.'<th colspan="4">'.&mt('Settings').'</th>' |
|
.&Apache::loncommon::end_data_table_header_row() |
|
.$output |
|
.&Apache::loncommon::end_data_table() |
|
) |
|
} else { |
|
$r->print('<p class="LC_info">' |
|
.&mt('Currently no documents.') |
|
.'</p>' |
|
); |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
|
if ($allowed) { |
if ($allowed) { |
&print_paste_buffer($r,$container); |
&print_paste_buffer($r,$container); |
} |
} |