Diff for /loncom/interface/lonmenu.pm between versions 1.457 and 1.463

version 1.457, 2016/10/27 21:06:13 version 1.463, 2016/11/29 03:01:04
Line 624  sub build_submenu { Line 624  sub build_submenu {
 }  }
   
 sub innerregister {  sub innerregister {
     my ($forcereg,$bread_crumbs,$group) = @_;      my ($forcereg,$bread_crumbs,$group,$pagebuttonshide) = @_;
     my $const_space = ($env{'request.state'} eq 'construct');      my $const_space = ($env{'request.state'} eq 'construct');
     my $is_const_dir = 0;      my $is_const_dir = 0;
   
Line 746  sub innerregister { Line 746  sub innerregister {
         $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};          $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
         $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};          $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
         $perms{'mdc'} = &Apache::lonnet::allowed('mdc',$env{'request.course.id'});          $perms{'mdc'} = &Apache::lonnet::allowed('mdc',$env{'request.course.id'});
           $perms{'cev'} = &Apache::lonnet::allowed('cev',$env{'request.course.id'});
         my @privs;          my @privs;
         if ($env{'request.symb'} ne '') {          if ($env{'request.symb'} ne '') {
              if ($env{'request.filename'}=~/$LONCAPA::assess_re/) {               if ($env{'request.filename'}=~/$LONCAPA::assess_re/) {
Line 785  sub innerregister { Line 786  sub innerregister {
 #  #
 # This applies to items inside a folder/page modifiable in the course.  # This applies to items inside a folder/page modifiable in the course.
 #  #
         if (($env{'request.symb'}=~/^uploaded/) && ($perms{'mdc'})) {          if (($env{'request.symb'}=~/^uploaded/) && (($perms{'mdc'}) || ($perms{'cev'}))) {
             my $text = 'Edit Folder';              my $text = 'Edit Folder';
             if (($mapurl =~ /\.page$/) ||              if (($mapurl =~ /\.page$/) ||
                 ($env{'request.symb'}=~                  ($env{'request.symb'}=~
Line 969  ENDMENUITEMS Line 970  ENDMENUITEMS
  foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }   foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} }
   
     if ($addremote) {      if ($addremote) {
         my $countdown;          my ($countdown,$buttonshide);
         if ($env{'request.filename'} =~ /\.page$/) {          if ($env{'request.filename'} =~ /\.page$/) {
             my %breadcrumb_tools = &Apache::lonhtmlcommon::current_breadcrumb_tools();              my %breadcrumb_tools = &Apache::lonhtmlcommon::current_breadcrumb_tools();
             if (ref($breadcrumb_tools{'tools'}) eq 'ARRAY') {              if (ref($breadcrumb_tools{'tools'}) eq 'ARRAY') {
                 $countdown = $breadcrumb_tools{'tools'}[0];                  $countdown = $breadcrumb_tools{'tools'}->[0];
             }              }
               $buttonshide = $pagebuttonshide;
         } else {          } else {
             $countdown = &countdown_timer();              $countdown = &countdown_timer();
               $buttonshide = &hidden_button_check();
         }          }
         &Apache::lonhtmlcommon::clear_breadcrumb_tools();          &Apache::lonhtmlcommon::clear_breadcrumb_tools();
   
             &Apache::lonhtmlcommon::add_breadcrumb_tool(              &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'navigation', @inlineremote[21,23]);                  'navigation', @inlineremote[21,23]);
   
         if (&hidden_button_check() eq 'yes') {          if ($buttonshide eq 'yes') {
             if ($countdown) {              if ($countdown) {
                 &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);                  &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);
             }              }
Line 1032  sub get_editbutton { Line 1035  sub get_editbutton {
     my ($cfile,$home,$switchserver,$forceedit,$forceview,$forcereg) = @_;      my ($cfile,$home,$switchserver,$forceedit,$forceview,$forcereg) = @_;
     my $jscall;      my $jscall;
     if (($forceview) && ($env{'form.todocs'})) {      if (($forceview) && ($env{'form.todocs'})) {
         my ($folderpath,$command);          my ($folderpath,$command,$navmap);
         if ($env{'request.symb'}) {          if ($env{'request.symb'}) {
             $folderpath = &Apache::loncommon::symb_to_docspath($env{'request.symb'});              $folderpath = &Apache::loncommon::symb_to_docspath($env{'request.symb'},\$navmap);
         } elsif ($env{'form.folderpath'} =~ /^supplemental/) {          } elsif ($env{'form.folderpath'} =~ /^supplemental/) {
             $folderpath = $env{'form.folderpath'};              $folderpath = $env{'form.folderpath'};
             $command = '&forcesupplement=1';              $command = '&forcesupplement=1';
Line 1042  sub get_editbutton { Line 1045  sub get_editbutton {
         $folderpath = &escape(&HTML::Entities::encode(&escape($folderpath),'<>&"'));          $folderpath = &escape(&HTML::Entities::encode(&escape($folderpath),'<>&"'));
         $jscall = "go('/adm/coursedocs?folderpath=$folderpath$command')";          $jscall = "go('/adm/coursedocs?folderpath=$folderpath$command')";
     } else {      } else {
           my $suppanchor;
           if ($env{'form.folderpath'}) {
               $suppanchor = $env{'form.anchor'};
           }
         $jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver,          $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'},$env{'form.todocs'}));                                                  &escape($env{'form.suppurl'}),$env{'form.todocs'},
                                                   $suppanchor);
     }      }
     if ($jscall) {      if ($jscall) {
         my $icon = 'pcstr.png';          my $icon = 'pcstr.png';
Line 1203  sub prepare_functions { Line 1211  sub prepare_functions {
              ($resurl =~ m{^/adm/$match_domain/$match_username/aboutme$}))) {               ($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 $suppanchor;
                   if ($resurl =~ m{^/adm/wrapper/ext/}) {
                       $suppanchor = $env{'form.anchor'};
                   }
                 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&amp;forcesupplement=1&amp;supppath=$esc_path'",                          "location.href='/adm/coursedocs?command=direct&amp;forcesupplement=1&amp;supppath=$esc_path&amp;anchor=$suppanchor'",
                         'Folder/Page Content');                          'Folder/Page Content');
             }              }
         }          }
Line 2230  sub roles_selector { Line 2242  sub roles_selector {
                     $include = 1;                       $include = 1; 
                 }                  }
                 if ($include) {                  if ($include) {
                       my $rolename;
                       if ($role =~ m{^cr/$cdom/$cdom\-domainconfig/(\w+)(?:/\w+|$)}) {
                           $rolename = &mt('Helpdesk [_1]',$1);
                       } else {
                           $rolename = &Apache::lonnet::plaintext($role);
                       }
                     push(@submenu,['javascript:adhocRole('."'$role'".')',                      push(@submenu,['javascript:adhocRole('."'$role'".')',
                                    &Apache::lonnet::plaintext($role)]);                                     $rolename]);
                 }                  }
             }              }
         }          }
Line 2540  sub required_privs { Line 2558  sub required_privs {
              '/adm/parmset'      => 'opa,vpa',               '/adm/parmset'      => 'opa,vpa',
              '/adm/courseprefs'  => 'opa,vpa',               '/adm/courseprefs'  => 'opa,vpa',
              '/adm/whatsnew'     => 'whn',               '/adm/whatsnew'     => 'whn',
              '/adm/populate'     => 'cst',               '/adm/populate'     => 'cst,vpa,vcl',
              '/adm/trackstudent' => 'vsa',               '/adm/trackstudent' => 'vsa',
              '/adm/statistics'   => 'mgr,vgr',               '/adm/statistics'   => 'mgr,vgr',
              '/adm/setblock'     => 'dcm,vcb',               '/adm/setblock'     => 'dcm,vcb',

Removed from v.1.457  
changed lines
  Added in v.1.463


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