--- loncom/interface/loncommon.pm 2012/08/01 04:34:00 1.1075.2.11 +++ loncom/interface/loncommon.pm 2012/06/30 23:02:20 1.1083 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1075.2.11 2012/08/01 04:34:00 raeburn Exp $ +# $Id: loncommon.pm,v 1.1083 2012/06/30 23:02:20 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5060,13 +5060,11 @@ sub bodytag { if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { - unless ($env{'request.noversionuri'} =~ m{/res/adm/pages/bookmarkmenu/}) { - if ($dc_info) { - $dc_info = qq|$dc_info|; - } - $bodytag .= qq|
|; - } + if ($dc_info) { + $dc_info = qq|$dc_info|; + } + $bodytag .= qq| |; return $bodytag; } @@ -6554,53 +6552,15 @@ ul#LC_secondary_menu { margin: 0; width: 100%; text-align: left; - float: left; } ul#LC_secondary_menu li { font-weight: bold; line-height: 1.8em; - border-right: 1px solid black; - vertical-align: middle; - float: left; -} - -ul#LC_secondary_menu li.LC_hoverable:hover, ul#LC_secondary_menu li.hover { - background-color: $data_table_light; -} - -ul#LC_secondary_menu li a { padding: 0 0.8em; -} - -ul#LC_secondary_menu li ul { - display: none; -} - -ul#LC_secondary_menu li:hover ul, ul#LC_secondary_menu li.hover ul { - display: block; - position: absolute; - margin: 0; - padding: 0; - list-style:none; - float: none; - background-color: $data_table_light; - z-index: 2; - margin-left: -1px; -} - -ul#LC_secondary_menu li ul li { - font-size: 90%; - vertical-align: top; - border-left: 1px solid black; border-right: 1px solid black; - background-color: $data_table_light - list-style:none; - float: none; -} - -ul#LC_secondary_menu li ul li:hover, ul#LC_secondary_menu li ul li.hover { - background-color: $data_table_dark; + display: inline; + vertical-align: middle; } ul.LC_TabContent { @@ -9356,7 +9316,7 @@ sub get_env_multiple { sub ask_for_embedded_content { my ($actionurl,$state,$allfiles,$codebase,$args)=@_; my (%subdependencies,%dependencies,%mapping,%existing,%newfiles,%pathchanges, - %currsubfile,%unused,$rem); + %currsubfile,%unused); my $counter = 0; my $numnew = 0; my $numremref = 0; @@ -9369,10 +9329,6 @@ sub ask_for_embedded_content { my $heading = &mt('Upload embedded files'); my $buttontext = &mt('Upload'); - my $navmap; - if ($env{'request.course.id'}) { - $navmap = Apache::lonnavmaps::navmap->new(); - } if (($actionurl eq '/adm/portfolio') || ($actionurl eq '/adm/coursegrp_portfolio')) { my $current_path='/'; if ($env{'form.currentpath'}) { @@ -9402,13 +9358,6 @@ sub ask_for_embedded_content { if (ref($args) eq 'HASH') { $url = $args->{'docs_url'}; $toplevel = $url; - if ($args->{'context'} eq 'paste') { - ($cdom,$cnum) = ($url =~ m{^\Q/uploaded/\E($match_domain)/($match_courseid)/}); - ($path) = - ($toplevel =~ m{^(\Q/uploaded/$cdom/$cnum/\E(?:docs|supplemental)/(?:default|\d+)/\d+)/}); - $fileloc = &Apache::lonnet::filelocation('',$toplevel); - $fileloc =~ s{^/}{}; - } } } elsif ($actionurl eq '/adm/dependencies') { if ($env{'request.course.id'} ne '') { @@ -9418,7 +9367,6 @@ sub ask_for_embedded_content { $url = $args->{'docs_url'}; $title = $args->{'docs_title'}; $toplevel = "/$url"; - ($rem) = ($toplevel =~ m{^(.+/)[^/]+$}); ($path) = ($toplevel =~ m{^(\Q/uploaded/$cdom/$cnum/\E(?:docs|supplemental)/(?:default|\d+)/\d+)/}); $fileloc = &Apache::lonnet::filelocation('',$toplevel); @@ -9481,9 +9429,7 @@ sub ask_for_embedded_content { my @subdir_list = grep(!/^\./,readdir($dir)); map {$currsubfile{$path}{$_} = 1;} @subdir_list; } - } elsif (($actionurl eq '/adm/dependencies') || - (($actionurl eq '/adm/coursedocs') && (ref($args) eq 'HASH') && - ($args->{'context'} eq 'paste'))) { + } elsif ($actionurl eq '/adm/dependencies') { if ($env{'request.course.id'} ne '') { my ($dir) = ($fileloc =~ m{^(.+/)[^/]+$}); if ($dir ne '') { @@ -9519,12 +9465,6 @@ sub ask_for_embedded_content { if (ref($currsubfile{$path}) eq 'HASH') { foreach my $file (keys(%{$currsubfile{$path}})) { unless ($subdependencies{$path}{$file}) { - next if (($rem ne '') && - (($env{"httpref.$rem"."$path/$file"} ne '') || - (ref($navmap) && - (($navmap->getResourceByUrl($rem."$path/$file") ne '') || - (($file =~ /^(.*\.s?html?)\.bak$/i) && - ($navmap->getResourceByUrl($rem."$path/$1"))))))); $unused{$path.'/'.$file} = 1; } } @@ -9547,9 +9487,7 @@ sub ask_for_embedded_content { my @dir_list = grep(!/^\./,readdir($dir)); map {$currfile{$_} = 1;} @dir_list; } - } elsif (($actionurl eq '/adm/dependencies') || - (($actionurl eq '/adm/coursedocs') && (ref($args) eq 'HASH') && - ($args->{'context'} eq 'paste'))) { + } elsif ($actionurl eq '/adm/dependencies') { if ($env{'request.course.id'} ne '') { my ($dir) = ($fileloc =~ m{^(.+/)[^/]+$}); if ($dir ne '') { @@ -9583,23 +9521,9 @@ sub ask_for_embedded_content { unless (($file eq $filename) || ($file eq $filename.'.bak') || ($dependencies{$file})) { - if ($actionurl eq '/adm/dependencies') { - next if (($rem ne '') && - (($env{"httpref.$rem".$file} ne '') || - (ref($navmap) && - (($navmap->getResourceByUrl($rem.$file) ne '') || - (($file =~ /^(.*\.s?html?)\.bak$/i) && - ($navmap->getResourceByUrl($rem.$1))))))); - } $unused{$file} = 1; } } - if (($actionurl eq '/adm/coursedocs') && (ref($args) eq 'HASH') && - ($args->{'context'} eq 'paste')) { - $counter = scalar(keys(%existing)); - $numpathchg = scalar(keys(%pathchanges)); - return ($output,$counter,$numpathchg,\%existing); - } foreach my $embed_file (sort {lc($a) cmp lc($b)} keys(%newfiles)) { if ($actionurl eq '/adm/dependencies') { next if ($embed_file =~ m{^\w+://}); @@ -9616,6 +9540,7 @@ sub ask_for_embedded_content { $numremref++; } elsif ($args->{'error_on_invalid_names'} && $embed_file ne &Apache::lonnet::clean_filename($embed_file,{'keep_path' => 1,})) { + $upload_output.=''.&mt('Invalid characters').''; $numinvalid++; } else { @@ -11103,10 +11028,7 @@ function dependencyCheck(form,count,offs document.getElementById('arc_depon_'+count).style.display='block'; form.elements[depitem].options.length = 0; form.elements[depitem].options[0] = new Option('Select','',true,true); - for (var i=1; i<=numitems; i++) { - if (i == count) { - continue; - } + for (var i=1; i