--- loncom/interface/londocs.pm 2009/07/14 12:27:52 1.380 +++ loncom/interface/londocs.pm 2009/10/18 15:32:36 1.395 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.380 2009/07/14 12:27:52 bisitz Exp $ +# $Id: londocs.pm,v 1.395 2009/10/18 15:32:36 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,6 +35,7 @@ use Apache::Constants qw(:common :http); use Apache::imsexport; use Apache::lonnet; use Apache::loncommon; +use Apache::lonhtmlcommon; use LONCAPA::map(); use Apache::lonratedt(); use Apache::lonxml; @@ -119,8 +120,8 @@ sub dumpbutton { my $type = &Apache::loncommon::course_type(); if ($home+$other==0) { return ''; } if ($home) { - return ''. + my $link = "".&mt('Dump '.$type.' DOCS to Construction Space').""; + return $link.' '. &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs').'
'; } else { return '
'. @@ -262,9 +263,7 @@ sub dumpcourse { sub exportbutton { my $type = &Apache::loncommon::course_type(); - return ''. + return "".&mt('IMS Export')."". &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'
'; } @@ -999,7 +998,7 @@ sub group_import { } sub breadcrumbs { - my ($where,$allowed,$type)=@_; + my ($allowed,$type)=@_; &Apache::lonhtmlcommon::clear_breadcrumbs(); my (@folders); if ($env{'form.pagepath'}) { @@ -1014,6 +1013,15 @@ sub breadcrumbs { my $isencrypted=0; my $ishidden=0; my $is_random_order=0; + if (!$allowed) { + my $description = $env{'course.'.$env{'request.course.id'}.'.description'}; + &Apache::lonhtmlcommon::add_breadcrumb( + {'href' => '/adm/menu', + 'title'=> 'Go to main menu', + 'text' => $description, + }); + $plain .= $description.' >'; + } while (@folders) { my $folder=shift(@folders); my $foldername=shift(@folders); @@ -1033,11 +1041,7 @@ sub breadcrumbs { if ($3) { $isencrypted=1; } if ($4 ne '') { $is_random_order = 1; } if ($folder eq 'supplemental') { - if ($allowed) { - $name = &mt('Supplemental '.$type.' Documents'); - } else { - $name = &mt($type.' Documents'); - } + $name = &mt('Supplemental '.$type.' Documents'); } &Apache::lonhtmlcommon::add_breadcrumb( {'href'=>$url.$cpinfo, @@ -1273,10 +1277,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)(?::|:))//} ) { @@ -1305,7 +1310,7 @@ ENDPASTE '); } - $r->print('

'); + $r->print('
'); } sub do_paste_from_buffer { @@ -1493,7 +1498,6 @@ sub handle_edit_cmd { sub editor { my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$type)=@_; - my $container= ($env{'form.pagepath'}) ? 'page' : 'sequence'; @@ -1508,9 +1512,14 @@ sub editor { $LONCAPA::map::resources[$idx]=''; } - my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)= - &breadcrumbs($folder,$allowed,$type); - $r->print($breadcrumbtrail); + my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order); + if ($allowed) { + ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) = + &breadcrumbs($allowed,$type); + $r->print($breadcrumbtrail); + } else { + $randompick = -1; + } # ------------------------------------------------------------ Process commands @@ -1588,36 +1597,70 @@ sub editor { my $idx=0; my $shown=0; if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) { - $r->print('

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

'); - } $r->print(''); +$r->print(''); + + if ($allowed) { $r->print('
@@ -3367,17 +3443,18 @@ sub generate_admin_options { my %env = %{$env_ref}; my $dumpbut=&dumpbutton(); my $exportbut=&exportbutton(); - return (< - $help{'Verify_Content'}
- $help{'Check_Resource_Versions'}
- $dumpbut - $exportbut - -
- - -ENDOPTIONFORM + my @list = ( + {'pic21'=>"$lt{'vc'}$help{'Verify_Content'}"}, + {'pic22'=>"$lt{'cv'}$help{'Check_Resource_Versions'}"}, + ); + if($dumpbut ne ''){ + push @list, {'pic23'=>$dumpbut}; + } + push @list, ({'pic24'=>$exportbut}, + {'pic25'=>"$lt{'ls'}"}, + {'pic26'=>"$lt{'sl'}"}, + ); + return '
'.create_form_ul(create_list_elements(@list)).'
'; } @@ -3391,29 +3468,25 @@ sub generate_edit_table { if($env{'form.active'} ne ''){ $activetab = $env{'form.active'}; } - $form = '

'.&mt($varcd).'

'; + $form = '
'; $form .= ''; $form .= '
'; foreach my $field (keys(%orderhash)){ - if($field ne 'zz'){ + if($field ne '00'){ if($activetab eq '' || $activetab ne $field){ $active = 'style="display: none;"'; }elsif($activetab eq $field){ @@ -3660,8 +3733,8 @@ 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); + if(tabnav.length > 2 ){ + currentNav = document.getElementById(tabnav[1].id); currentLis = currentNav.getElementsByTagName('LI'); for(i = 0; i< currentLis.length; i++){ if(currentLis[i].className == 'active') { @@ -3684,6 +3757,13 @@ function showPage(current, pageId, nav, return false; } +function injectData(current, hiddenField, name, value) { + currentElement = document.getElementById(hiddenField); + currentElement.name = name; + currentElement.value = value; + current.submit(); +} + ENDNEWSCRIPT } 1;