[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Sun, 24 Aug 2008 13:48:40 -0000


This is a MIME encoded message

--raeburn1219585720
Content-Type: text/plain

raeburn		Sun Aug 24 09:48:40 2008 EDT

  Modified files:              
    /loncom/imspackages	imsimport.pm 
  Log:
  - Localization
  - Remove font tags
  - Replace tables with datatable from loncommon.
  - Include counts of items created for CMSs besides BB5 and ANGEL
  - Pass ref to %total as additional argument to imsprocessor::copy_resources() to get
  cont of files copied.
  - Use lonhtmlcommon::topic_bar()   
  
  
--raeburn1219585720
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20080824094840.txt"

Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.22 loncom/imspackages/imsimport.pm:1.23
--- loncom/imspackages/imsimport.pm:1.22	Mon Dec  4 21:55:54 2006
+++ loncom/imspackages/imsimport.pm	Sun Aug 24 09:48:40 2008
@@ -29,6 +29,7 @@
 use Apache::loncommon();
 use Apache::lonnet;
 use Apache::imsprocessor;
+use Apache::lonlocal;
 use HTML::Parser;
 use HTML::Entities();
 use Apache::lonlocal;
@@ -38,7 +39,7 @@
 
 # ----------------------------------------------------------------  Jscript One
 sub jscript_one {
-    my ($fullpath,$jsref) = @_;
+    my ($fullpath,$jsref,$formname) = @_;
 
     my %body_layout = ('rightmargin'  => "0",
 		       'leftmargin'   => "0",
@@ -53,14 +54,22 @@
     my $end_page = 
 	&Apache::loncommon::end_page({'js_ready' => 1,});
 
+    my %lt = &Apache::lonlocal::texthash( 
+               ddir => 'You must choose a destination directory for the import',
+               cmss => 'You must choose the Course Management System from which the IMS package was exported',
+               loca => 'Location:',
+               newd => 'New Directory',
+               nndi => 'Enter the name of the new directory where you will store the contents of your IMS package.',
+               go => 'Go', 
+             );
     $$jsref = <<"END_OF_ONE";
 function verify() {
- if ((document.forms.dataForm.newdir.value == '')  || (!document.forms.dataForm.newdir.value)) {
-   alert("You must choose a destination directory for the import")
+ if ((document.forms.$formname.newdir.value == '')  || (!document.forms.$formname.newdir.value)) {
+   alert('$lt{'ddir'}')
    return false
  }
- if (document.forms.dataForm.source.selectedIndex == 0) {
-   alert("You must choose the Course Management System from which the IMS package was exported");
+ if (document.forms.$formname.source.selectedIndex == 0) {
+   alert('$lt{'cmss'}');
    return false
  }
  return true
@@ -68,27 +77,27 @@
 
 function nextPage() {
   if (verify()) {
-    document.forms.dataForm.submit()
+    document.forms.$formname.submit();
   }
 }
 
 function createWin() {
-  document.dataForm.newdir.value = "";
+  document.$formname.newdir.value = "";
   newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes")
   newWindow.document.open()
   newWindow.document.write('$start_page')
   newWindow.document.write("\\n<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]'>\\n")
-  newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='600' bgcolor='#CCFFDD'>\\n")
+  newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='600'>\\n")
   newWindow.document.write("<tr><td width='2'>&nbsp;</td><td width='3'>&nbsp;</td>\\n")
-  newWindow.document.write("<td><h3>Location: <tt>$fullpath</tt></h3><h3>New Directory</h3></td></tr>\\n")
+  newWindow.document.write("<td><h3>$lt{'loca'} <tt>$fullpath</tt></h3><h3>$lt{'newd'}</h3></td></tr>\\n")
   newWindow.document.write("<tr><td width='2'>&nbsp;</td><td width='3'>&nbsp;</td>\\n")
   newWindow.document.write("<td><form name='fileaction' action='/adm/cfile' method='post'>\\n")
-  newWindow.document.write("<font face='arial,helvetica,sans-serif'>Enter the name of the new directory where you will store the contents of your IMS package.<br /><br />")
+  newWindow.document.write("$lt{'nndi'}<br /><br />")
   newWindow.document.write("<input type='hidden' name='filename' value='$fullpath' />")
   newWindow.document.write("<input type='hidden' name='action' value='newdir' />")
   newWindow.document.write("<input type='hidden' name='callingmode' value='imsimport' />")
   newWindow.document.write("$fullpath<input type='text' name='newfilename' value='' />")
-  newWindow.document.write("<input type='button' value='Go' onClick='document.fileaction.submit();' />")
+  newWindow.document.write("<input type='button' value='$lt{'go'}' onClick='document.fileaction.submit();' />")
   newWindow.document.write("</td></tr>\\n")
   newWindow.document.write("</table>")
   newWindow.document.write('$end_page')
@@ -278,102 +287,26 @@
 
 # ---------------------------------------------------------------- Display One
 sub display_one {
-    my ($r,$uname,$fn,$fullpath) = @_;
-    $r->print(<<"END_OF_ONE");
-<form name="dataForm" method="post">
-<table border='0' bgcolor='#CCFFDD' cellspacing='0' cellpadding ='0' width='100%'>
-    <tr>
-     <td colspan='2'>
-      <table border='0' cellspacing='0' cellpadding='0'>
-       <tr>
-        <td colspan='2'  align='left'>&nbsp;
-        </td>
-       </tr>
-       <tr bgcolor='#ccddaa'>
-        <td valign='middle'><img src='/res/adm/pages/bl_step1.gif'>&nbsp;
-        </td>
-        <td width='100%' align='left'>&nbsp;&nbsp;
-         <font face='arial,helvetica,sans-serif'><b>Specify the Course Management system used to create the package.</b>&nbsp;&nbsp;
-         </font>
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;</td>
-      </tr>
-      <tr>
-       <td>&nbsp;</td>
-       <td>
-        <font face='Arial,Helvetica,sans-serif'>
-Please choose the CMS used to create your IMS content package.&nbsp;&nbsp;
+    my ($r,$uname,$fn,$fullpath,$formname) = @_;
+    $r->print('<form name="'.$formname.'" method="post">'.
+              &Apache::lonhtmlcommon::topic_bar(1,&mt('Specify the Course Management system used to create the package')).
+        &mt('Choose the CMS used to create your IMS content package.').'&nbsp;&nbsp;
         <select name="source">
-         <option value='-1' selected="true">Please select</option>
-         <option value='bb5'>Blackboard 5</option>
-         <option value='bb6'>Blackboard 6</option>
-         <option value='angel'>ANGEL</option>
-         <option value='webctce4'>WebCT 4 Campus Edition</option>
-         <option value='webctvista4'>WebCT Vista 4</option>
-        </select>
-        </font>
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;</td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;</td>
-      </tr>
-      <tr bgcolor='#ccddaa'>
-       <td valign='middle'><img src='/res/adm/pages/bl_step2.gif'>
-       </td>
-       <td width='100%' align='left'>&nbsp;&nbsp;
-        <font face='arial,helvetica,sans-serif'><b>Create a directory where you will unpack your IMS package.</b>&nbsp;&nbsp;</font></td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;</td>
-      </tr>
-       <td>&nbsp;</td>
-       <td>
-        <font face='Arial,Helvetica,sans-serif'>
-Please choose a destination LON-CAPA directory in which to store the contents of the IMS package file. <input type="button" name="createdir" value="Create Directory" onClick="javascript:createWin()" /><input type="hidden" name="newdir" value="" /></font>
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;<br /><br /></td>
-      </tr>
-      <tr>
-       <td>&nbsp;</td>
-       <td><font face='arial,helvetica,sans-serif'>If you have selected the CMS used to create the IMS package, and have created a destination directory, click the 'Proceed' button to continue the IMS package upload process.</font></td>
-      </tr>
-      <tr>
-       <td colspan='2'>
-          <input type="hidden" name="uploaduname" value="$uname" />
-          <input type="hidden" name="filename" value="$fn" />
+         <option value="-1" selected="true">Please select</option>
+         <option value="bb5">Blackboard 5</option>
+         <option value="bb6">Blackboard 6</option>
+         <option value="angel">ANGEL</option>
+         <option value="webctce4">WebCT 4 Campus Edition</option>
+         <option value="webctvista4">WebCT Vista 4</option>
+        </select><br />'."\n".
+        &Apache::lonhtmlcommon::topic_bar(2,&mt('Create a directory where you will unpack your IMS package'))."\n".
+         &mt('Create a destination LON-CAPA directory in which to store the contents of the IMS package file.').'&nbsp;&nbsp;<input type="button" name="createdir" value="Create Directory" onClick="javascript:createWin()" /><input type="hidden" name="newdir" value="" /><br /><br />
+          <input type="hidden" name="uploaduname" value="'.$uname.'" />
+          <input type="hidden" name="filename" value="'.$fn.'" />
           <input type="hidden" name="phase" value="three" />
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;</td>
-      </tr>
-      <tr>
-       <td colspan='2'>
-        <table border='0' cellspacing='0' cellpadding='0' width="100%">
-         <tr>
-          <td align='left'>
-           <input type='button' name='exitpage' value='Exit now' onClick="javascript:location.href='$fullpath'" />
-          </td>
-          <td align='right'>
-           <input type="button" name="nextpage" value="Proceed" onClick="javascript:nextPage()" />
-          </td>
-         </tr>
-        </table>
-       </td>
-      </tr>
-     </table>
-    </td>
-   </tr>
-  </table>
-</form>
-END_OF_ONE
+          <input type="button" name="nextpage" value="'.&mt('Proceed').'" onClick="javascript:nextPage();" />&nbsp;&nbsp;&nbsp;&nbsp;
+          <input type="button" name="exitpage" value="'.&mt('Exit now').'" onClick="javascript:location.href='."'$fullpath'".'" />
+         </form>');
 }
 
 # ---------------------------------------------------------------- Display Two
@@ -396,7 +329,24 @@
     my %hrefs = ();
     my %resinfo = ();
     my %count = ();
-    my @bgcolors = ("#eeeeee","#dddddd");
+
+    my %lt = &Apache::lonlocal::texthash(
+                  cont => 'Choose which content types you wish to import',
+                  impo => 'Import',
+                  type => 'Content type',
+                  addo => 'Additional options',
+                  chec => 'Check Import first',
+                  bbus => 'Choose a course to receive bulletin boards and user enrollment',
+                  list => 'A listing of possible course targets will be displayed if import of bulletin boards and/or enrollment is checked above (step 3). If you do not plan to import either of these content types, there is no need to specify a course.',
+                  chco => 'Choose course:',
+                  nreq => 'Not required',
+                  yodo => 'You do not have active course coordinator status in any LON-CAPA courses currently, so bulletin boards and enrollment information included in your IMS package will be discarded, regardless of your import choice for these two items above (step 3).',
+                  ifyo => "If you wish to import bulletin boards and/or user information into LON-CAPA please click 'Exit now' to quit the current IMS import process, and contact your domain coordinator and request a course coordinator role in a LON-CAPA course into which you can upload bulletin boards and/or enroll users.",
+                  impa => 'Import package',
+                  unpa => 'Unpacking of your IMS package failed because an IMS manifest file was not located in the package',
+                  proc => 'Processing of your IMS package failed because the file you uploaded could not be unzipped',
+                  exit => 'Exit now',
+    );
 
     my $counter = 0;
     my $iter = 0;
@@ -413,7 +363,6 @@
                 users => 0,
                 );
     my $conditions;
-
     if ($unzip_result eq 'ok') {
         $manifest_result = &Apache::imsprocessor::process_manifest($cms,
                             $tempdir,\%resources,\%items,\%hrefs,\%resinfo,
@@ -451,171 +400,77 @@
                 $conditions = 'none';
             }
 
-            $r->print(<<ENDBLOCK);
-<form name="pickoptions" method="post">
-  <table border='0' cellspacing='0' cellpadding ='0' width='100%'>
-   <tr>
-    <td colspan='2'>
-     <table border='0' cellspacing='0' cellpadding='0'>
-      <tr>
-       <td colspan='2'  align='left'>&nbsp;
-       </td>
-      </tr>
-      <tr bgcolor='#ccddaa'>
-       <td valign='middle'><img src='/res/adm/pages/bl_step3.gif'>
-       </td>
-       <td width='100%' align='left'>&nbsp;&nbsp;
-        <font face='arial,helvetica,sans-serif'><b>Choose which content types you wish to import</b></font>
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;</td>
-      </tr>
-      <tr>
-       <td>&nbsp;</td>
-       <td>
-        <table border='0' cellspacing='0' cellpadding='1' bgcolor='#000000'>
-         <tr>
-          <td>
-           <table border='0' cellspacing='0' cellpadding='0' bgcolor='#ffffff' width='100%'>
-            <tr>
-             <td>
-              <table border='0' cellspacing='1' cellpadding='1' bgcolor='#ffffff' width='100%'>
-               <tr bgcolor='#ccddaa'>
-                <td align='center'><font face='arial,helvetica,sans-serif'><b>Import?</b></font></td>           
-                <td align='center'><font face='arial,helvetica,sans-serif'><b>Content type</b></font></td>
-                <td align='center'><font face='arial,helvetica,sans-serif'><b>Additional options</b></font></td>
-               </tr>
-ENDBLOCK
+            $r->print('<form name="pickoptions" method="post">'.
+                      &Apache::lonhtmlcommon::topic_bar(3,$lt{'cont'}).
+                      &Apache::loncommon::start_data_table().
+                      &Apache::loncommon::start_data_table_header_row().
+                      '<th>'.$lt{'impo'}.'</th><th>'.$lt{'cont'}.'</th><th>'.
+                      $lt{'addo'}.'</th>'.
+                      &Apache::loncommon::end_data_table_header_row());
             foreach my $area (@{$areas}) {
                 if ($count{$area} > 0) {
                     my $count_tag = 'flag_'.$counter;
-                    $r->print("               <tr bgcolor='@bgcolors[$iter]'>
-                <td align='left'><font face='arial,helvetica,sans-serif'><input name='$area' type='checkbox' ");
+                    $r->print(&Apache::loncommon::start_data_table_row()."\n".
+                              '<td><input name="'.$area.'" type="checkbox" ');
                     if ($area eq 'board' || $area eq 'users') {
-                        $r->print(qq|onClick='javascript:setOptions("$area","$counter")'|);
+                        $r->print('onClick="javascript:setOptions('."'$area','$counter'".');" ');
                     }
-                    $r->print("/></font></td>
-                <td align='left'><font face='arial,helvetica,sans-serif'>&nbsp;&nbsp;$$areaname{$area}&nbsp;&nbsp; - $count{$area} item(s)</font></td>");
+                    $r->print('/></td>'.
+                              '<td>&nbsp;&nbsp;'.$$areaname{$area}.'&nbsp;&nbsp; - '.
+                              &mt('[quant,_1,item]',$count{$area}).'</td>');
                     if ($area eq 'board') {
-                        $r->print("            <td align='left'><font face='arial,helvetica,sans-serif'>&nbsp;&nbsp;
-                 <select name='db_handling'>
-                  <option value='-2'>&lt;-- Check Import first</option>
-                 </select></font>
-                </td>");
+                        $r->print('<td>&nbsp;&nbsp;
+                 <select name="db_handling">
+                  <option value="-2">&lt;-- '.$lt{'chec'}.'</option>
+                 </select>
+                </td>');
                     } elsif ($area eq 'users') {
-                        $r->print("            <td align='left'><font face='arial,helvetica,sans-serif'>&nbsp;&nbsp;
-                 <select name='user_handling'>
-                  <option value='-2'>&lt;-- Check Import first</option>
+                        $r->print('<td>&nbsp;&nbsp;
+                 <select name="user_handling">
+                  <option value="-2">&lt;-- '.$lt{'chec'}.'</option>
                  </select>
-                 </font>        
-                </td>");
+                </td>');
                     } else {
-                        $r->print("            <td align='left'><font face='arial,helvetica,sans-serif'>&nbsp;&nbsp;None<input type='hidden' name='$count_tag' /></font></td>");
+                        $r->print('<td>&nbsp;&nbsp;'.&mt('None')."\n".
+                                  '<input type="hidden" name="'.$count_tag.'" /></td>');
                     }
                     $counter ++;
-                    $iter = $counter%2;
+                    $r->print(&Apache::loncommon::end_data_table_row());
                 }
             }
-            $r->print(<<ENDBLOCKTWO);
-               </tr>
-              </table>
-             </td>
-            </tr>
-           </table>
-          </td>
-         </tr>
-        </table>
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'  align='left'>&nbsp;
-       </td>
-      </tr>
-ENDBLOCKTWO
+            $r->print(&Apache::loncommon::end_data_table());
             if ($count{board} + $count{users} > 0) {
-                $r->print("
-      <tr bgcolor='#ccddaa'>
-       <td valign='middle'><img src='/res/adm/pages/bl_step4.gif'>
-       </td>
-       <td width='100%' align='left'>&nbsp;&nbsp;
-        <font face='arial,helvetica,sans-serif'><b>Choose a course to receive bulletin boards and user enrollment.</b></font>
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;</td>
-      </tr>
-                ");
+                $r->print(&Apache::lonhtmlcommon::topic_bar(4,$lt{'bbus'}));
                 if ($$numcrs > 0) {
-                    $r->print("      <tr>
-       <td>&nbsp;</td>
-       <td><font face='arial,helvetica,sans-serif'>A listing of possible course targets will be displayed if import of bulletin boards and/or enrollment is checked above (step 3). If you do not plan to import either of these content types, there is no need to specify a course.
-<br /><br />
-Choose course:&nbsp;&nbsp;
-                 <select name='targetcourse'>
-                  <option value='-1'>Not required</option>
-                 </select></font>
-       </td>
-      </tr>
-");
+                    $r->print($lt{'list'}.'<br /><br />'.$lt{'chco'}.'&nbsp;&nbsp;'."\n".
+                              '<select name="targetcourse">
+                                <option value="-1">'.$lt{'nreq'}.'</option>
+                               </select>');
                 } else {
-                    $r->print("       <tr>
-<td>&nbsp;</td>
-<td><font face='arial,helvetica,sans-serif'>You do not have active course coordinator status in any LON-CAPA courses currently, so bulletin boards and enrollment information included in your IMS package will be discarded, regardless of your import choice for these two items above (step 3). If you wish to import bulletin boards and/or user information into LON-CAPA please click 'Exit now' to quit the current IMS import process, and contact your domain coordinator and request a course coordinator role in a LON-CAPA course into which you can upload bulletin boards and/or enroll users.</font>
-        ");
-                }
-            }
-            $r->print(<<ENDBLOCK);
-      <tr>
-       <td colspan='2'>&nbsp;<br /><br /></td>
-      </tr>
-      <tr>
-       <td>&nbsp;</td>
-       <td><font face='arial,helvetica,sans-serif'>Once you have checked the checkboxes for all areas you wish to import from the IMS package, and selected additional options (if available) you should click the 'Import package' button.</font></td>
-      </tr>
-      <tr>
-       <td colspan='2'>&nbsp;
-          <input type="hidden" name="newdir" value="$env{'form.newdir'}" />
-          <input type="hidden" name="conditions" value="$conditions" />
-          <input type="hidden" name="source" value="$cms" />
-          <input type="hidden" name="tempdir" value="$tempdir" />
-          <input type="hidden" name="uploaduname" value="$uname">
-          <input type="hidden" name="filename" value="$fname">
-          <input type="hidden" name="phase" value="four" />
-ENDBLOCK
+                    $r->print($lt{'yodo'}.' '.$lt{'ifyo'});
+                }
+            }
+            $r->print('<br /><br />
+          <input type="hidden" name="newdir" value="'.$env{'form.newdir'}.'" />
+          <input type="hidden" name="conditions" value="'.$conditions.'" />
+          <input type="hidden" name="source" value="'.$cms.'" />
+          <input type="hidden" name="tempdir" value="'.$tempdir.'" />
+          <input type="hidden" name="uploaduname" value="'.$uname.'">
+          <input type="hidden" name="filename" value="'.$fname.'">
+          <input type="hidden" name="phase" value="four" />'."\n");
             if ($count{board} == 0) {
-                $r->print('            <input type="hidden" name="board" value="" />'."\n");
+                $r->print('<input type="hidden" name="board" value="" />'."\n");
             }
             if ($count{users} == 0) {
-                $r->print('            <input type="hidden" name="users" value="" />'."\n");
+                $r->print('<input type="hidden" name="users" value="" />'."\n");
             }
-            $r->print(<<ENDDOCUMENT);
-       </td>
-      </tr>
-      <tr>
-       <td colspan='2'>
-        <table border='0' cellspacing='0' cellpadding='0' width="100%">
-         <tr>
-          <td align='left'>
-           <input type='button' name='exitpage' value='Exit now' onClick="javascript:location.href='$fullpath'" />
-          </td>
-          <td align='right'>
-           <input type="button" name="nextpage" value="Import package" onClick="javascript:nextPage($counter)" />
-          </td>
-         </tr>
-        </table>
-       </td>
-      </tr>
-     </table>
-    </td>
-   </tr>
-  </table>
-ENDDOCUMENT
+            $r->print('<input type="button" name="nextpage" value="'.$lt{'impa'}.'" onClick="javascript:nextPage('."'$counter.'".')" />&nbsp;&nbsp;&nbsp;
+           <input type="button" name="exitpage" value="'.$lt{'exit'}.'" onClick="javascript:location.href='."'$fullpath'".'" /></form>');
         } else {
-            $r->print("Unpacking of your IMS package failed because an IMS manifest file was not located in the package\n");
+            $r->print($lt{'unpa'});
         }
     } else {
-        $r->print("Processing of your IMS package failed because the file you uploaded could not be unzipped\n");
+        $r->print($lt{'proc'});
     }
 }
 
@@ -655,6 +510,7 @@
                    board => 0,         
                    quiz => 0,
                    surv => 0,
+                   file => 0,
     );
 
     my @pages = ();
@@ -681,6 +537,14 @@
         }
     }
 
+    my %lt = &Apache::lonlocal::texthash (
+                 yims => 'Your IMS package has been processed successfully.',
+                 plsv => 'Please view the imported items and use the LON-CAPA editing tools to make changes.',
+                 tseq => "The sequences directory contains a file named 'Top.sequence' which includes links to the items found at the top level of your IMS package. From there you can follow links to display all the imported items. Alternatively, you can browse the pages, sequences, problems and resfiles directories directly. Note if you rename a file, you will need to modify any .sequence files or .page files which include a reference to the renamed file.",
+                 tfin => 'The final step in the IMS import process is to publish the materials you have imported into your Construction Space so that you can use them in a course. Once your files are published, subsequent re-publication will result in the storage of information about changes between the different versions.',
+                 disp => 'Display new directory',
+                 proc => 'Processing of your IMS package failed, because the IMS content package did not contain an IMS manifest file.'
+             );
     my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,
                           \%resources,\%items,\%hrefs,\%resinfo,'prepare',
                           \%includedres);
@@ -725,23 +589,23 @@
 
         &Apache::imsprocessor::process_resinfo($cms,'CSTR',$tempdir,$destdir,\%items,\%resources,\@targets,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$seqstem,$seqstem,\@resrcfiles,\@packages,\%hrefs,\@pages,\@sequences,\%randompicks);
 
-        my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\%importareas,\@assessmentfiles);
+        my $copy_result = &Apache::imsprocessor::copy_resources('CSTR',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$destdir,$timenow,\@assessmentfiles,\%total);
    
         &Apache::imsprocessor::build_structure($cms,'CSTR',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,$newdir,$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems,\%randompicks);
 
         $r->print("<h3>IMS import completed</h3>");
 
-        if ($cms eq 'bb5') {
-            $r->print("<font face='arial,helvetica,sans-serif'>Your IMS package has been processed successfully. A total of $total{seq} sequences, $total{page} pages, $total{board} bulletin boards, $total{quiz} quizzes, $total{surv} surveys and $total{prob} problems have been created.<br /><br />\n");
-        } elsif ($cms eq 'angel') {
-            $r->print("<font face='arial,helvetica,sans-serif'>Your IMS package has been processed successfully. A total of $total{seq} sequences, $total{page} pages, and $total{board} bulletin boards have been created.<br /><br />\n");
+        if ($cms eq 'angel') {
+            $r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], and [quant,_3,bulletin board] have been created, and [quant,_4,file] copied.',$total{seq},$total{page},$total{board},$total{file})."\n");
+        } else {
+            $r->print($lt{'yims'}.' '.&mt('A total of [quant,_1,sequence], [quant,_2,composite page], [quant,_3,bulletin board], [quant,_4,quiz,quizzes], [quant,_5,survey], and [quant,_6,problem] have been created, and [quant,_7,file] copied.',$total{seq},$total{page},$total{board},$total{quiz},$total{surv},$total{prob},$total{file})."\n");
         }
-       $r->print("Please view the imported items and use the LON-CAPA editing tools to make changes.  The sequences directory contains a file named 'Top.sequence' which includes links to the items found at the top level of your IMS package. From there you can follow links to display all the imported items. Alternatively, you can browse the pages, sequences, problems and resfiles directories directly. Note if you rename a file, you will need to modify any .sequence files or .page files which include a reference to the renamed file.<br /><br />The final step in the IMS import process is to publish the materials you have imported into your Construction Space so that you can use them in a course. Once your file are published, subsequent re-publication will result in the storage of information about changes between the different versions.<br /><br /><a href='/priv/".$uname."/".$newdir."'>Display new directory</a></font>"); 
-        if ($destdir =~ m-^/home/$uname/public_html/-) { 
+        $r->print('<br /><br />'.$lt{'plsv'}.' '.$lt{'tseq'}.'<br /><br />'.$lt{'tfin'}.'<br /><br /><a href="/priv/'.$uname.'/'.$newdir.'">'.$lt{'disp'}.'</a>');
+        if ($destdir =~ m-^/home/$uname/public_html/-) {
             system (" rm -r -f $destdir/temp");
         }
     } elsif ($manifest_result eq 'nomanifest') {
-        $r->print("<font face='arial,helvetica,sans-serif'>Processing of your IMS package failed, because the IMS content package did not contain an IMS manifest file.</font>");
+        $r->print($lt{'proc'});
     }
 }
 
@@ -880,8 +744,9 @@
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
 
+    my $formname_one = 'info';
     if ($env{'form.phase'} eq 'two') {
-        &jscript_one($fullpath,\$javascript,$uname,$udom);
+        &jscript_one($fullpath,\$javascript,$formname_one);
     } elsif ($env{'form.phase'} eq 'three') {
         &jscript_two(\$javascript,$user,$dom,\$numcrs);
     } elsif ($env{'form.phase'} eq 'four') {
@@ -899,7 +764,7 @@
     if ($env{'form.phase'} eq 'two') {
         my $flag = &Apache::lonupload::phasetwo($r,$fn,$uname,$udom,'imsimport');
         if ($flag eq 'ok') {
-            &display_one($r,$uname,$fn,$fullpath);
+            &display_one($r,$uname,$fn,$fullpath,$formname_one);
         }
     } elsif ( ($env{'form.phase'} eq 'three') || ($env{'form.phase'} eq 'four') ) {
         my $docroot = $env{'form.newdir'};

--raeburn1219585720--