Diff for /loncom/interface/loncommon.pm between versions 1.240 and 1.244

version 1.240, 2004/12/02 21:30:16 version 1.244, 2004/12/20 20:53:40
Line 691  sub help_open_menu { Line 691  sub help_open_menu {
     $template .= <<"ENDTEMPLATE";      $template .= <<"ENDTEMPLATE";
  <script type="text/javascript">   <script type="text/javascript">
 //<!-- BEGIN LON-CAPA Internal  //<!-- BEGIN LON-CAPA Internal
 function helpMenu(caller) {  function helpMenu(target) {
     if (caller == 'open') {      var caller = this;
         newWindow =  window.open("","helpmenu","HEIGHT=$height,WIDTH=$width,resize=yes,scrollbars=yes" )      if (target == 'open') {
         caller = newWindow.document          var newWindow = null;
     } else {          try {
         caller = this.document              newWindow =  window.open("","helpmenu","HEIGHT=$height,WIDTH=$width,resizable=yes,scrollbars=yes" )
     }          }
     caller.write("<html><head><title>LON-CAPA Help Menu</title><meta http-equiv='pragma' content='no-cache'></head>")          catch(error) {
     caller.write("<frameset rows='105,*' border='0'><frame name='bannerframe'  src='$banner_link'><frame name='bodyframe' src='$details_link'></frameset>")              writeHelp(caller);
     caller.write("</html>")              return;
     caller.close()          }
     if (caller == newWindow.document) {          if (newWindow) {
         caller.focus()              caller = newWindow;
           }
     }      }
       writeHelp(caller);
       return;
   }
   function writeHelp(caller) {
       caller.document.write("<html><head><title>LON-CAPA Help Menu</title><meta http-equiv='pragma' content='no-cache'></head>")
       caller.document.write("<frameset rows='105,*' border='0'><frame name='bannerframe'  src='$banner_link'><frame name='bodyframe' src='$details_link'></frameset>")
       caller.document.write("</html>")
       caller.document.close()
       caller.focus()
 }  }
 // END LON-CAPA Internal -->  // END LON-CAPA Internal -->
  </script>   </script>
Line 2325  sub get_student_answers { Line 2335  sub get_student_answers {
   
 =item * &submlink()  =item * &submlink()
   
 Inputs: $text $uname $udom $symb  Inputs: $text $uname $udom $symb $target
   
 Returns: A link to grades.pm such as to see the SUBM view of a student  Returns: A link to grades.pm such as to see the SUBM view of a student
   
Line 2333  Returns: A link to grades.pm such as to Line 2343  Returns: A link to grades.pm such as to
   
 ###############################################  ###############################################
 sub submlink {  sub submlink {
     my ($text,$uname,$udom,$symb)=@_;      my ($text,$uname,$udom,$symb,$target)=@_;
       if (!($uname && $udom)) {
    (my $cursymb, my $courseid,$udom,$uname)=
       &Apache::lonxml::whichuser($symb);
    if (!$symb) { $symb=$cursymb; }
       }
       if (!$symb) { $symb=&symbread(); }
       $symb=&Apache::lonnet::escape($symb);
       if ($target) { $target="target=\"$target\""; }
       return '<a href="/adm/grades?&command=submission&'.
    'symb='.$symb.'&student='.$uname.
    '&userdom='.$udom.'" '.$target.'>'.$text.'</a>';
   }
   ##############################################
   
   =pod
   
   =item * &pgrdlink()
   
   Inputs: $text $uname $udom $symb $target
   
   Returns: A link to grades.pm such as to see the PGRD view of a student
   
   =cut
   
   ###############################################
   sub pgrdlink {
       my $link=&submlink(@_);
       $link=~s/(&command=submission)/$1&showgrading=yes/;
       return $link;
   }
   ##############################################
   
   =pod
   
   =item * &pprmlink()
   
   Inputs: $text $uname $udom $symb $target
   
   Returns: A link to parmset.pm such as to see the PPRM view of a
   student andn resource
   
   =cut
   
   ###############################################
   sub pprmlink {
       my ($text,$uname,$udom,$symb,$target)=@_;
     if (!($uname && $udom)) {      if (!($uname && $udom)) {
  (my $cursymb, my $courseid,$udom,$uname)=   (my $cursymb, my $courseid,$udom,$uname)=
     &Apache::lonxml::whichuser($symb);      &Apache::lonxml::whichuser($symb);
  if (!$symb) { $symb=$cursymb; }   if (!$symb) { $symb=$cursymb; }
     }      }
     if (!$symb) { $symb=&symbread(); }      if (!$symb) { $symb=&symbread(); }
     return '<a href="/adm/grades?symb='.$symb.'&student='.$uname.      $symb=&Apache::lonnet::escape($symb);
  '&userdom='.$udom.'&command=submission">'.$text.'</a>';      if ($target) { $target="target=\"$target\""; }
       return '<a href="/adm/parmset?&command=set&'.
    'symb='.$symb.'&uname='.$uname.
    '&udom='.$udom.'" '.$target.'>'.$text.'</a>';
 }  }
 ##############################################  ##############################################
   
Line 2608  ENDROLE Line 2667  ENDROLE
     $formaction=~s/\/+/\//g;      $formaction=~s/\/+/\//g;
             unless ($customtitle) {  #this is for resources; directories have customtitle, and crumbs and select recent are created in lonpubdir.pm                unless ($customtitle) {  #this is for resources; directories have customtitle, and crumbs and select recent are created in lonpubdir.pm  
                 my $parentpath = '';                  my $parentpath = '';
                 if ($thisdisfn =~ m-(.+/)[^/]*$-) {                  my $lastitem = '';
                   if ($thisdisfn =~ m-(.+/)([^/]*)$-) {
                     $parentpath = $1;                      $parentpath = $1;
                       $lastitem = $2;
                   } else {
                       $lastitem = $thisdisfn;
                 }                  }
         $titleinfo = &Apache::loncommon::help_open_menu('','','','',3,'Authoring').          $titleinfo = &Apache::loncommon::help_open_menu('','','','',3,'Authoring').
                       '<font face="Arial, Helvetica, sans-serif"><b>Construction Space</b>:</font>&nbsp;'.                         '<font face="Arial, Helvetica, sans-serif"><b>Construction Space</b>:</font>&nbsp;'. 
                       '<form name="dirs" method="post" action="'.$formaction                        '<form name="dirs" method="post" action="'.$formaction
     .'" target="_top"><tt><b>'      .'" target="_top"><tt><b>'
     .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."</b></tt><br />"      .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."<font size=\"+1\">$lastitem</font></b></tt><br />"
     .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')      .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')
     .'</form>'      .'</form>'
     .&Apache::lonmenu::constspaceform();      .&Apache::lonmenu::constspaceform();

Removed from v.1.240  
changed lines
  Added in v.1.244


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