--- loncom/interface/londocs.pm 2009/06/17 17:36:25 1.373 +++ loncom/interface/londocs.pm 2009/07/13 17:34:28 1.379 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.373 2009/06/17 17:36:25 bisitz Exp $ +# $Id: londocs.pm,v 1.379 2009/07/13 17:34:28 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 { @@ -1581,7 +1600,7 @@ sub editor { if ($is_random_order) { $r->print('

'.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown.').'

'); } - $r->print(''); + $r->print(&Apache::loncommon::start_data_table()); foreach my $res (@LONCAPA::map::order) { my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); $name=&LONCAPA::map::qtescape($name); @@ -1594,9 +1613,11 @@ sub editor { $shown++; } unless ($shown) { - $r->print(''); + $r->print(''); } - $r->print("\n
'.&mt('Currently no documents.').'

' + .&mt('Currently no documents.') + .'

\n"); + $r->print(&Apache::loncommon::end_data_table()); if ($allowed) { &print_paste_buffer($r,$container); } @@ -1759,7 +1780,7 @@ sub entryline { $renametitle=~s/\\/\\\\/g; $renametitle=~s/\"\;/\\\"/g; $renametitle=~s/ /%20/g; - my $line=''; + my $line=&Apache::loncommon::start_data_table_row(); my ($form_start,$form_end); # Edit commands my ($container, $type, $esc_path, $path, $symb); @@ -1862,18 +1883,16 @@ END $form_end = ''; $line.=(< - - - - - - - -
- $lt{ -
- $lt{ -
+
+ + $lt{ + +
+
+ + $lt{ + +
$form_start @@ -2007,10 +2026,10 @@ END undef($external); } $line.=' - + '.($url?'':'').''.($url?'':'').' - + '.($url?"":'').$title.($url?'':' '.&mt('(re-initialize course to access)').'').$external." "; if (($allowed) && ($folder!~/^supplemental/)) { @@ -2036,7 +2055,7 @@ END $form_start $parameterset $form_end ENDPARMS } - $line.=""; + $line.=&Apache::loncommon::end_data_table_row(); return $line; } @@ -2507,7 +2526,7 @@ sub changewarning { 'function reinit(tf) { tf.submit();'.$postexec.' }'."\n". '// ]]>'."\n". ''."\n". -'
'. +''. '

'. &mt($message,' - $lt{'pubd'}
$uploadtag
@@ -2919,7 +2936,7 @@ HIDDENFORM my $activeClass = 1; my $active = ''; $r->print('

'); + $r->print('' + .'
' + .'
'); # --------------------------------------------------------- Standard documents my $savefolderpath; my $active = 'style="display: none;"'; @@ -2981,7 +3000,7 @@ RFORM my $imspform=(< - + IMSPFORM @@ -3170,10 +3189,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'; @@ -3299,11 +3318,11 @@ SNAMFORM my %suporderhash = ( 'ee' => ['Upload Document',$supupdocform.'
'.$supnewfolderform], 'ff' => ['Special Documents',$supnewextform.'
'.$supnewsylform.'
'.$supnewaboutmeform], - 'zz' => ['Hide all Options'], + 'zz' => ['Hide'], ); my $tid='2'; -my $varscd = 'supplCourseDocuments'; +my $varscd = 'Supplemental Course Documents'; $r->print(&generate_edit_table($tid,$varscd,\%suporderhash)); my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); @@ -3377,18 +3396,18 @@ sub generate_edit_table { foreach my $name (sort(keys(%orderhash))){ if($name eq 'zz'){ if($activetab ne ''){ - $active = ''; + $active = 'class="right"'; }else{ - $active = 'class="active"'; + $active = 'class="right active"'; } - $form .= '
  • '.&mt(${$orderhash{$name}}[0]).'
  • '; + $form .= '
  • '.&mt(${$orderhash{$name}}[0]).'
  • '; }else{ if($activetab eq '' || $activetab ne $name){ $active = ''; }elsif($activetab eq $name){ $active = 'class="active"'; } - $form .= '
  • '.&mt(${$orderhash{$name}}[0]).'
  • '; + $form .= '
  • '.&mt(${$orderhash{$name}}[0]).'
  • '; } } $form .= ''; @@ -3400,7 +3419,7 @@ sub generate_edit_table { }elsif($activetab eq $field){ $active = 'style="display:block;"'; } - $form .= '
    '.${$orderhash{$field}}[1] .'
    '; } @@ -3615,13 +3634,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++) { @@ -3631,8 +3658,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);