--- loncom/interface/londocs.pm 2009/06/05 10:51:13 1.369 +++ loncom/interface/londocs.pm 2009/07/14 17:33:43 1.381 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.369 2009/06/05 10:51:13 bisitz Exp $ +# $Id: londocs.pm,v 1.381 2009/07/14 17:33:43 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -262,8 +262,9 @@ sub dumpcourse { sub exportbutton { my $type = &Apache::loncommon::course_type(); - return ''. + return ''. &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'
'; } @@ -277,8 +278,8 @@ sub exportcourse { my $numdisc = keys(%discussiontime); my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package'). - '

IMS Export Failed

'. + $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package'). + '

'.&mt('IMS Export Failed').'

'. '
'. &mt('Unable to retrieve information about course contents'). '
'.&mt('Return to Course Editor').''); @@ -298,7 +299,17 @@ sub exportcourse { my @exportitems = &Apache::loncommon::get_env_multiple('form.archive'); my @discussions = &Apache::loncommon::get_env_multiple('form.discussion'); if (@exportitems == 0 && @discussions == 0) { - $outcome = '
As you did not select any content items or discussions for export, an IMS package has not been created. Please go back to select either content items or discussions for export'; + $outcome = + '

' + .&mt('As you did not select any content items or discussions' + .' for export, an IMS package has not been created.') + .'

' + .'

' + .&mt('Please [_1]go back[_2] to select either content items' + .' or discussions for export.' + ,'' + ,'') + .'

'; } else { my $now = time; my %symbs; @@ -321,22 +332,30 @@ sub exportcourse { open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $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('[_1]Your IMS package[_2] is ready for download.' + ,'','') + .'

'; } 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.').'
'; + $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.') + .'

' + .'

' + .&mt('Go Back') + .'

'; } } - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package')); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); + $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); $r->print($outcome); $r->print(&Apache::loncommon::end_page()); } else { @@ -489,13 +508,13 @@ function containerCheck(item) { // ]]> |; - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package', + $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package', $scripttag)); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); $r->print($display. '

'. '

'); + &mt('Export').'" />

'); } } @@ -1030,7 +1049,7 @@ sub breadcrumbs { } $plain=~s/\>\;\s*$//; return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', - 'LC_docs_path', undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order); + undef, undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order); } sub log_docs { @@ -1254,10 +1273,11 @@ sub print_paste_buffer { my ($r,$container) = @_; return if (!defined($env{'docs.markedcopy_url'})); - $r->print(<

-ENDPASTE - $r->print(' '); + $r->print('

' + .''.&mt('Clipboard').'' + .'
' + .' ' + ); my $type; if ($env{'docs.markedcopy_url'} =~ m{^(?:/adm/wrapper/ext|(?:http|https)(?::|:))//} ) { @@ -1271,7 +1291,7 @@ ENDPASTE if ($extension eq 'sequence' && $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) { $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); - $icon .= '/folder_closed.gif'; + $icon .= '/navmap.folder.closed.gif'; } $icon = ''; $r->print($icon.$type.': '. &parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'}))); @@ -1286,7 +1306,7 @@ ENDPASTE '); } - $r->print('

'); + $r->print('
'); } sub do_paste_from_buffer { @@ -1569,34 +1589,66 @@ sub editor { my $idx=0; my $shown=0; if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) { - $r->print('

'.&mt('Parameters').':

