version 1.393, 2012/11/27 23:45:08
|
version 1.400, 2012/12/26 23:50:26
|
Line 485 sub innerregister {
|
Line 485 sub innerregister {
|
if ($env{'form.title'}) { |
if ($env{'form.title'}) { |
$title = $env{'form.title'}; |
$title = $env{'form.title'}; |
} |
} |
|
my $trail; |
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
my $editbutton = |
&prepare_functions($resurl,$forcereg,$group,undef,undef,1); |
&prepare_functions($resurl,$forcereg,$group,undef,undef,1); |
($trail) = |
my ($trail) = |
|
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
return $trail; |
|
} else { |
} else { |
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{text => "Supplemental $crstype Content", |
{text => "Supplemental $crstype Content", |
href => "javascript:gopost('/adm/supplemental','')"}); |
href => "javascript:gopost('/adm/supplemental','')"}); |
$title = &mt('View Resource'); |
$title = &mt('View Resource'); |
return &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
($trail) = |
|
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
} |
} |
|
return $trail; |
|
} |
|
unless ($env{'request.state'} eq 'construct') { |
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb({text => 'View Resource'}); |
} |
} |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb({text => 'View Resource'}); |
|
} |
} |
} elsif (! $const_space){ |
} elsif (! $const_space){ |
#a situation when we're looking at a resource outside of context of a |
#a situation when we're looking at a resource outside of context of a |
Line 521 sub innerregister {
|
Line 524 sub innerregister {
|
$editbutton = &prepare_functions($resurl,$forcereg,$group); |
$editbutton = &prepare_functions($resurl,$forcereg,$group); |
} |
} |
if ($editbutton eq '') { |
if ($editbutton eq '') { |
&clear(6,1); |
$editbutton = &clear(6,1); |
} |
} |
|
|
# |
# |
Line 572 sub innerregister {
|
Line 575 sub innerregister {
|
# |
# |
if (($env{'request.symb'}=~/^uploaded/) && ($perms{'mdc'})) { |
if (($env{'request.symb'}=~/^uploaded/) && ($perms{'mdc'})) { |
my $text = 'Edit Folder'; |
my $text = 'Edit Folder'; |
if ($mapurl =~ /\.page$/) { |
if (($mapurl =~ /\.page$/) || |
|
($env{'request.symb'}=~ |
|
m{uploaded/$cdom/$cnum/default_\d+\.page$})) { |
$text = 'Edit Page'; |
$text = 'Edit Page'; |
} |
} |
&switch('','',7,4,'docs-22x22.png',$text,'parms[_2]', |
&switch('','',7,4,'docs-22x22.png',$text,'parms[_2]', |
Line 748 ENDMENUITEMS
|
Line 753 ENDMENUITEMS
|
|
|
sub get_editbutton { |
sub get_editbutton { |
my ($cfile,$home,$switchserver,$forceedit,$forceview,$forcereg) = @_; |
my ($cfile,$home,$switchserver,$forceedit,$forceview,$forcereg) = @_; |
my $jscall = |
my $jscall; |
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver, |
if (($forceview) && ($env{'form.todocs'})) { |
|
my ($folderpath,$command); |
|
if ($env{'request.symb'}) { |
|
$folderpath = &Apache::loncommon::symb_to_docspath($env{'request.symb'}); |
|
} elsif ($env{'form.folderpath'} =~ /^supplemental/) { |
|
$folderpath = $env{'form.folderpath'}; |
|
$command = '&forcesupplement=1'; |
|
} |
|
$folderpath = &escape(&HTML::Entities::encode(&escape($folderpath),'<>&"')); |
|
$jscall = "go('/adm/coursedocs?folderpath=$folderpath$command')"; |
|
} else { |
|
$jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver, |
$forceedit,$forcereg,$env{'request.symb'}, |
$forceedit,$forcereg,$env{'request.symb'}, |
&escape($env{'form.folderpath'}), |
&escape($env{'form.folderpath'}), |
&escape($env{'form.title'}),$env{'form.idx'}, |
&escape($env{'form.title'}),$env{'form.idx'}, |
&escape($env{'form.suppurl'})); |
&escape($env{'form.suppurl'},$env{'form.todocs'})); |
|
} |
if ($jscall) { |
if ($jscall) { |
my $icon = 'pcstr.png'; |
my $icon = 'pcstr.png'; |
my $label = 'Edit'; |
my $label = 'Edit'; |
Line 842 sub prepare_functions {
|
Line 859 sub prepare_functions {
|
$forceedit,$forceview,$forcereg, |
$forceedit,$forceview,$forcereg, |
$env{'form.title'},$env{'form.suppurl'}); |
$env{'form.title'},$env{'form.suppurl'}); |
} |
} |
} elsif ($resurl !~ m{^adm/($match_domain)/($match_username)/aboutme$}) { |
} elsif ($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) { |
if ($env{'request.filename'}) { |
if ($env{'request.filename'}) { |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
Line 909 sub prepare_functions {
|
Line 926 sub prepare_functions {
|
(&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) && |
(&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) && |
(($resurl =~ m{^/adm/wrapper/ext/}) || |
(($resurl =~ m{^/adm/wrapper/ext/}) || |
($resurl =~ m{^/uploaded/$cdom/$cnum/supplemental/}) || |
($resurl =~ m{^/uploaded/$cdom/$cnum/supplemental/}) || |
($resurl eq '/adm/supplemental'))) { |
($resurl eq '/adm/supplemental') || |
|
($resurl =~ m{^/public/$cdom/$cnum/syllabus$}) || |
|
($resurl =~ m{^/adm/$match_domain/$match_username/aboutme$}))) { |
my @folders=split('&',$env{'form.folderpath'}); |
my @folders=split('&',$env{'form.folderpath'}); |
if (@folders > 2) { |
if ((@folders > 2) || ($resurl ne '/adm/supplemental')) { |
my $esc_path=&escape(&HTML::Entities::encode(&escape($env{'form.folderpath'}),'<>&"')); |
my $esc_path=&escape(&HTML::Entities::encode(&escape($env{'form.folderpath'}),'<>&"')); |
&switch('','',7,4,'docs-22x22.png','Edit Folder','parms[_2]', |
&switch('','',7,4,'docs-22x22.png','Edit Folder','parms[_2]', |
"location.href='/adm/coursedocs?command=direct&forcesupplement=1&supppath=$esc_path'", |
"location.href='/adm/coursedocs?command=direct&forcesupplement=1&supppath=$esc_path'", |
Line 2003 BEGIN {
|
Line 2022 BEGIN {
|
$category_names{$entries[2]}=$entries[3]; |
$category_names{$entries[2]}=$entries[3]; |
} elsif ($configline=~/^prim\:/) { |
} elsif ($configline=~/^prim\:/) { |
my @entries = (split(/\:/, $configline))[1..5]; |
my @entries = (split(/\:/, $configline))[1..5]; |
push @primary_menu, \@entries; |
push(@primary_menu,\@entries); |
} elsif ($configline=~/^primsub\:/) { |
} elsif ($configline=~/^primsub\:/) { |
my ($parent,@entries) = (split(/\:/, $configline))[1..4]; |
my ($parent,@entries) = (split(/\:/, $configline))[1..4]; |
push (@{$primary_submenu{$parent}},\@entries); |
push(@{$primary_submenu{$parent}},\@entries); |
} elsif ($configline=~/^scnd\:/) { |
} elsif ($configline=~/^scnd\:/) { |
my @entries = (split(/\:/, $configline))[1..5]; |
my @entries = (split(/\:/, $configline))[1..5]; |
push @secondary_menu, \@entries; |
push(@secondary_menu,\@entries); |
} elsif ($configline) { |
} elsif ($configline) { |
push(@desklines,$configline); |
push(@desklines,$configline); |
} |
} |