Diff for /loncom/interface/lonmenu.pm between versions 1.369.2.18 and 1.369.2.19

version 1.369.2.18, 2012/08/03 22:38:35 version 1.369.2.19, 2012/08/06 03:38:08
Line 578  sub innerregister { Line 578  sub innerregister {
  }   }
  $crs=~s/\_/\//g;   $crs=~s/\_/\//g;
   
           my %swtext;
           if ($noremote) {
               %swtext = &get_inline_text();
           } else {
               %swtext = &get_rc_text();
           } 
         my $hwkadd='';          my $hwkadd='';
         if ($env{'request.symb'} ne '' &&          if ($env{'request.symb'} ne '' &&
     $env{'request.filename'}=~/$LONCAPA::assess_re/) {      $env{'request.filename'}=~/$LONCAPA::assess_re/) {
     if (&Apache::lonnet::allowed('mgr',$crs)) {      if (&Apache::lonnet::allowed('mgr',$crs)) {
  $hwkadd.=&switch('','',7,2,'pgrd.png','Content Grades','grades[_4]',   $hwkadd.=&switch('','',7,2,'pgrd.png',$swtext{'pgrd'},'grades[_4]',
                        "gocmd('/adm/grades','gradingmenu')",                         "gocmd('/adm/grades','gradingmenu')",
                        'Content Grades');                         'Content Grades');
             } elsif (&Apache::lonnet::allowed('vgr',$crs)) {              } elsif (&Apache::lonnet::allowed('vgr',$crs)) {
  $hwkadd.=&switch('','',7,2,'subm.png','Content Submissions','missions[_1]',   $hwkadd.=&switch('','',7,2,'subm.png',$swtext{'subm'},'missions[_1]',
                        "gocmd('/adm/grades','submission')",                         "gocmd('/adm/grades','submission')",
        'Content Submissions');         'Content Submissions');
             }              }
  }   }
  if ($env{'request.symb'} ne '' &&   if ($env{'request.symb'} ne '' &&
     &Apache::lonnet::allowed('opa',$crs)) {      &Apache::lonnet::allowed('opa',$crs)) {
     $hwkadd.=&switch('','',7,3,'pparm.png','Content Settings','parms[_2]',      $hwkadd.=&switch('','',7,3,'pparm.png',$swtext{'pparm'},'parms[_2]',
      "gocmd('/adm/parmset','set')",       "gocmd('/adm/parmset','set')",
      'Content Settings');       'Content Settings');
  }   }
         if ($noremote) {            if ($noremote) {  
             if ($env{'request.symb'}=~/^uploaded/ &&              if ($env{'request.symb'}=~/^uploaded/ &&
                 &Apache::lonnet::allowed('mdc',$crs)) {                  &Apache::lonnet::allowed('mdc',$crs)) {
                 $hwkadd.=&switch('','',7,4,'docs.png','Folder/Page Content','parms[_2]',                  $hwkadd.=&switch('','',7,4,'docs.png',$swtext{'docs'},'parms[_2]',
                                  "gocmd('/adm/coursedocs','direct')",                                   "gocmd('/adm/coursedocs','direct')",
                                  'Folder/Page Content');                                   'Folder/Page Content');
             }              }
Line 646  sub innerregister { Line 652  sub innerregister {
  my @ids=&Apache::lonnet::current_machine_ids();   my @ids=&Apache::lonnet::current_machine_ids();
  foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }   foreach my $id (@ids) { if ($id eq $home) { $allowed=1; } }
  if (!$allowed) {   if (!$allowed) {
     $editbutton=&switch('','',6,1,$top,,$bottom,$action,$desc);      $editbutton=&switch('','',6,1,,$top,$bottom,$action,$desc);
                     $noeditbutton = 0;                      $noeditbutton = 0;
                 }                  }
             }              }
Line 713  sub innerregister { Line 719  sub innerregister {
                         }                          }
                     }                      }
                     $editbutton=&switch                      $editbutton=&switch
                        ('','',6,1,'pcstr.png','Edit','resource[_2]',                         ('','',6,1,'pcstr.png',$swtext{'pcstr'},'resource[_2]',
                         $bot,"Edit this resource");                          $bot,"Edit this resource");
                     $noeditbutton = 0;                      $noeditbutton = 0;
                 }                  }