' + .'
' + .'
'); # --------------------------------------------------------- Standard documents my $savefolderpath; my $active = 'style="display: none;"'; @@ -2939,8 +2991,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'; @@ -2951,11 +3001,11 @@ HIDDENFORM } my $postexec=''; if ($folder eq 'default') { - $r->print('' + $r->print(''."\n" ); } else { #$postexec='self.close();'; @@ -2981,12 +3031,13 @@ RFORM my $imspform=(< - + IMSPFORM my $newnavform=(< + $uploadtag @@ -2998,6 +3049,7 @@ IMSPFORM NNFORM my $newsmppageform=(< + $uploadtag @@ -3009,6 +3061,7 @@ NSPFORM my $newsmpproblemform=(< + $uploadtag @@ -3021,6 +3074,7 @@ NSPROBFORM my $newdropboxform=(< + $uploadtag @@ -3032,6 +3086,7 @@ NDBFORM my $newexuploadform=(< + $uploadtag @@ -3044,6 +3099,7 @@ NEXUFORM my $newbulform=(< + $uploadtag @@ -3056,6 +3112,7 @@ NBFORM my $newaboutmeform=(< + $uploadtag @@ -3068,6 +3125,7 @@ NAMFORM my $newaboutsomeoneform=(< + $uploadtag @@ -3080,6 +3138,7 @@ NASOFORM my $newrosterform=(< + $uploadtag @@ -3100,6 +3159,7 @@ my $newfolderform;
+ + + $uploadtag @@ -3134,6 +3196,7 @@ NSYLFORM my $newgroupfileform=(< + $uploadtag @@ -3157,10 +3220,10 @@ if($env{'form.pagepath'}) { my %orderhash = ( 'aa' => ['Upload Document',$fileuploadform.'
'.$newfolderform], - 'bb' => ['Published Documents',$simpleeditdefaultform], + 'bb' => ['Published Resources',$simpleeditdefaultform], 'cc' => ['Special Documents',$specialdocumentsform], 'dd' => ['Tools',$extresourcesform.'
'.$imspform.'
'.$recoverform.'
'.&generate_admin_options($containertag,$uploadtag,\%help,\%env)], - 'zz' => ['Hide all Options'], + 'zz' => ['Hide'], ); my $tid='1'; my $varcd = 'Main Course Documents'; @@ -3175,6 +3238,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'}) { } @@ -3183,7 +3248,7 @@ $r->print('
'); if($activeClass == 1){ $active = 'style="display: block;"'; } - $r->print('
'); + $r->print('
'); my $folder=$env{'form.folder'}; unless ($folder=~/^supplemental/) { $folder='supplemental'; @@ -3205,6 +3270,7 @@ $r->print('
'); my $supupdocform=(< + $fileupload

@@ -3227,6 +3293,7 @@ SUPDOCFORM my $supnewfolderform=(< + @@ -3240,6 +3307,7 @@ SNFFORM my $supnewextform=(< + @@ -3252,6 +3320,7 @@ SNEFORM my $supnewsylform=(< + @@ -3264,6 +3333,7 @@ SNSFORM my $supnewaboutmeform=(< + @@ -3279,7 +3349,7 @@ SNAMFORM my %suporderhash = ( 'ee' => ['Upload Document',$supupdocform.'
'.$supnewfolderform], 'ff' => ['Special Documents',$supnewextform.'
'.$supnewsylform.'
'.$supnewaboutmeform], - 'zz' => ['Hide all Options'], + 'zz' => ['Hide'], ); my $tid='2'; @@ -3347,21 +3417,42 @@ 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 .= '
'; @@ -3574,13 +3665,21 @@ function unselectInactive(nav) { currentNav = document.getElementById(nav); currentLis = currentNav.getElementsByTagName('LI'); for (i = 0; i < currentLis.length; i++) { - currentLis[i].className = 'i'; + if(currentLis[i].className == 'right active' || currentLis[i].className == 'right'){ + currentLis[i].className = 'right'; + }else{ + currentLis[i].className = 'i'; + } } } function hideAll(current, nav, data) { unselectInactive(nav); -current.className = 'active'; +if(current.className == 'right'){ + current.className = 'right active' + }else{ + current.className = 'active'; +} currentData = document.getElementById(data); currentDivs = currentData.getElementsByTagName('DIV'); for (i = 0; i < currentDivs.length; i++) { @@ -3590,8 +3689,25 @@ for (i = 0; i < currentDivs.length; i++) } } +function openTabs(pageId) { + tabnav = document.getElementById(pageId).getElementsByTagName('UL'); + if(tabnav.length > 0 ){ + currentNav = document.getElementById(tabnav[0].id); + currentLis = currentNav.getElementsByTagName('LI'); + for(i = 0; i< currentLis.length; i++){ + if(currentLis[i].className == 'active') { + funcString = currentLis[i].onclick.toString(); + tab = funcString.split('"'); + currentData = document.getElementById(tab[1]); + currentData.style.display = 'block'; + } + } + } +} + function showPage(current, pageId, nav, data) { hideAll(current, nav, data); + openTabs(pageId); unselectInactive(nav); current.className = 'active'; currentData = document.getElementById(pageId);