Diff for /loncom/interface/loncommon.pm between versions 1.636.2.5 and 1.639

version 1.636.2.5, 2008/03/23 23:13:26 version 1.639, 2008/02/01 23:03:13
Line 78  my $readit; Line 78  my $readit;
 ## Global Variables  ## Global Variables
 ##  ##
   
 # ----------------------------------------------- SSI with retries:  
 #  
   
 =pod  
   
 =head1 Server Side include with retries:  
   
 =over 4  
   
 =item * &ssi_with_retries(resource,retries form)  
   
 Performs an ssi with some number of retries.  Retries continue either  
 until the result is ok or until the retry count supplied by the  
 caller is exhausted.  
   
 Inputs:  
   
 =over 4  
   
 resource   - Identifies the resource to insert.  
   
 retries    - Count of the number of retries allowed.  
   
 form       - Hash that identifies the rendering options.  
   
 =back  
   
 Returns:  
   
 =over 4  
   
 content    - The content of the response.  If retries were exhausted this is empty.  
   
 response   - The response from the last attempt (which may or may not have been successful.  
   
 =back  
   
 =back  
   
 =cut  
   
 sub ssi_with_retries {  
     my ($resource, $retries, %form) = @_;  
   
   
     my $ok = 0;                 # True if we got a good response.  
     my $content;  
     my $response;  
   
     # Try to get the ssi done. within the retries count:  
   
     do {  
         ($content, $response) = &Apache::lonnet::ssi($resource, %form);  
         $ok      = $response->is_success;  
         $retries--;  
     } while (!$ok && ($retries > 0));  
   
     if (!$ok) {  
         $content = '';          # On error return an empty content.  
     }  
     return ($content, $response);  
   
 }  
   
   
   
 # ----------------------------------------------- Filetypes/Languages/Copyright  # ----------------------------------------------- Filetypes/Languages/Copyright
 my %language;  my %language;
 my %supported_language;  my %supported_language;
Line 4047  ENDROLE Line 3981  ENDROLE
         $dc_info = '('.$dc_info.')';          $dc_info = '('.$dc_info.')';
     }      }
   
     if (($env{'environment.remote'} eq 'off') || ($args->{'suppress_header_logos'})) {      if ($env{'environment.remote'} eq 'off') {
         # No Remote          # No Remote
  if ($env{'request.state'} eq 'construct') {   if ($env{'request.state'} eq 'construct') {
     $forcereg=1;      $forcereg=1;
Line 4070  ENDROLE Line 4004  ENDROLE
  $lastitem = $thisdisfn;   $lastitem = $thisdisfn;
     }      }
     $titleinfo =       $titleinfo = 
  &Apache::loncommon::help_open_menu('','',3,'Authoring')   &Apache::loncommon::help_open_menu('','',3,'Authoring').
  .'<b>'.&mt('Construction Space').'</b>:&nbsp;'   '<b>Construction Space</b>:&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)."<font size=\"+1\">$lastitem</font></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>'
Line 8153  sub construct_course { Line 8087  sub construct_course {
  $outcome .= $clonemsg.$linefeed;   $outcome .= $clonemsg.$linefeed;
  my %oldcenv=&Apache::lonnet::dump('environment',$$crsudom,$$crsunum);   my %oldcenv=&Apache::lonnet::dump('environment',$$crsudom,$$crsunum);
 # Copy all files  # Copy all files
  &Apache::lonclonecourse::copycoursefiles($cloneid,$$courseid);   &Apache::lonclonecourse::copycoursefiles($cloneid,$$courseid,$args->{'datemode'},$args->{'dateshift'});
 # Restore URL  # Restore URL
  $cenv{'url'}=$oldcenv{'url'};   $cenv{'url'}=$oldcenv{'url'};
 # Restore title  # Restore title
Line 8200  sub construct_course { Line 8134  sub construct_course {
     } else {      } else {
         $cenv{'internal.courseowner'} = $args->{'curruser'};          $cenv{'internal.courseowner'} = $args->{'curruser'};
     }      }
   
     my @badclasses = (); # Used to accumulate sections/crosslistings that did not pass classlist access check for course owner.      my @badclasses = (); # Used to accumulate sections/crosslistings that did not pass classlist access check for course owner.
     if ($args->{'crssections'}) {      if ($args->{'crssections'}) {
         $cenv{'internal.sectionnums'} = '';          $cenv{'internal.sectionnums'} = '';

Removed from v.1.636.2.5  
changed lines
  Added in v.1.639


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