Line 729  sub innerregister { Line 735  sub innerregister {
                         my $cfile = &edit_course_upload($file,$cnum,$cdom);                          my $cfile = &edit_course_upload($file,$cnum,$cdom);
                         if ($cfile) {                          if ($cfile) {
                             $editbutton=&switch                              $editbutton=&switch
                                         ('','',6,1,'pcstr.png','Edit',                                          ('','',6,1,'pcstr.png',$swtext{'pcstr'},
                                          'resource[_2]',"go('".$cfile."');",                                           'resource[_2]',"go('".$cfile."');",
                                          'Edit this resource');                                           'Edit this resource');
                         }                          }
Line 741  sub innerregister { Line 747  sub innerregister {
             if ($resurl eq "public/$cdom/$cnum/syllabus") {              if ($resurl eq "public/$cdom/$cnum/syllabus") {
                 if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ /\w/) {                  if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ /\w/) {
                     if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {                      if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
                         $editbutton=&switch('','',6,1,'pcstr.png','Edit',                          $editbutton=&switch('','',6,1,'pcstr.png',$swtext{'pcstr'},
                                             'resource[_2]',                                              'resource[_2]',
                                             "go('/adm/courseprefs?phase=display&actions=courseinfo')",                                              "go('/adm/courseprefs?phase=display&actions=courseinfo')",
                                             'Edit this resource');                                              'Edit this resource');
Line 772  sub innerregister { Line 778  sub innerregister {
 # Probably should be in mydesk.tab  # Probably should be in mydesk.tab
 #  #
                 $menuitems=(<<ENDMENUITEMS);                  $menuitems=(<<ENDMENUITEMS);
 s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory  s&6&1&list.png&$swtext{'list'}&dir[_1]&golist('$esc_currdir')&List current directory
 s&6&2&rtrv.png&Retrieve&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version  s&6&2&rtrv.png&$swtext{'rtrv'}&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version
 s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource  s&6&3&pub.png&$swtext{'pub'}&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource
 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&$swtext{'del'}&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource
 s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document  s&7&2&prt.png&$swtext{'prt'}&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document
 ENDMENUITEMS  ENDMENUITEMS
             }              }
                 if (ref($bread_crumbs) eq 'ARRAY') {                  if (ref($bread_crumbs) eq 'ARRAY') {
Line 791  ENDMENUITEMS Line 797  ENDMENUITEMS
 # We are in a course and looking at a registered URL  # We are in a course and looking at a registered URL
 # Should probably be in mydesk.tab  # Should probably be in mydesk.tab
 #  #
   
     $menuitems=(<<ENDMENUITEMS);      $menuitems=(<<ENDMENUITEMS);
 c&3&1  c&3&1
 s&2&1&back.png&&&gopost('/adm/flip','back:'+currentURL)&Previous content resource&&1  s&2&1&back.png&$swtext{'back'}&&gopost('/adm/flip','back:'+currentURL)&Previous content resource&&1
 s&2&3&forw.png&&&gopost('/adm/flip','forward:'+currentURL)&Next content resource&&3  s&2&3&forw.png&$swtext{'forw'}&&gopost('/adm/flip','forward:'+currentURL)&Next content resource&&3
 c&6&3  c&6&3
 c&8&1  c&8&1
 c&8&2  c&8&2
 s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document  s&8&3&prt.png&$swtext{'prt'}&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document
 ENDMENUITEMS  ENDMENUITEMS
             $got_prt = 1;              $got_prt = 1;
             if (($env{'user.adv'}) && ($env{'request.uri'} =~ /^\/res/)              if (($env{'user.adv'}) && ($env{'request.uri'} =~ /^\/res/)
Line 806  ENDMENUITEMS Line 813  ENDMENUITEMS
                 # wishlist is only available for users with access to resource-pool                  # wishlist is only available for users with access to resource-pool
                 # and links can only be set for resources within the resource-pool                  # and links can only be set for resources within the resource-pool
                 $menuitems .= (<<ENDMENUITEMS);                  $menuitems .= (<<ENDMENUITEMS);
 s&9&1&wishlist-link.png&Stored Links&wishlistlink[_2]&set_wishlistlink()&Save a link for this resource in your personal Stored Links repository&&1  s&9&1&alnk.png&$swtext{'alnk'}&linkstor[_1]&set_wishlistlink()&Save a link for this resource in your personal Stored Links repository&&1
 ENDMENUITEMS  ENDMENUITEMS
                 $got_wishlist = 1;                  $got_wishlist = 1;
             }              }
Line 820  if(length($annotation) > 0){ Line 827  if(length($annotation) > 0){
 }else{  }else{
  $menuitems.="anot.png";   $menuitems.="anot.png";
 }  }
 $menuitems.="&Notes&&annotate()&";  $menuitems.="&$swtext{'anot'}&tations[_1]&annotate()&";
 $menuitems.="Make notes and annotations about this resource&&1\n";  $menuitems.="Make notes and annotations about this resource&&1\n";
   
             unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {              unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {
  if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/}) && ($env{'request.noversionuri'} !~ m{^/uploaded/$match_domain/$match_courseid/docs/})) {   if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/}) && ($env{'request.noversionuri'} !~ m{^/uploaded/$match_domain/$match_courseid/docs/})) {
     $menuitems.=(<<ENDREALRES);      $menuitems.=(<<ENDREALRES);
 s&6&3&catalog.png&Info&info[_1]&catalog_info()&Show Metadata  s&6&3&catalog.png&$swtext{'catalog'}&info[_1]&catalog_info()&Show Metadata
 ENDREALRES  ENDREALRES
                 }                  }
                 unless ($env{'request.noversionuri'} =~ m{^/uploaded/$match_domain/$match_courseid/docs/}) {                  unless ($env{'request.noversionuri'} =~ m{^/uploaded/$match_domain/$match_courseid/docs/}) {
             $menuitems.=(<<ENDREALRES);              $menuitems.=(<<ENDREALRES);
 s&8&1&eval.png&Evaluate&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource  s&8&1&eval.png&$swtext{'eval'}&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource
 ENDREALRES  ENDREALRES
                 }                  }
                 $menuitems.=(<<ENDREALRES);                  $menuitems.=(<<ENDREALRES);
 s&8&2&fdbk.png&Communicate&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource  s&8&2&fdbk.png&$swtext{'fdbk'}&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource
 ENDREALRES  ENDREALRES
     }      }
         }          }
  if ($env{'request.uri'} =~ /^\/res/) {   if ($env{'request.uri'} =~ /^\/res/) {
             unless ($got_prt) {              unless ($got_prt) {
         $menuitems .= (<<ENDMENUITEMS);          $menuitems .= (<<ENDMENUITEMS);
 s&8&3&prt.png&Print&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document  s&8&3&prt.png&$swtext{'prt'}&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document
 ENDMENUITEMS  ENDMENUITEMS
                 $got_prt = 1;                  $got_prt = 1;
             }              }
Line 850  ENDMENUITEMS Line 857  ENDMENUITEMS
                 if (($env{'user.adv'}) && (!$env{'request.enc'})) {                  if (($env{'user.adv'}) && (!$env{'request.enc'})) {
                     # wishlist is only available for users with access to resource-pool                      # wishlist is only available for users with access to resource-pool
                     $menuitems .= (<<ENDMENUITEMS);                      $menuitems .= (<<ENDMENUITEMS);
 s&9&1&wishlist-link.png&Stored Links&wishlistlink[_2]&set_wishlistlink()&Save a link for this resource in your personal Stored Links repository&&1  s&9&1&alnk.png&$swtext{'alnk'}&linkstor[_1]&set_wishlistlink()&Save a link for this resource in your personal Stored Links repository&&1
 ENDMENUITEMS  ENDMENUITEMS
                     $got_wishlist = 1;                      $got_wishlist = 1;
                 }                  }
Line 1006  ENDDONOTREGTHIS Line 1013  ENDDONOTREGTHIS
     }      }
 }  }
   
   sub get_inline_text {
       my %text = (
                    pgrd     => 'Content Grades',
                    subm     => 'Content Submissions',
                    pparm    => 'Content Settings',
                    docs     => 'Folder/Page Content',
                    pcstr    => 'Edit',
                    list     => 'Directory',
                    rtrv     => 'Retrieve',
                    pub      => 'Publish',
                    del      => 'Delete',
                    prt      => 'Print',
                    alnk     => 'Stored Links',
                    anot     => 'Notes',
                    catalog  => 'Info',
                    eval     => 'Evaluate',
                    fdbk     => 'Feedback',
       );
       return %text;
   }
   
   sub get_rc_text {
       my %text = (
                      pgrd    => 'problem[_1]',
                      subm    => 'view sub-[_1]',
                      pparm   => 'problem[_2]',
                      pcstr   => 'edit[_1]',
                      list    => 'list[_1]',
                      rtrv    => 'retrieve[_1]',
                      pub     => 'publish[_1]',
                      del     => 'delete[_1]',
                      prt     => 'prepare[_1]',
                      back    => 'backward[_1]',
                      forw    => 'forward[_1]',
                      alnk    => 'add to[_1]',
                      anot    => 'anno-[_1]',
                      catalog => 'catalog[_2]',
                      eval    => 'evaluate[_1]',
                      fdbk    => 'feedback[_1]',
       );
       return %text;
   }
   
 sub is_course_upload {  sub is_course_upload {
     my ($file,$cnum,$cdom) = @_;      my ($file,$cnum,$cdom) = @_;
     my $uploadpath = &LONCAPA::propath($cdom,$cnum);      my $uploadpath = &LONCAPA::propath($cdom,$cnum);

Removed from v.1.369.2.18  
changed lines
  Added in v.1.369.2.19


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