Diff for /loncom/homework/lonhomework.pm between versions 1.337 and 1.338

version 1.337, 2013/04/01 21:40:14 version 1.338, 2013/06/04 22:20:24
Line 163  sub get_target { Line 163  sub get_target {
     }      }
         }          }
 #  #
 # End of Construction Space  # End of Authoring Space
 #  #
     }      }
 #  #
Line 669  sub setupheader { Line 669  sub setupheader {
 }  }
   
 sub handle_save_or_undo {  sub handle_save_or_undo {
     my ($request,$problem,$result) = @_;      my ($request,$problem,$result,$getobjref) = @_;
   
     my $file    = &Apache::lonnet::filelocation("",$request->uri);      my $file    = &Apache::lonnet::filelocation("",$request->uri);
     my $filebak =$file.".bak";      my $filebak =$file.".bak";
Line 712  sub handle_save_or_undo { Line 712  sub handle_save_or_undo {
  my $fh=Apache::File->new(">$file");   my $fh=Apache::File->new(">$file");
  if (defined($fh)) {   if (defined($fh)) {
     print $fh $$result;      print $fh $$result;
               if (ref($getobjref) eq 'SCALAR') {
                   if ($file =~ m{([^/]+)\.(html?)$}) {
                       my $fname = $1;
                       my $ext = $2;
                       my $path = $file;
                       $path =~ s/\Q$fname\E\.\Q$ext\E$//; 
                       my (%allfiles,%codebase);
                       &Apache::lonnet::extract_embedded_items($file,\%allfiles,
                                                              \%codebase,$result);
                       if (keys(%allfiles) > 0) {
                           my $url = $request->uri;
                           my $state = <<STATE;
       <input type="hidden" name="action" value="upload_embedded" />
       <input type="hidden" name="url" value="$url" />
   STATE
                           $$getobjref = "<h3>".&mt("Reference Warning")."</h3>".
                                         "<p>".&mt("Completed upload of the file. This file contained references to other files.")."</p>".
                                         "<p>".&mt("Please select the locations from which the referenced files are to be uploaded.")."</p>".
                                         &Apache::loncommon::ask_for_embedded_content($url,$state,\%allfiles,\%codebase,
                                         {'error_on_invalid_names'   => 1,
                                          'ignore_remote_references' => 1,});
                       }
                   }
               }
  } else {   } else {
     &Apache::lonxml::info('<span class="LC_error">'.      &Apache::lonxml::info('<span class="LC_error">'.
   &mt("Unable to write to [_1]",    &mt("Unable to write to [_1]",
Line 730  sub analyze_header { Line 754  sub analyze_header {
   
     # Breadcrumbs      # Breadcrumbs
     my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),      my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
                    'text' => 'Construction Space'},                     'text' => 'Authoring Space'},
                   {'href' => '',                    {'href' => '',
                    'text' => 'Problem Testing'},                     'text' => 'Problem Testing'},
                   {'href' => '',                    {'href' => '',
Line 964  sub editxmlmode { Line 988  sub editxmlmode {
   
     # Breadcrumbs      # Breadcrumbs
     my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),      my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
                    'text' => 'Construction Space'},                     'text' => 'Authoring Space'},
                   {'href' => '',                    {'href' => '',
                    'text' => 'Problem Editing'}];                     'text' => 'Problem Editing'}];
   
Line 1190  sub newproblem { Line 1214  sub newproblem {
  my $errormsg;   my $errormsg;
  my $instructions;   my $instructions;
         my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),          my $brcrum = [{'href' => &Apache::loncommon::authorspace($request->uri),
                        'text' => 'Construction Space'},                         'text' => 'Authoring Space'},
                       {'href' => '',                        {'href' => '',
                        'text' => "Create New $extension"}];                         'text' => "Create New $extension"}];
  my $start_page =    my $start_page = 

Removed from v.1.337  
changed lines
  Added in v.1.338


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