--- loncom/interface/londocs.pm 2009/05/04 16:45:57 1.365 +++ loncom/interface/londocs.pm 2009/06/17 17:15:00 1.372 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.365 2009/05/04 16:45:57 bisitz Exp $ +# $Id: londocs.pm,v 1.372 2009/06/17 17:15:00 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -142,7 +142,7 @@ sub dumpcourse { my ($r) = @_; my $type = &Apache::loncommon::course_type(); $r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space'). - '
'); + ''); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Dump '.$type.' DOCS to Construction Space')); my ($home,$other,%outhash)=&authorhosts(); unless ($home) { return ''; } @@ -321,9 +321,15 @@ sub exportcourse { open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $outcome .= &mt('Download the zip file from IMS '.lc($type).' archive
',$imszipfile,); + $outcome .= '

' + .&mt('Download the zip file from [_1]IMS '.lc($type).' archive[_2]' + ,'','') + .'

'; if ($copyresult) { - $outcome .= &mt('The following errors occurred during export - [_1]',$copyresult); + $outcome .= '

' + .&mt('The following errors occurred during export - [_1]' + ,$copyresult) + .'

'; } } else { $outcome = '
'.&mt('Unfortunately you will not be able to retrieve an IMS archive of this posts at this time, because there was a problem creating a manifest file.').'
'; @@ -335,21 +341,23 @@ sub exportcourse { $r->print(&Apache::loncommon::end_page()); } else { my $display; - $display = ''."\n"; - $display .= &mt('Choose which items you wish to export from your '.$type.'.

'); - $display .= ''. - ''. - ''. - ''. - '
 Content items'. - ''; + $display .= '
'. + ''.&mt('Content items').''. + ''. - '  
  
 Discussion posts'. - '
'. + '
'. + ''.&mt('Discussion posts').''. + ''. - '  
'; + '  '. + ''; my $curRes; my $depth = 0; my $count = 0; @@ -358,13 +366,17 @@ sub exportcourse { my %parent = (); my %children = (); my $lastcontainer = $startcount; - my @bgcolors = ('#F6F6F6','#FFFFFF'); - $display .= ''. - '' + .''; + $display .= '' + .&Apache::loncommon::end_data_table_header_row(); while ($curRes = $it->next()) { if (ref($curRes)) { $count ++; @@ -385,16 +397,17 @@ sub exportcourse { $ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; } } - my $color = $count%2; - $display .=''; + $display .= ' '.$curRes->title().''."\n"; + + # Existing discussion posts? if ($discussiontime{$ressymb} > 0) { $boards ++; $currelem = $count+$boards+$startcount; - $display .= ''."\n"; + $display .= ''."\n"; } else { - $display .= ''."\n"; + $display .= ''."\n"; } + $display .= &Apache::loncommon::end_data_table_row(); } } + $display .= &Apache::loncommon::end_data_table(); my $scripttag = qq| - |; $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package', $scripttag)); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); - $r->print($display.'
Export content item?
 '."\n"; + $display .= &Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row() + .''.&mt('Export content item?').''; if ($numdisc > 0) { - $display.='Export discussion posts?'."\n"; + $display .= &mt('Export discussion posts?'); + } else { + $display .= ' '; } - $display.=' 
'."\n". - ''."\n" + .'is_sequence()) || ($curRes->is_page())) { my $checkitem = $count + $boards + $startcount; - $display .= 'onClick="javascript:propagateCheck('."'$checkitem'".')"'; + $display .= 'onclick="javascript:propagateCheck('."'$checkitem'".')"'; } $display .= ' />'."\n"; for (my $i=0; $i<$depth; $i++) { - $display .= ''."\n"; + $display .= '' + .''."\n"; } if ($curRes->is_sequence()) { $display .= ' '."\n"; @@ -405,19 +418,25 @@ sub exportcourse { } my $currelem = $count+$boards+$startcount; $children{$parent{$depth}} .= $currelem.':'; - $display .= ' '.$curRes->title().'  ' + .'' + .'  
'. + $r->print($display. '

'. '

'); @@ -1004,8 +1023,7 @@ sub breadcrumbs { &Apache::lonhtmlcommon::add_breadcrumb( {'href'=>$url.$cpinfo, 'title'=>$name, - 'text'=>''. - $name.'', + 'text'=>$name, 'no_mt'=>1, }); $plain.=$name.' > '; @@ -1962,7 +1980,7 @@ END my $ro_set= ((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i?' checked="checked"':''); $rand_order_text =' -'; +'; } if ($ispage) { my $pagename=&escape($pagetitle); @@ -2006,12 +2024,12 @@ END $line.=(< $form_start - + $form_end $form_start - + $form_end $form_start $rand_order_text $form_end @@ -2094,7 +2112,7 @@ sub checkonthis { if (($errorcount) || ($warningcount)) { if ($errorcount) { - $r->print(''. + $r->print(''.&mt('bomb').''. &mt('[quant,_1,error]',$errorcount).''); } if ($warningcount) { @@ -2119,7 +2137,7 @@ sub checkonthis { unless ($url=~/\$/) { $r->print(''.&mt('not found').''); } else { - $r->print(''.&mt('unable to verify variable URL').''); + $r->print(''.&mt('unable to verify variable URL').''); } } else { $r->print(''.&mt('access denied').''); @@ -2484,14 +2502,18 @@ sub changewarning { $message='Changes will become active for your current session after [_1], or the next time you log in.'; } $r->print("\n\n". -''."\n". -'
'. +''."\n". +''. '

'. +'" />

'. &mt($message,' '). -$help{'Caching'}.'

'."\n\n"); + &mt('re-initializing '.$course_type).'" onclick="reinit(this.form)" />'). +$help{'Caching'}.'

'."\n\n"); } @@ -2647,7 +2669,11 @@ sub handler { $script .= &editing_js($udom,$uname); } # -------------------------------------------------------------------- Body tag - $script = ''; + $script = ''."\n"; my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}]; $r->print(&Apache::loncommon::start_page("$type Documents", $script, {'force_register' => $showdoc, @@ -2775,7 +2801,7 @@ sub handler { 'title' => 'Title', 'comment' => 'Comment', 'parse' => 'Upload embedded images/multimedia files if HTML file!', - 'nd' => 'New Document', + 'nd' => 'Upload Document', 'pm' => 'Published Map', 'sd' => 'Special Document', 'mo' => 'More Options', @@ -2798,6 +2824,7 @@ CHBO my $fileuploadform=(< + $fileupload
$lt{'title'}:
@@ -2819,22 +2846,23 @@ FUFORM my $simpleeditdefaultform=(< + $lt{'pubd'}
$uploadtag - +
- + $help{'Importing_LON-CAPA_Resource'}
- +

$lt{'copm'}

$help{'Load_Map'}

@@ -2846,7 +2874,7 @@ SEDFFORM $uploadtag - $help{'Adding_External_Resource'} @@ -2905,7 +2933,7 @@ HIDDENFORM } } $r->print('
  • '.&mt('Supplemental Course Documents').'
  • '); - $r->print('
    '); + $r->print('
    '); # --------------------------------------------------------- Standard documents my $savefolderpath; my $active = 'style="display: none;"'; @@ -2913,8 +2941,6 @@ HIDDENFORM $active = 'style="display: block;"'; } $r->print('
    '); - $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc', - &mt('Editing the Table of Contents for your '.$type))); my $folder=$env{'form.folder'}; if ($folder eq '' || $folder=~/^supplemental/) { $folder='default'; @@ -2925,7 +2951,12 @@ HIDDENFORM } my $postexec=''; if ($folder eq 'default') { - $r->print(''); + $r->print(''."\n" + ); } else { #$postexec='self.close();'; } @@ -2943,19 +2974,20 @@ HIDDENFORM my $recoverform=(< - + RFORM my $imspform=(< - + IMSPFORM my $newnavform=(< + $uploadtag @@ -2967,22 +2999,24 @@ IMSPFORM NNFORM my $newsmppageform=(< + $uploadtag $help{'Simple Page'} + onclick="javascript:makesmppage();" /> $help{'Simple Page'} NSPFORM my $newsmpproblemform=(< + $uploadtag $help{'Simple Problem'} + onclick="javascript:makesmpproblem();" />$help{'Simple Problem'} @@ -2990,22 +3024,24 @@ NSPROBFORM my $newdropboxform=(< + $uploadtag + onclick="javascript:makedropbox();" /> NDBFORM my $newexuploadform=(< + $uploadtag + onclick="javascript:makeexamupload();" /> $help{'Score_Upload_Form'} @@ -3013,11 +3049,12 @@ NEXUFORM my $newbulform=(< + $uploadtag + onclick="javascript:makebulboard();" /> $help{'Bulletin Board'} @@ -3025,6 +3062,7 @@ NBFORM my $newaboutmeform=(< + $uploadtag @@ -3037,11 +3075,12 @@ NAMFORM my $newaboutsomeoneform=(< + $uploadtag + onclick="javascript:makeabout();" /> NASOFORM @@ -3049,6 +3088,7 @@ NASOFORM my $newrosterform=(< + $uploadtag @@ -3069,9 +3109,10 @@ my $newfolderform;
    + $help{'Adding_Pages'}
    @@ -3081,9 +3122,10 @@ NPFORM
    + $help{'Adding_Folders'}
    @@ -3091,6 +3133,7 @@ NFFORM my $newsylform=(< + $uploadtag @@ -3103,6 +3146,7 @@ NSYLFORM my $newgroupfileform=(< + $uploadtag @@ -3125,7 +3169,7 @@ if($env{'form.pagepath'}) { } my %orderhash = ( - 'aa' => ['New Document',$fileuploadform.'
    '.$newfolderform], + 'aa' => ['Upload Document',$fileuploadform.'
    '.$newfolderform], 'bb' => ['Published Documents',$simpleeditdefaultform], 'cc' => ['Special Documents',$specialdocumentsform], 'dd' => ['Tools',$extresourcesform.'
    '.$imspform.'
    '.$recoverform.'
    '.&generate_admin_options($containertag,$uploadtag,\%help,\%env)], @@ -3144,6 +3188,8 @@ $r->print(&generate_edit_table($tid,$var } &changewarning($r,''); + $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc', + &mt('Editing the Table of Contents for your '.$type))); $r->print('
    '); if ($env{'form.pagepath'}) { } @@ -3174,6 +3220,7 @@ $r->print('
    '); my $supupdocform=(< + $fileupload

    @@ -3196,11 +3243,12 @@ SUPDOCFORM my $supnewfolderform=(< + $help{'Adding_Folders'} @@ -3209,11 +3257,12 @@ SNFFORM my $supnewextform=(< + $help{'Adding_External_Resource'} @@ -3221,6 +3270,7 @@ SNEFORM my $supnewsylform=(< + @@ -3233,6 +3283,7 @@ SNSFORM my $supnewaboutmeform=(< + @@ -3246,7 +3297,7 @@ SNAMFORM my %suporderhash = ( - 'ee' => ['New Document',$supupdocform.'
    '.$supnewfolderform], + 'ee' => ['Upload Document',$supupdocform.'
    '.$supnewfolderform], 'ff' => ['Special Documents',$supnewextform.'
    '.$supnewsylform.'
    '.$supnewaboutmeform], 'zz' => ['Hide all Options'], ); @@ -3316,21 +3367,40 @@ sub generate_edit_table { my ($tid,$varcd,$orderhash_ref) = @_; my %orderhash = %{$orderhash_ref}; my $form; - - $form = '

    '.&mt($varcd).'

    '; + my $activetab; + my $active; + if($env{'form.active'} ne ''){ + $activetab = $env{'form.active'}; + } + $form = '

    '.&mt($varcd).'

    '; $form .= ''; $form .= '
    '; foreach my $field (keys(%orderhash)){ if($field ne 'zz'){ - $form .= ''; + if($activetab eq '' || $activetab ne $field){ + $active = 'style="display: none;"'; + }elsif($activetab eq $field){ + $active = 'style="display:block;"'; + } + $form .= '
    '.${$orderhash{$field}}[1].'
    '; } } $form .= '
    ';