Diff for /loncom/interface/lonmenu.pm between versions 1.542 and 1.561

version 1.542, 2023/11/19 21:28:17 version 1.561, 2025/02/21 04:29:26
Line 366  sub primary_menu { Line 366  sub primary_menu {
                              ($item->[2] eq 'blog')) &&                               ($item->[2] eq 'blog')) &&
                              (!&Apache::lonnet::usertools_access('','',$item->[2],                               (!&Apache::lonnet::usertools_access('','',$item->[2],
                                                            undef,'tools')));                                                             undef,'tools')));
                       if (($item->[2] eq 'browsepub') && ($item->[0] eq '/res/')) {
                           if ($env{'request.role'} =~ /^au\./) {
                               $item->[0] .= $env{'request.role.domain'}.'/?launch=1';
                           } elsif ($env{'request.role'} =~ m{^ca\./($match_domain)/($match_username)$}) {
                               $item->[0] .= $1.'/'.$2.'/?launch=1';
                           } elsif (&Apache::lonnet::allowed('bre',$env{'user.domain'})) {
                               $item->[0] .= $env{'user.domain'}.'/?launch=1';
                           } elsif (&Apache::lonnet::allowed('bro','/res/')) {
                               $item->[0] .= '?launch=1';
                           } else {
                               next;
                           }
                       }
                     if ($env{'request.course.id'} && $menucoll) {                      if ($env{'request.course.id'} && $menucoll) {
                         next if ($item->[3]) && (!$menuopts{$item->[3]});                          next if ($item->[3]) && (!$menuopts{$item->[3]});
                     }                      }
