--- loncom/imspackages/imsimportdocs.pm 2009/11/20 11:16:59 1.25 +++ loncom/imspackages/imsimportdocs.pm 2009/11/20 17:01:11 1.28 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: imsimportdocs.pm,v 1.25 2009/11/20 11:16:59 bisitz Exp $ +# $Id: imsimportdocs.pm,v 1.28 2009/11/20 17:01:11 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -269,10 +269,7 @@ sub display_two { my %hrefs = (); my %resinfo = (); my %count = (); - my @bgcolors = ("#eeeeee","#dddddd"); - my $counter = 0; - my $iter = 0; my %count = ( announce => 0, board => 0, @@ -337,143 +334,119 @@ sub display_two { } } - $r->print(< - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  -
3 -    - Choose which content types you wish to import -
 
  - - - - -
- - - - -
- - - - - - -ENDBLOCK - foreach my $area (@{$areasref}) { - if ($count{$area} > 0) { - my $count_tag = 'flag_'.$counter; - $r->print(" - - "); - if ($area eq 'board') { - $r->print(" "); - } elsif ($area eq 'users') { - $r->print(" "); - } else { - $r->print(" "); - } - $counter ++; - $iter = $counter%2; - } - } - $r->print(< -
Import?Content typeAdditional options
print(qq|onClick='javascript:setOptions("$area","$counter")'|); - } - $r->print("/>  $$areaname{$area}   - $count{$area} item(s)   - -    - - -   None
-
-
-
 

4 -    - Choose display options for listing of contents of top level of package -
 
  - - - - - - - -
   
-
 
 Once you have checked the checkboxes for all areas you wish to import from the IMS package, selected options (if available), and selected a display option for the package contents you should click the 'Complete Import' button.
  - - - - -
- - - - - -
- - - -
-
-
-ENDDOCUMENT + + # Start output: Step 3 and step 4 + + $r->print( + '
' + .&Apache::lonhtmlcommon::topic_bar( + 3,&mt('Choose which content types you wish to import')) + .'

' + .&mt('Check the checkboxes for all areas you wish to import from the IMS package:') + .'

' + ); + + $r->print( + &Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row() + .''.&mt('Import?').'' + .''.&mt('Content type').'' + .''.&mt('Additional options').'' + .&Apache::loncommon::end_data_table_header_row() + ); + + # Display import row for each area/content type + foreach my $area (@{$areasref}) { + unless ($count{$area} > 0) { next }; + + my $count_tag = 'flag_'.$counter; + + # Checkbox: Import? + $r->print( + &Apache::loncommon::start_data_table_row() + .'print(qq| onclick='javascript:setOptions("$area","$counter")'|); + } + + $r->print(' />'); + + # Content Type + $r->print( + '' + .$$areaname{$area}.'   - ' + .&mt('[quant,_1,item]',$count{$area}) + .'' + ); + + # Additional Options + $r->print(''); + if ($area eq 'board') { + $r->print( + '' + ); + } elsif ($area eq 'users') { + $r->print( + '' + ); + } else { + $r->print( + &mt('None') + .'' + ); + } + $r->print(''); + + $r->print(&Apache::loncommon::end_data_table_row()); + $counter ++; + } + + $r->print(&Apache::loncommon::end_data_table()); + + $r->print( + &Apache::lonhtmlcommon::topic_bar( + 4,&mt('Choose display options for listing of contents of top level of package')) + .'

' + .&mt('Select a display option for the package content:') + .'

' + ); + $r->print( + '' + .' ' + .'
' + .'' + ); + + # Buttons + $r->print( + '' + .'' + .'' + .'' + ); + $r->print( + '
' + .'

' + .'' + .' ' + .'' + .'

' + ); + + $r->print('
'); } @@ -636,47 +609,30 @@ sub display_three { if ($tempdir =~ m/^\/home\/httpd\/perl\/tmp\/$crs\/\d{10}/) { system("rm -r -f $tempdir"); } - $r->print(< - - - - - - - - - - - - - - - - - -
  -
5 -    - Your import is complete -
 
  -ENDBLOCK - my $initblock = qq| -
- - -

Changes will become active for your current session after - - |; - $initblock .= ', '.&mt('or the next time you log in.'); - $initblock .= qq|

|; - $r->print($initblock); - $r->print(< -
-ENDBLOCKTWO + + # All done, display success message + $r->print( + '

' + .&mt('Your import is complete.') + .'

' + ); + # Re-initialize Button + my $initbutton = + ''; + $r->print( + '
' + .'' + .'' + .'' + .'

' + .&mt('Changes will become active for your current session after [_1]' + .', or the next time you log in.' + ,$initbutton) + .'

' + .'
' + ); } 1;