version 1.308, 2008/06/09 22:34:55
|
version 1.309, 2008/09/04 17:07:28
|
Line 949 sub group_import {
|
Line 949 sub group_import {
|
} |
} |
|
|
sub breadcrumbs { |
sub breadcrumbs { |
my ($where)=@_; |
my ($where,$allowed,$type)=@_; |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
my (@folders); |
my (@folders); |
if ($env{'form.pagepath'}) { |
if ($env{'form.pagepath'}) { |
Line 966 sub breadcrumbs {
|
Line 966 sub breadcrumbs {
|
my $is_random_order=0; |
my $is_random_order=0; |
while (@folders) { |
while (@folders) { |
my $folder=shift(@folders); |
my $folder=shift(@folders); |
my $foldername=shift(@folders); |
my $foldername=shift(@folders); |
if ($folderpath) {$folderpath.='&';} |
if ($folderpath) {$folderpath.='&';} |
$folderpath.=$folder.'&'.$foldername; |
$folderpath.=$folder.'&'.$foldername; |
my $url='/adm/coursedocs?folderpath='. |
my $url='/adm/coursedocs?folderpath='. |
Line 982 sub breadcrumbs {
|
Line 982 sub breadcrumbs {
|
if ($2) { $ishidden=1; } |
if ($2) { $ishidden=1; } |
if ($3) { $isencrypted=1; } |
if ($3) { $isencrypted=1; } |
if ($4 ne '') { $is_random_order = 1; } |
if ($4 ne '') { $is_random_order = 1; } |
|
if ($folder eq 'supplemental') { |
|
if ($allowed) { |
|
$name = &mt('Supplemental '.$type.' Documents'); |
|
} else { |
|
$name = &mt($type.' Documents'); |
|
} |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{'href'=>$url.$cpinfo, |
{'href'=>$url.$cpinfo, |
'title'=>$name, |
'title'=>$name, |
Line 1370 sub handle_edit_cmd {
|
Line 1377 sub handle_edit_cmd {
|
} |
} |
|
|
sub editor { |
sub editor { |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$which)=@_; |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_; |
|
|
my $container= ($env{'form.pagepath'}) ? 'page' |
my $container= ($env{'form.pagepath'}) ? 'page' |
: 'sequence'; |
: 'sequence'; |
Line 1387 sub editor {
|
Line 1394 sub editor {
|
} |
} |
|
|
my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)= |
my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)= |
&breadcrumbs($folder); |
&breadcrumbs($folder,$allowed,$type); |
$r->print($breadcrumbtrail); |
$r->print($breadcrumbtrail); |
|
|
# ------------------------------------------------------------ Process commands |
# ------------------------------------------------------------ Process commands |
Line 1489 sub editor {
|
Line 1496 sub editor {
|
$r->print('<tr><td>'.&mt('Currently no documents.').'</td></tr>'); |
$r->print('<tr><td>'.&mt('Currently no documents.').'</td></tr>'); |
} |
} |
$r->print("\n</table>\n"); |
$r->print("\n</table>\n"); |
|
|
&print_paste_buffer($r,$container); |
&print_paste_buffer($r,$container); |
return; |
return; |
} |
} |
Line 2476 sub handler {
|
Line 2482 sub handler {
|
if ($env{'form.pagepath'}) { |
if ($env{'form.pagepath'}) { |
$env{'form.folderpath'}=''; |
$env{'form.folderpath'}=''; |
} |
} |
|
if ($env{'form.folderpath'} =~ /^supplemental_\d+/) { |
|
$env{'form.folderpath'} = 'supplemental&'. |
|
&escape(&mt('Supplemental '.$type.' Documents')).'&'. |
|
$env{'form.folderpath'}; |
|
} |
&Apache::loncommon::store_course_settings('docs_folderpath', |
&Apache::loncommon::store_course_settings('docs_folderpath', |
{'pagepath' => 'scalar', |
{'pagepath' => 'scalar', |
'folderpath' => 'scalar'}); |
'folderpath' => 'scalar'}); |
Line 2740 ENDCOURSEVERIFY
|
Line 2751 ENDCOURSEVERIFY
|
} |
} |
$hadchanges=0; |
$hadchanges=0; |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed, |
$upload_output); |
$upload_output,$type); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
Line 2986 ENDBLOCK
|
Line 2997 ENDBLOCK
|
$folder='supplemental'; |
$folder='supplemental'; |
} |
} |
if ($folder =~ /^supplemental$/ && |
if ($folder =~ /^supplemental$/ && |
$env{'form.folderpath'} =~ /^default\&/) { |
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { |
$env{'form.folderpath'}='supplemental&'. |
$env{'form.folderpath'} = 'supplemental&'. |
&escape(&mt('Supplemental '.$type.' Documents')); |
&escape(&mt('Supplemental '.$type.' Documents')); |
} |
} |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |