Diff for /loncom/publisher/lonpubmenu.pm between versions 1.2 and 1.6

version 1.2, 2005/03/10 03:50:49 version 1.6, 2009/02/26 16:10:49
Line 1 Line 1
 # The LearningOnline Network with CAPA  # The LearningOnline Network with CAPA
 # Construction Space Buttons for Top Frame   # Construction Space Buttons for Top Frame 
 #  #
   # $Id$
   #
 # Copyright Michigan State University Board of Trustees  # Copyright Michigan State University Board of Trustees
 #  #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).  # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
Line 27 Line 29
   
 package Apache::lonpubmenu;  package Apache::lonpubmenu;
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::lonnet;
 use Apache::loncommon;  use Apache::loncommon;
   
 sub handler {  sub handler {
Line 42  sub handler { Line 45  sub handler {
                                        list => 'List Directory',                                         list => 'List Directory',
                                        uplo => 'Upload file',                                           uplo => 'Upload file',  
                                        dele => 'Delete',                                         dele => 'Delete',
                                        edit => 'Edit Catalog Information',                                          edit => 'Edit Metadata', 
                                        sela => 'Select Action',                                         sela => 'Select Action',
                                        nfil => 'New file',                                         nfil => 'New file',
                                        nhtm => 'New HTML file',                                         nhtm => 'New HTML file',
Line 61  sub handler { Line 64  sub handler {
                                        prnt => 'Print'                                         prnt => 'Print'
                                       );                                        );
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['disp']);      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['disp']);
     my $disp = $ENV{'form.disp'};      my $disp = $env{'form.disp'};
 # set defaults for parent directory in case frameloc is unable to determine directory  # set defaults for parent directory in case frameloc is unable to determine directory
     my $defaultdir = '/priv/'.$ENV{'user.name'}.'/';       my $defaultdir = '/priv/'.$env{'user.name'}.'/'; 
     if ($ENV{'request.role'} =~ m#^ca\./[^/]+/([^/]+)#) {      if ($env{'request.role'} =~ m#^ca\./[^/]+/([^/]+)#) {
         $defaultdir = '/priv/'.$1.'/';          $defaultdir = '/priv/'.$1.'/';
     }      }
     $r->print(<<"ENDONE");      my $js=
 <html>  
 <head>  
 <title>LON-CAPA Publishing Frame</title>  
 <script type="text/javascript">  <script type="text/javascript">
 //<!--  //<!--
 function frameloc() {  function frameloc() {
Line 165  function getpostdata() { Line 165  function getpostdata() {
 ENDONE  ENDONE
   
     if ($disp eq 'dir') {      if ($disp eq 'dir') {
         $r->print(<<"ENDDIR");          $js .= <<"ENDDIR";
 function getdirname() {  function getdirname() {
     document.publishdir.filename.value=frameloc();      document.publishdir.filename.value=frameloc();
     pubdir(document.publishdir)      pubdir(document.publishdir)
Line 200  function forcepub(theform) { Line 200  function forcepub(theform) {
 }  }
 ENDDIR  ENDDIR
     } else {      } else {
         $r->print(<<"ENDRES");          $js.=<<"ENDRES";
 function getfilename() {  function getfilename() {
     document.publisher.filename.value=frameloc();      document.publisher.filename.value=frameloc();
     if ((document.publisher.filename.value.charAt(      if ((document.publisher.filename.value.charAt(
Line 229  function getdelfilename() { Line 229  function getdelfilename() {
 }  }
 ENDRES  ENDRES
     }      }
       my $start_page = 
    &Apache::loncommon::start_page('Publishing Frame',$js,
          {'only_body' => 1,});
       my $end_page = 
    &Apache::loncommon::end_page();
     $r->print(<<"END");      $r->print(<<"END");
 //-->  $start_page
 </script>  
     </head>  
     <body bgcolor="#ccffdd" text='#002200' link='#003333' vlink='#006666'>  
  <table border="0" align="center"><tr><th bgcolor="#004400" height="20">   <table border="0" align="center"><tr><th bgcolor="#004400" height="20">
       <table border="0" cellspacing="2" cellpadding="2"><tr valign="middle">        <table border="0" cellspacing="2" cellpadding="2"><tr valign="middle">
   <td bgcolor="#ccddaa" align="center">    <td bgcolor="#ccddaa" align="center">
Line 350  ENDPROBOPS Line 352  ENDPROBOPS
     </th>      </th>
   </tr>    </tr>
  </table>   </table>
     </body>  $end_page
   </html>  
 ENDPAGE  ENDPAGE
 }  }
   

Removed from v.1.2  
changed lines
  Added in v.1.6


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