Line 602  sub secondary_menu { Line 615  sub secondary_menu {
                 && !$env{'request.course.id'};                  && !$env{'request.course.id'};
         next if    $$menuitem[4]   =~ /^crsedit/          next if    $$menuitem[4]   =~ /^crsedit/
                 && (!$canedit && !$canvieweditor);                  && (!$canedit && !$canvieweditor);
           next if    $$menuitem[4]  eq 'crseditCourse'
                   && ($crstype eq 'Community');
           next if    $$menuitem[4]  eq 'crseditCommunity'
                   && ($crstype ne 'Community');
         next if    $$menuitem[4]  eq 'nvgr'          next if    $$menuitem[4]  eq 'nvgr'
                 && ($canvgr || $ltiexc{'grades'});                  && ($canvgr || $ltiexc{'grades'});
         next if    $$menuitem[4]  eq 'vgr'          next if    $$menuitem[4]  eq 'vgr'
Line 800  sub create_submenu { Line 817  sub create_submenu {
     my $menu = '<li class="LC_hoverable '.$addclass.'">'.      my $menu = '<li class="LC_hoverable '.$addclass.'">'.
                '<a href="'.$link.'"'.$targetattr.'>'.                 '<a href="'.$link.'"'.$targetattr.'>'.
                '<span class="LC_nobreak">'.$title.                 '<span class="LC_nobreak">'.$title.
                '<span class="LC_fontsize_small" style="font-weight:normal;">'.                 '<span class="LC_fontsize_medium" style="font-weight:normal;">'.
                ' &#9660;</span></span></a>'.                 ' &#9660;</span></span></a>'.
                '<ul>';                 '<ul>';
   
Line 897  sub innerregister { Line 914  sub innerregister {
     my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname,      my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname,
         $ltiscope,$ltiuri,$showncrumbsref) = @_;          $ltiscope,$ltiuri,$showncrumbsref) = @_;
     my $const_space = ($env{'request.state'} eq 'construct');      my $const_space = ($env{'request.state'} eq 'construct');
     my $is_const_dir = 0;      my $in_daxe = 0;
   
     if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; }      if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { return ''; }
   
Line 1093  sub innerregister { Line 1110  sub innerregister {
             if ($perms{'mgr'}) {              if ($perms{'mgr'}) {
                 &switch('','',7,2,'pgrd.png','Content Grades','grades[_4]',                  &switch('','',7,2,'pgrd.png','Content Grades','grades[_4]',
                         "gocmd('/adm/grades','gradingmenu')",                          "gocmd('/adm/grades','gradingmenu')",
                         'Content Grades');                          'Grading for Resource/Folder');
             } elsif ($perms{'vgr'}) {              } elsif ($perms{'vgr'}) {
                 &switch('','',7,2,'subm.png','Content Submissions','missions[_1]',                  &switch('','',7,2,'subm.png','Content Submissions','missions[_1]',
                         "gocmd('/adm/grades','submission')",                          "gocmd('/adm/grades','submission')",
                         'Content Submissions');                          'Submissions for Resource/Folder');
              }               }
         }          }
         if (($env{'request.symb'} ne '') && (($perms{'opa'}) || ($perms{'vpa'}))) {          if (($env{'request.symb'} ne '') && (($perms{'opa'}) || ($perms{'vpa'}))) {
             &switch('','',7,3,'pparm.png','Content Settings','parms[_2]',              &switch('','',7,3,'pparm.png','Content Settings','parms[_2]',
                     "gocmd('/adm/parmset','set')",                      "gocmd('/adm/parmset','set')",
                     'Content Settings');                      'Content Settings for Resource/Folder');
  }   }
 # End grades/submissions check  # End grades/submissions check
   
Line 1130  sub innerregister { Line 1147  sub innerregister {
         if (($env{'request.symb'} ne '') &&          if (($env{'request.symb'} ne '') &&
             ($env{'request.filename'}=~/$LONCAPA::assess_re/) &&              ($env{'request.filename'}=~/$LONCAPA::assess_re/) &&
             (($perms{'mgr'}) || ($perms{'vgr'}))) {              (($perms{'mgr'}) || ($perms{'vgr'}))) {
             my ($viewas,$text,$change,$visibility,$vuname,$vudom,$vid,$leftvis,$defdom,              my ($viewas,$text,$change,$visibility,$vuname,$vudom,$vid,$leftvis,$rightvis,
                 $domselector,$righticon);                  $defdom,$domselector,$righticon);
             my %lt = &Apache::lonlocal::texthash(              my %lt = &Apache::lonlocal::texthash(
                                                  view => 'View',                                                   view => 'View',
                                                  upda => 'Update',                                                   upda => 'Update',
                                                    user => 'View as user',
                                                    choo => 'Choose user',
             );              );
             my $possdomstr = $env{'course.'.$env{'request.course.id'}.'.internal.userdomains'};              my $possdomstr = $env{'course.'.$env{'request.course.id'}.'.internal.userdomains'};
             if ($possdomstr =~ /,/) {              if ($possdomstr =~ /,/) {
Line 1146  sub innerregister { Line 1165  sub innerregister {
                 } elsif (&Apache::lonnet::domain($possdoms[0]) ne '') {                  } elsif (&Apache::lonnet::domain($possdoms[0]) ne '') {
                     $defdom = $possdoms[0];                      $defdom = $possdoms[0];
                 }                  }
                 $domselector = &Apache::loncommon::select_dom_form($defdom,'vudom','','','',\@possdoms);                  $domselector = &Apache::loncommon::select_dom_form($defdom,'vudom','','','',
                                                                      \@possdoms,'','','vudom').
                                  '<span class="LC_visually_hidden"><label for="vudom">'.
                                  &mt("user's domain").'</label></span>';                
             } elsif (($possdomstr ne '') && (&Apache::lonnet::domain($possdomstr) ne '')) {              } elsif (($possdomstr ne '') && (&Apache::lonnet::domain($possdomstr) ne '')) {
                 if ($env{'request.user_in_effect'} =~ /^$match_username:($match_domain)$/) {                  if ($env{'request.user_in_effect'} =~ /^$match_username:($match_domain)$/) {
                     $defdom = $1;                      $defdom = $1;
Line 1164  sub innerregister { Line 1186  sub innerregister {
                 $change = 'off';                  $change = 'off';
                 $visibility = 'inline';                  $visibility = 'inline';
                 $leftvis = 'none';                  $leftvis = 'none';
                   $rightvis = 'inline';
                 $defdom = $vudom;                  $defdom = $vudom;
                 $righticon = '&#10006;';                  $righticon = '&#10006;';
             } else {              } else {
Line 1171  sub innerregister { Line 1194  sub innerregister {
                 $change = 'on';                  $change = 'on';
                 $visibility = 'none';                  $visibility = 'none';
                 $leftvis = 'inline';                  $leftvis = 'inline';
                   $rightvis = 'none';
                   $righticon = '&#9668;';
                 if ($defdom eq '') {                  if ($defdom eq '') {
                     $defdom = $cdom;                      $defdom = $cdom;
                 }                  }
Line 1195  sub innerregister { Line 1220  sub innerregister {
             $input .= '<input name="LC_viewas" type="hidden" value="'.$viewas.'" />',              $input .= '<input name="LC_viewas" type="hidden" value="'.$viewas.'" />',
                       '<input name="symb" type="hidden" value="'.$shownsymb.'" />';                        '<input name="symb" type="hidden" value="'.$shownsymb.'" />';
             my $chooser = <<END;              my $chooser = <<END;
   <span class="LC_visually_hidden">
   <label for="LC_vuname" id="LC_vuidentifier">$lt{'user'}</label>
   </span>
 $selscript  $selscript
 <a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link">  <a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link" id="usexpand" style="display:$leftvis;">
 <span id="usexpand" class="LC_menubuttons_inline_text" style="display:$leftvis">&#9658;&nbsp;</span>  <span class="LC_menubuttons_inline_text">&#9658;&nbsp;</span>
 </a>  </a>
 <fieldset id="LC_selectuser" style="display:$visibility">  <fieldset id="LC_selectuser" style="display:$visibility;"><legend class="LC_visually_hidden">$lt{'choo'}</legend>
 <form name="userview" action="" method="post" onsubmit="event.preventDefault(); return validCourseUser(this,'$change');">  <form name="userview" action="" method="post" onsubmit="event.preventDefault(); return validCourseUser(this,'$change');">
 <span class="LC_menubuttons_inline_text LC_nobreak">  <span class="LC_menubuttons_inline_text LC_nobreak">
 $input  $input
Line 1208  $sellink Line 1236  $sellink
 &nbsp;<input type="submit" value="$text" />  &nbsp;<input type="submit" value="$text" />
 </form>  </form>
 </fieldset>  </fieldset>
 <a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link">  <a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link" id="uscollapse" style="display:$rightvis">
 <span id="uscollapse" class="LC_menubuttons_inline_text">$righticon</span>  <span class="LC_menubuttons_inline_text">$righticon</span>
 </a>  </a>
 END  END
             &switch('','',7,5,'viewuser.png','View As','user[_1]',              &switch('','',7,5,'viewuser.png','View As','user[_1]',
                     'toggleViewAsUser('."'$change'".')',                      'toggleViewAsUser('."'$change'".')',
                     'View As','','',$chooser);                      'View resource as user','','',$chooser);
         }          }
 # End view as user check  # End view as user check
   
Line 1222  END Line 1250  END
 # End course context  # End course context
   
 # Prepare the rest of the buttons  # Prepare the rest of the buttons
         my ($menuitems,$got_prt,$got_wishlist,$crsauthor);      my ($menuitems,$got_prt,$got_wishlist,$crsauthor,$toplevel_cstr,$crsauthor_cstr);
         if ($const_space) {      if ($const_space) {
 #  #
 # We are in construction space  # We are in construction space
 #  #
Line 1231  END Line 1259  END
             my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};              my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
     my ($udom,$uname,$thisdisfn) =      my ($udom,$uname,$thisdisfn) =
  ($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$});   ($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$});
             my $crsauthor;  
             if (($env{'request.course.id'}) &&              if (($env{'request.course.id'}) &&
                 ($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) &&                  ($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) &&
                 ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) {                  ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) {
                 $crsauthor = 1;                  $crsauthor_cstr = 1;
             }              }
             my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn;              my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn;
             if ($currdir =~ m-/$-) {              if ($currdir =~ m-/$-) {
                 $is_const_dir = 1;                  if ($thisdisfn eq '') {
                 if (($thisdisfn eq '') && ($crsauthor)) {                      $toplevel_cstr = 1;
                     $is_const_dir = 2;  
                 }                  }
                 my $esc_currdir = &Apache::loncommon::escape_single($currdir);                  my $esc_currdir = &Apache::loncommon::escape_single($currdir);
                 $menuitems=(<<ENDMENUITEMS);                  $menuitems=(<<ENDMENUITEMS);
Line 1250  s&7&4&docs-22x22.png&Edit Metadata&defau Line 1276  s&7&4&docs-22x22.png&Edit Metadata&defau
 s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','$esc_currdir')&Print contents of directory  s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','$esc_currdir')&Print contents of directory
 s&7&1&del.png&Delete&dir[_3]&gocstr('/adm/cfile?action=delete','$esc_currdir')&Delete this Directory  s&7&1&del.png&Delete&dir[_3]&gocstr('/adm/cfile?action=delete','$esc_currdir')&Delete this Directory
 ENDMENUITEMS  ENDMENUITEMS
                   unless ($crsauthor_cstr) {
                       if (($env{'environment.canarchive'}) &&
                           ($uname eq $env{'user.name'}) && ($udom eq $env{'user.domain'})) {
                           $menuitems .= (<<ENDMENUITEMS);
   s&7&7&archive.png&Export&dir[_1]&gocstr('/adm/cfile?action=archive','$esc_currdir')&Export Authoring Space Archive
   ENDMENUITEMS
                       }
                   }
             } else {              } else {
                 $currdir =~ s|[^/]+$||;                  $currdir =~ s|[^/]+$||;
  my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn);   my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn);
Line 1264  ENDMENUITEMS Line 1298  ENDMENUITEMS
 #  #
 # Probably should be in mydesk.tab  # Probably should be in mydesk.tab
 #  #
                 if (($crsauthor) && ($pubfile eq "/res/$udom/$uname/default.rights")) {                  if (($crsauthor_cstr) && ($pubfile eq "/res/$udom/$uname/default.rights")) {
                     $menuitems=(<<ENDMENUITEMS);                      $menuitems=(<<ENDMENUITEMS);
 s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory  s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory
 s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource  s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource
Line 1286  s&7&4&rename.png&Rename&resource[_5]&goc Line 1320  s&7&4&rename.png&Rename&resource[_5]&goc
 s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource  s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource
 ENDMENUITEMS  ENDMENUITEMS
                 }                  }
                 $menuitems .= (<<ENDMENUITEMS);  #
   # Print only makes sense for certain mime types
   #
                   if ($thisdisfn=~/\.(xml|html|htm|xhtml|xhtm|tex)$/ || $thisdisfn=~/$LONCAPA::assess_re/) {
                       $menuitems .= (<<ENDMENUITEMS);
 s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document  s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document
 ENDMENUITEMS  ENDMENUITEMS
                   }
   #
   # "Exit Daxe" in Functions menu when using Daxe
   #
                   if ((($env{'form.editmode'} eq 'daxe') &&
                        ($thisdisfn=~/\.(xml|html|htm|xhtml|xhtm)$/)) ||
                       (($env{'form.problemmode'} eq 'daxe') &&
                        ($thisdisfn=~/$LONCAPA::assess_re/))) {
                       my %editors = &Apache::loncommon::permitted_editors();
                       if ($editors{'daxe'}) {
                           my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn");
                           $in_daxe = 1;
                           $menuitems .= (<<ENDMENUITEMS);
   my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn");
   s&7&6&tolastloc.png&Exit Daxe&resource[_1]&go('$privfile')&Exit editing this resource
   ENDMENUITEMS
                       }
                   }
               }
   #
   # Editing options usually accessed via "Settings" in inline menu need to be
   # accessed in a different way, when Authoring Space is accessed in course
   # context
   #
               if ($env{'request.role'} !~/^(aa|ca|au)/) {
                   my $privfile = &Apache::loncommon::escape_single("/priv/$udom/$uname/$thisdisfn");
                   $menuitems .= (<<ENDMENUITEMS);
   s&7&5&editops.png&Options&edit[_1]&gocstr('/adm/preferences?action=authorsettings','$privfile')&Authoring Space Options
   ENDMENUITEMS
             }              }
                 if (ref($bread_crumbs) eq 'ARRAY') {                  if (ref($bread_crumbs) eq 'ARRAY') {
                     &Apache::lonhtmlcommon::clear_breadcrumbs();                      &Apache::lonhtmlcommon::clear_breadcrumbs();
Line 1499  ENDMENUITEMS Line 1566  ENDMENUITEMS
             &Apache::lonhtmlcommon::add_breadcrumb_tool(              &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'tools',@tools);                  'tools',@tools);
   
               #exit editing link/icon when using daxe in construction space 
             #publish button in construction space              #publish button in construction space
             if ($env{'request.state'} eq 'construct'){              if ($env{'request.state'} eq 'construct'){
                   if ($in_daxe) {
                       &Apache::lonhtmlcommon::add_breadcrumb_tool(
                            'advtools', $inlineremote[76]);
                   }
                 &Apache::lonhtmlcommon::add_breadcrumb_tool(                  &Apache::lonhtmlcommon::add_breadcrumb_tool(
                      'advtools', $inlineremote[63]);                       'advtools', $inlineremote[63]);
             } else {              } else {
Line 1508  ENDMENUITEMS Line 1580  ENDMENUITEMS
                      'tools', $inlineremote[63]);                       'tools', $inlineremote[63]);
             }              }
             &advtools_crumbs(@inlineremote);              &advtools_crumbs(@inlineremote);
               #options link/icon in constructions space viewed with course role
               if (($env{'request.state'} eq 'construct') &&
                   ($env{'request.role'} !~/^(aa|ca|au)/)) {
                   &Apache::lonhtmlcommon::add_breadcrumb_tool(
                            'advtools', $inlineremote[75]);
               }
         }          }
     } else {      } else {
         if ($showprogress) {          if ($showprogress) {
Line 1518  ENDMENUITEMS Line 1596  ENDMENUITEMS
         }          }
     }      }
     my ($topic_help,$topic_help_text);      my ($topic_help,$topic_help_text);
     if ($is_const_dir == 2) {      if ($toplevel_cstr && !$crsauthor_cstr) {
         if ((($ENV{'SERVER_PORT'} == 443) ||           if ((($ENV{'SERVER_PORT'} == 443) || 
              ($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) &&                ($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) && 
             (&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},'webdav'))) {              (&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},'webdav'))) {
Line 1692  sub prepare_functions { Line 1770  sub prepare_functions {
         } elsif (($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) &&          } elsif (($resurl !~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) &&
                  ($resurl ne '/cgi-bin/printout.pl')) {                   ($resurl ne '/cgi-bin/printout.pl')) {
             if ($env{'request.filename'}) {              if ($env{'request.filename'}) {
                 my $file=&Apache::lonnet::declutter($env{'request.filename'});                  my $file;
                   my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
                   if ($env{'request.filename'} =~ m{^\Q$londocroot\E/priv/}) {
                       $file = $env{'request.filename'};
                       $file =~ s{^\Q$londocroot\E/}{};
                   } else {
                       $file=&Apache::lonnet::declutter($env{'request.filename'});
                   }
                 ($cfile,$home,$switchserver,$forceedit,$forceview) =                  ($cfile,$home,$switchserver,$forceedit,$forceview) =
                     &Apache::lonnet::can_edit_resource($file,$cnum,$cdom,                      &Apache::lonnet::can_edit_resource($file,$cnum,$cdom,
                         &Apache::lonnet::clutter($resurl),$env{'request.symb'},$group);                          &Apache::lonnet::clutter($resurl),$env{'request.symb'},$group);
Line 1834  sub advtools_crumbs { Line 1919  sub advtools_crumbs {
     } elsif ($env{'request.noversionuri'} !~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {      } elsif ($env{'request.noversionuri'} !~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) {
         if ($env{'request.state'} eq 'construct') {          if ($env{'request.state'} eq 'construct') {
             &Apache::lonhtmlcommon::add_breadcrumb_tool(              &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'advtools', @funcs[61,73,74,71,72]);                  'advtools', @funcs[61,73,74,71,72,77]);
         } else {          } else {
             &Apache::lonhtmlcommon::add_breadcrumb_tool(              &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'advtools', @funcs[61,71,72,73,74,75,92]);                  'advtools', @funcs[61,71,72,73,74,75,92]);
Line 1851  sub advtools_crumbs { Line 1936  sub advtools_crumbs {
 sub clear {  sub clear {
     my ($row,$col)=@_;      my ($row,$col)=@_;
     $inlineremote[10*$row+$col]='';      $inlineremote[10*$row+$col]='';
     return '';       return '';
 }  }
   
 # ============================================ Switch a button or create a link  # ============================================ Switch a button or create a link
Line 1862  sub switch { Line 1947  sub switch {
     my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak,$form)=@_;      my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak,$form)=@_;
     $act=~s/\$uname/$uname/g;      $act=~s/\$uname/$uname/g;
     $act=~s/\$udom/$udom/g;      $act=~s/\$udom/$udom/g;
     $top=&mt($top);  
     $bot=&mt($bot);  
     $desc=&mt($desc);      $desc=&mt($desc);
     my $idx=10*$row+$col;      my $idx=10*$row+$col;
     $category_members{$cat}.=':'.$idx;      $category_members{$cat}.=':'.$idx;
   
 # Inline Menu  # Inline Menu
     if ($nobreak==2) { return ''; }      if ($nobreak==2) { return ''; }
     my $text=$top.' '.$bot;      my ($text,$alttext);
       $text=&mt($top).' '.&mt($bot);
     $text=~s/\s*\-\s*//gs;      $text=~s/\s*\-\s*//gs;
       if ($top) {
           $alttext = &mt("$top icon");
       } elsif ($bot) {
           $alttext = &mt("$bot icon");
       } elsif ($nobreak == 3) {
           $alttext = &mt('Go forward icon');
       } elsif ($nobreak) {
           $alttext = &mt('Go back icon');
       } else {
           $alttext = &mt('icon');
       }
   
     my $pic=      my $pic=
    '<img alt="'.$text.'" src="'.     '<img alt="'.$alttext.'" src="'.
    &Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$img).     &Apache::loncommon::lonhttpdurl('/res/adm/pages/'.$img).
    '" align="'.($nobreak==3?'right':'left').'" class="LC_icon" />';     '" align="'.($nobreak==3?'right':'left').'" class="LC_icon" />';
     if ($env{'browser.interface'} eq 'faketextual') {      if ($env{'browser.interface'} eq 'faketextual') {
 # Main Menu  # Main Menu
    if ($nobreak==3) {     if ($nobreak==3) {
        $inlineremote[$idx]="\n".         $inlineremote[$idx]="\n".
    '<td class="LC_menubuttons_text" align="right">'.$text.     '<th class="LC_menubuttons_text" align="right">'.$text.
    '</td><td align="left">'.     '</th><td align="left">'.
    '<a href="javascript:'.$act.';">'.$pic.'</a></td></tr>';     '<a href="javascript:'.$act.';">'.$pic.'</a></td></tr>';
    } elsif ($nobreak) {     } elsif ($nobreak) {
        $inlineremote[$idx]="\n<tr>".         $inlineremote[$idx]="\n<tr>".
    '<td align="left">'.     '<th align="left">'.
    '<a href="javascript:'.$act.';">'.$pic.'</a></td>     '<a href="javascript:'.$act.';">'.$pic.'</a></th>
                     <td class="LC_menubuttons_text" align="left"><a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$text.'</span></a></td>';                      <td class="LC_menubuttons_text" align="left"><a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$text.'</span></a></td>';
    } else {     } else {
        $inlineremote[$idx]="\n<tr>".         $inlineremote[$idx]="\n<tr>".
    '<td align="left">'.     '<th align="left">'.
    '<a href="javascript:'.$act.';">'.$pic.     '<a href="javascript:'.$act.';">'.$pic.
    '</a></td><td class="LC_menubuttons_text" colspan="3">'.     '</a></th><td class="LC_menubuttons_text" colspan="3">'.
    '<a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$desc.'</span></a></td></tr>';     '<a class="LC_menubuttons_link" href="javascript:'.$act.';"><span class="LC_menubuttons_inline_text">'.$desc.'</span></a></td></tr>';
    }     }
     } else {      } else {
Line 1908  sub switch { Line 2003  sub switch {
             $inlineremote[$idx] =              $inlineremote[$idx] =
         '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.'</a>';          '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.'</a>';
         } else {          } else {
               my $linktext = &mt($top);
             $inlineremote[$idx] =              $inlineremote[$idx] =
        '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.         '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.
        '<span class="LC_menubuttons_inline_text">'.$top.'&nbsp;</span></a>'.$form;         '<span class="LC_menubuttons_inline_text">'.$linktext.'&nbsp;</span></a>'.$form;
         }          }
     }      }
     return '';      return '';
Line 1935  sub inlinemenu { Line 2031  sub inlinemenu {
     undef(%category_members);      undef(%category_members);
 # calling rawconfig with "1" will evaluate mydesk.tab, even if there is no active remote control  # calling rawconfig with "1" will evaluate mydesk.tab, even if there is no active remote control
     &rawconfig(1);      &rawconfig(1);
     my $output='<table><tr>';      my $output='<div class="LC_landmark" role="main">'."\n";
     for (my $col=1; $col<=2; $col++) {      for (my $col=1; $col<=2; $col++) {
         $output.='<td class="LC_mainmenu_col_fieldset">';          $output .= '<div class="LC_mainmenu">'."\n";
         for (my $row=1; $row<=8; $row++) {          for (my $row=1; $row<=8; $row++) {
             foreach my $cat (keys(%category_members)) {              foreach my $cat (keys(%category_members)) {
                if ($category_positions{$cat} ne "$col,$row") { next; }                 if ($category_positions{$cat} ne "$col,$row") { next; }
                #$output.='<table><tr><td colspan="4" class="LC_menubuttons_category">'.&mt($category_names{$cat}).'</td></tr>';                 #$output.='<table><tr><td colspan="4" class="LC_menubuttons_category">'.&mt($category_names{$cat}).'</td></tr>';
                $output.='<div class="LC_Box LC_400Box">';                 $output.='<div class="LC_Box LC_400Box">';
        $output.='<h3 class="LC_hcell">'.&mt($category_names{$cat}).'</h3>';         $output.='<h2 class="LC_hcell LC_heading_2">'.&mt($category_names{$cat}).'</h2>';
                $output.='<table>';                 $output.='<table>';
                my %active=();                 my %active=();
                foreach my $menu_item (split(/\:/,$category_members{$cat})) {                 foreach my $menu_item (split(/\:/,$category_members{$cat})) {
Line 1958  sub inlinemenu { Line 2054  sub inlinemenu {
                $output.='</div>';                 $output.='</div>';
             }              }
          }           }
          $output.="</td>";           $output.="</div>";
     }      }
     $output.="</tr></table>";      $output .= '<div style="clear:both"></div></div>'."\n";
     return $output;      return $output;
 }  }
   
Line 2494  function toggleViewAsUser(change) { Line 2590  function toggleViewAsUser(change) {
         if ((document.getElementById('usexpand')) && (document.getElementById('uscollapse'))) {          if ((document.getElementById('usexpand')) && (document.getElementById('uscollapse'))) {
             if (currstyle == 'inline') {              if (currstyle == 'inline') {
                 seluserid.style.display = 'none';                  seluserid.style.display = 'none';
                 document.getElementById('usexpand').innerHTML='&#9658;&nbsp;';                  document.getElementById('usexpand').style.display= 'inline';
                 document.getElementById('uscollapse').innerHTML='';                  document.getElementById('uscollapse').style.display = 'none';
             } else {              } else {
                 seluserid.style.display = 'inline';                  seluserid.style.display = 'inline';
                 document.getElementById('usexpand').innerHTML='';  
                 document.getElementById('uscollapse').innerHTML='&#9668;&nbsp;';  
                 toggleIdentifier(document.userview);                  toggleIdentifier(document.userview);
                   document.getElementById('usexpand').style.display = 'none';
                   document.getElementById('uscollapse').style.display = 'inline';
             }              }
         }          }
     }      }
Line 2554  function validCourseUser(form,change) { Line 2650  function validCourseUser(form,change) {
   
 function toggleIdentifier(form) {  function toggleIdentifier(form) {
     if ((document.getElementById('LC_vuname')) && (document.getElementById('LC_vid'))) {      if ((document.getElementById('LC_vuname')) && (document.getElementById('LC_vid'))) {
           var identifylabel = document.getElementById('LC_vuidentifier');
           var identifier;
           var userbyuname;
         var radioelem = form.elements['vuidentifier'];          var radioelem = form.elements['vuidentifier'];
         if (radioelem.length > 0) {          if (radioelem.length > 0) {
             var i;              var i;
             for (i=0; i<radioelem.length; i++) {              for (i=0; i<radioelem.length; i++) {
                 if (radioelem[i].checked == true) {                  if (radioelem[i].checked == true) {
                     if (radioelem[i].value == 'uname') {                      if (radioelem[i].value == 'uname') {
                           userbyuname = 1;
                         document.getElementById('LC_vuname').type = 'text';                          document.getElementById('LC_vuname').type = 'text';
                         document.getElementById('LC_vid').type = 'hidden';                          document.getElementById('LC_vid').type = 'hidden';
                         document.getElementById('LC_vid').value = '';                          document.getElementById('LC_vid').value = '';
                     } else {                      } else {
                           userbyuname = 0;
                         document.getElementById('LC_vuname').type = 'hidden';                          document.getElementById('LC_vuname').type = 'hidden';
                         document.getElementById('LC_vuname').value = '';                          document.getElementById('LC_vuname').value = '';
                         document.getElementById('LC_vid').type = 'text';                          document.getElementById('LC_vid').type = 'text';
Line 2571  function toggleIdentifier(form) { Line 2672  function toggleIdentifier(form) {
                     break;                      break;
                 }                  }
             }              }
               if (identifylabel) {
                   if (userbyuname) {
                       identifylabel.setAttribute("for","LC_vuname");
                   } else {
                       identifylabel.setAttribute("for","LC_vid");
                   }
               }
         }          }
     }      }
     return;      return;
Line 2617  sub utilityfunctions { Line 2725  sub utilityfunctions {
     my $esc_url=&escape($currenturl);      my $esc_url=&escape($currenturl);
     my $esc_symb=&escape($currentsymb);      my $esc_symb=&escape($currentsymb);
     my $newname = &mt('New Name');      my $newname = &mt('New Name');
       &js_escape(\$newname);
   
     my $countdown = &countdown_toggle_js();      my $countdown = &countdown_toggle_js();
   
Line 2625  sub utilityfunctions { Line 2734  sub utilityfunctions {
         ($env{'request.symb'} ne '') &&          ($env{'request.symb'} ne '') &&
         ($env{'request.filename'}=~/$LONCAPA::assess_re/)) {          ($env{'request.filename'}=~/$LONCAPA::assess_re/)) {
         my $canview;          my $canview;
         foreach my $priv ('msg','vgr') {          foreach my $priv ('mgr','vgr') {
             $canview = &Apache::lonnet::allowed($priv,$env{'request.course.id'});              $canview = &Apache::lonnet::allowed($priv,$env{'request.course.id'});
             if (!$canview && $env{'request.course.sec'} ne '') {              if (!$canview && $env{'request.course.sec'} ne '') {
                 $canview =                  $canview =
Line 2750  function gocstr(url,filename) { Line 2859  function gocstr(url,filename) {
         this.document.cstrprint.submit();          this.document.cstrprint.submit();
         return;          return;
     }      }
       if (url == '/adm/preferences?action=authorsettings') {
           document.location.href=url+'&returnurl='+filename;
           return;
       }
     if (url !='') {      if (url !='') {
         this.document.constspace.filename.value = filename;          this.document.constspace.filename.value = filename;
         this.document.constspace.action = url;          this.document.constspace.action = url;
Line 2867  sub serverform { Line 2980  sub serverform {
     if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) {      if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) {
         $target = ' target="_self"';          $target = ' target="_self"';
     }      }
       my $submit = &mt('Submit');
     return(<<ENDSERVERFORM);      return(<<ENDSERVERFORM);
 <form name="server" action="/adm/logout" method="post"$target>  <form name="server" action="/adm/logout" method="post"$target aria-hidden="true">
 <input type="hidden" name="postdata" value="none" />  <input type="hidden" name="postdata" value="none" />
 <input type="hidden" name="command" value="none" />  <input type="hidden" name="command" value="none" />
 <input type="hidden" name="url" value="none" />  <input type="hidden" name="url" value="none" />
 <input type="hidden" name="symb" value="none" />  <input type="hidden" name="symb" value="none" />
   <input type="submit" value="$submit" class="LC_visually_hidden" tabindex="-1" disabled="disabled" />
 </form>  </form>
 ENDSERVERFORM  ENDSERVERFORM
 }  }
Line 3037  sub roles_selector { Line 3152  sub roles_selector {
         $js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs,          $js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs,
                             \%roledesc,$privref,$menucoll,$menuref);                              \%roledesc,$privref,$menucoll,$menuref);
         $form =           $form = 
             '<form name="rolechooser" method="post" action="'.$httphost.'/adm/roles"'.$targetattr.'>'."\n".              '<form name="rolechooser" method="post" action="'.$httphost.'/adm/roles"'.$targetattr.' aria-hidden="true">'."\n".
             '  <input type="hidden" name="destinationurl" value="'.              '  <input type="hidden" name="destinationurl" value="'.
             &HTML::Entities::encode($destinationurl).'" />'."\n".              &HTML::Entities::encode($destinationurl).'" />'."\n".
             '  <input type="hidden" name="gotorole" value="1" />'."\n".              '  <input type="hidden" name="gotorole" value="1" />'."\n".
Line 3047  sub roles_selector { Line 3162  sub roles_selector {
             $form .= '  <input type="hidden" name="destsymb" value="'.              $form .= '  <input type="hidden" name="destsymb" value="'.
                         &HTML::Entities::encode($destsymb).'" />'."\n";                          &HTML::Entities::encode($destsymb).'" />'."\n";
         }          }
         $form .= '</form>'."\n";          $form .= '<input type="submit" value="'.&mt('Submit').'" class="LC_visually_hidden" tabindex="-1" disabled="disabled" />'."\n".
                    '</form>'."\n";
         foreach my $role (@roles_order) {          foreach my $role (@roles_order) {
             my $include;              my $include;
             if (defined($courseroles{$role})) {              if (defined($courseroles{$role})) {
Line 3536  $donebutton Line 3652  $donebutton
 <span id="ddcountcollapse" class="LC_menubuttons_inline_text">  <span id="ddcountcollapse" class="LC_menubuttons_inline_text">
 $collapse  $collapse
 </span></a>  </span></a>
 <span id="duedatecountdown" class="LC_menubuttons_inline_text" style="display: $currdisp;"></span>  <span id="duedatecountdown" class="LC_menubuttons_inline_text" style="display: $currdisp;" role="timer"></span>
 <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">  <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">
 <span id="ddcountexpand" class="LC_menubuttons_inline_text" >$expand</span>  <span id="ddcountexpand" class="LC_menubuttons_inline_text" >$expand</span>
 <img src="/res/adm/pages/timer.png" title="$desc" class="LC_icon" alt="$alttxt" /><span class="LC_menubuttons_inline_text">$title</span></a>  <img src="/res/adm/pages/timer.png" title="$desc" class="LC_icon" alt="$alttxt" /><span class="LC_menubuttons_inline_text">$title</span></a>

Removed from v.1.542  
changed lines
  Added in v.1.561


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