Diff for /loncom/interface/lonmenu.pm between versions 1.394 and 1.399

version 1.394, 2012/11/29 20:05:00 version 1.399, 2012/12/22 14:57:20
Line 487  sub innerregister { Line 487  sub innerregister {
                 }                  }
                 my $trail;                  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) =                      ($trail) =
                         &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);                          &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
                 } else {                  } else {
Line 501  sub innerregister { Line 500  sub innerregister {
                 }                  }
                 return $trail;                  return $trail;
             }              }
             &Apache::lonhtmlcommon::clear_breadcrumbs();              unless ($env{'request.state'} eq 'construct') {
             &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 523  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 574  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 750  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 844  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 911  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) || ($resurl ne '/adm/supplemental')) {              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'}),'<>&"'));

Removed from v.1.394  
changed lines
  Added in v.1.399


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>