Diff for /loncom/interface/londocs.pm between versions 1.73 and 1.74

version 1.73, 2003/09/05 18:11:26 version 1.74, 2003/09/08 18:56:09
Line 35  use Apache::loncommon; Line 35  use Apache::loncommon;
 use Apache::lonratedt;  use Apache::lonratedt;
 use Apache::lonratsrv;  use Apache::lonratsrv;
 use Apache::lonxml;  use Apache::lonxml;
   use Apache::loncreatecourse;
 use HTML::Entities;  use HTML::Entities;
 use GDBM_File;  use GDBM_File;
   
Line 72  sub storemap { Line 73  sub storemap {
                                 $map,1);                                  $map,1);
 }  }
   
   # ----------------------------------------- Return hash with valid author names
   
   sub authorhosts {
       my %outhash=();
       my $home=0;
       my $other=0;
       foreach (keys %ENV) {
    if ($_=~/^user\.role\.(au|ca)\.(.+)$/) {
       my $role=$1;
       my $realm=$2;
       my ($start,$end)=split(/\./,$ENV{$_});
       if (($start) && ($start>time)) { next; }
       if (($end) && (time>$end)) { next; }
       my $ca; my $cd;
       if ($1 eq 'au') {
    $ca=$ENV{'user.name'};
    $cd=$ENV{'user.domain'};
       } else {
    ($cd,$ca)=($realm=~/^\/(\w+)\/(\w+)$/);
       }
       if (&Apache::lonnet::homeserver($ca,$cd) eq 
    $Apache::lonnet::perlvar{'lonHostID'}) {
    $home++;
    $outhash{'home_'.$ca.'@'.$cd}=1;
       } else {
    $outhash{'otherhome_'.$ca.'@'.$cd}=
       &Apache::lonnet::homeserver($ca,$cd);
    $other++;
       }
    }
       }
       return ($home,$other,%outhash);
   }
   # ------------------------------------------------------ Generate "dump" button
   
   sub dumpbutton {
       my ($home,$other,%outhash)=&authorhosts();
       if ($home+$other==0) { return ''; }
       my $output='</td><td bgcolor="#DDDDCC">';
       if ($home) {
    return '</td><td bgcolor="#DDDDCC">'.
       '<input type="submit" name="dumpcourse" value="Dump Course DOCS to Construction Space" />';
       } else {
    return'</td><td bgcolor="#DDDDCC">'.
         'Dump Course DOCS to Construction Space: available on other servers';
       }
   }
   
   # -------------------------------------------------------- Actually dump course
   
   sub dumpcourse {
       my ($home,$other,%outhash)=&authorhosts();
       unless ($outhash{'home_'.$ENV{'form.authorspace'}}) { return ''; }
       my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'});
   
   }
   
 # Imports the given (name, url) resources into the course  # Imports the given (name, url) resources into the course
 # coursenum, coursedom, and folder must precede the list  # coursenum, coursedom, and folder must precede the list
 sub group_import {  sub group_import {
Line 664  ENDNEWSCRIPT Line 722  ENDNEWSCRIPT
  '','',$showdoc));   '','',$showdoc));
   unless ($showdoc) {    unless ($showdoc) {
     if ($allowed) {      if ($allowed) {
        $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',         my $dumpbut=&dumpbutton();
      'Editing the Table of Contents for your Course'));  
        $r->print(<<ENDCOURSEVERIFY);         $r->print(<<ENDCOURSEVERIFY);
 <form name="renameform" method="post" action="/adm/coursedocs">  <form name="renameform" method="post" action="/adm/coursedocs">
 <input type="hidden" name="title" />  <input type="hidden" name="title" />
Line 677  ENDNEWSCRIPT Line 734  ENDNEWSCRIPT
 <input type="hidden" name="folder" />  <input type="hidden" name="folder" />
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="courseverify">  <form action="/adm/coursedocs" method="post" name="courseverify">
   <table bgcolor="#AAAAAA" width="100%" cellspacing="4" cellpadding="4">
   <tr><td bgcolor="#DDDDCC">
 <input type="submit" name="verify" value="Verify Content" />  <input type="submit" name="verify" value="Verify Content" />
   </td><td bgcolor="#DDDDCC">
 <input type="submit" name="versions" value="Check Resource Versions" />  <input type="submit" name="versions" value="Check Resource Versions" />
   $dumpbut
   </td></tr></table>
 </form>  </form>
 ENDCOURSEVERIFY  ENDCOURSEVERIFY
          $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
        'Editing the Table of Contents for your Course'));
     }      }
 # --------------------------------------------------------- Standard documents  # --------------------------------------------------------- Standard documents
     $r->print('<table border=2 cellspacing=4 cellpadding=4>');      $r->print('<table border=2 cellspacing=4 cellpadding=4>');

Removed from v.1.73  
changed lines
  Added in v.1.74


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