version 1.1074, 2012/05/06 22:09:14
|
version 1.1075.2.11, 2012/08/01 04:34:00
|
Line 5060 sub bodytag {
|
Line 5060 sub bodytag {
|
|
|
|
|
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { |
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { |
if ($dc_info) { |
unless ($env{'request.noversionuri'} =~ m{/res/adm/pages/bookmarkmenu/}) { |
$dc_info = qq|<span class="LC_cusr_subheading">$dc_info</span>|; |
if ($dc_info) { |
} |
$dc_info = qq|<span class="LC_cusr_subheading">$dc_info</span>|; |
$bodytag .= qq|<div id="LC_nav_bar">$name $role<br /> |
} |
<em>$realm</em> $dc_info</div>|; |
$bodytag .= qq|<div id="LC_nav_bar">$name $role<br /> |
|
<em>$realm</em> $dc_info</div>|; |
|
} |
return $bodytag; |
return $bodytag; |
} |
} |
|
|
Line 5163 i.e., $env{'internal.head.redirect'} exi
|
Line 5165 i.e., $env{'internal.head.redirect'} exi
|
|
|
sub endbodytag { |
sub endbodytag { |
my ($args) = @_; |
my ($args) = @_; |
my $endbodytag='</body>'; |
my $endbodytag; |
|
unless ((ref($args) eq 'HASH') && ($args->{'notbody'})) { |
|
$endbodytag='</body>'; |
|
} |
$endbodytag=&Apache::lontexconvert::jsMath_process()."\n".$endbodytag; |
$endbodytag=&Apache::lontexconvert::jsMath_process()."\n".$endbodytag; |
if ( exists( $env{'internal.head.redirect'} ) ) { |
if ( exists( $env{'internal.head.redirect'} ) ) { |
if (!(ref($args) eq 'HASH' && $args->{'noredirectlink'})) { |
if (!(ref($args) eq 'HASH' && $args->{'noredirectlink'})) { |
Line 6446 fieldset > legend {
|
Line 6451 fieldset > legend {
|
ol.LC_primary_menu { |
ol.LC_primary_menu { |
float: right; |
float: right; |
margin: 0; |
margin: 0; |
|
padding: 0; |
background-color: $pgbg_or_bgcolor; |
background-color: $pgbg_or_bgcolor; |
} |
} |
|
|
Line 6454 ol#LC_PathBreadcrumbs {
|
Line 6460 ol#LC_PathBreadcrumbs {
|
} |
} |
|
|
ol.LC_primary_menu li { |
ol.LC_primary_menu li { |
display: inline; |
color: RGB(80, 80, 80); |
padding: 5px 5px 0 10px; |
vertical-align: middle; |
|
text-align: left; |
|
list-style: none; |
|
float: left; |
|
} |
|
|
|
ol.LC_primary_menu li a { |
|
display: block; |
|
margin: 0; |
|
padding: 0 5px 0 10px; |
|
text-decoration: none; |
|
} |
|
|
|
ol.LC_primary_menu li ul { |
|
display: none; |
|
width: 10em; |
|
background-color: $data_table_light; |
|
} |
|
|
|
ol.LC_primary_menu li:hover ul, ol.LC_primary_menu li.hover ul { |
|
display: block; |
|
position: absolute; |
|
margin: 0; |
|
padding: 0; |
|
z-index: 2; |
|
} |
|
|
|
ol.LC_primary_menu li:hover li, ol.LC_primary_menu li.hover li { |
|
font-size: 90%; |
vertical-align: top; |
vertical-align: top; |
|
float: none; |
|
border-left: 1px solid black; |
|
border-right: 1px solid black; |
|
} |
|
|
|
ol.LC_primary_menu li:hover li a, ol.LC_primary_menu li.hover li a { |
|
background-color:$data_table_light; |
|
} |
|
|
|
ol.LC_primary_menu li li a:hover { |
|
color:$button_hover; |
|
background-color:$data_table_dark; |
} |
} |
|
|
ol.LC_primary_menu li img { |
ol.LC_primary_menu li img { |
vertical-align: bottom; |
vertical-align: bottom; |
height: 1.1em; |
height: 1.1em; |
|
margin: 0.2em 0 0 0; |
} |
} |
|
|
ol.LC_primary_menu a { |
ol.LC_primary_menu a { |
Line 6507 ul#LC_secondary_menu {
|
Line 6554 ul#LC_secondary_menu {
|
margin: 0; |
margin: 0; |
width: 100%; |
width: 100%; |
text-align: left; |
text-align: left; |
|
float: left; |
} |
} |
|
|
ul#LC_secondary_menu li { |
ul#LC_secondary_menu li { |
font-weight: bold; |
font-weight: bold; |
line-height: 1.8em; |
line-height: 1.8em; |
padding: 0 0.8em; |
|
border-right: 1px solid black; |
border-right: 1px solid black; |
display: inline; |
|
vertical-align: middle; |
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; |
} |
} |
|
|
ul.LC_TabContent { |
ul.LC_TabContent { |
Line 6855 ul#LC_toolbar {
|
Line 6940 ul#LC_toolbar {
|
list-style:none; |
list-style:none; |
position:relative; |
position:relative; |
background-color:white; |
background-color:white; |
|
overflow: auto; |
} |
} |
|
|
ul#LC_toolbar li { |
ul#LC_toolbar li { |
Line 6864 ul#LC_toolbar li {
|
Line 6950 ul#LC_toolbar li {
|
float: left; |
float: left; |
display:inline; |
display:inline; |
vertical-align:middle; |
vertical-align:middle; |
|
white-space: nowrap; |
} |
} |
|
|
|
|
Line 7315 sub end_page {
|
Line 7402 sub end_page {
|
} else { |
} else { |
$result .= &endbodytag($args); |
$result .= &endbodytag($args); |
} |
} |
$result .= "\n</html>"; |
unless ($args->{'notbody'}) { |
|
$result .= "\n</html>"; |
|
} |
|
|
if ($args->{'js_ready'}) { |
if ($args->{'js_ready'}) { |
$result = &js_ready($result); |
$result = &js_ready($result); |
Line 7655 sub validate_page {
|
Line 7744 sub validate_page {
|
|
|
|
|
sub start_scrollbox { |
sub start_scrollbox { |
my ($outerwidth,$width,$height,$id)=@_; |
my ($outerwidth,$width,$height,$id,$bgcolor)=@_; |
unless ($outerwidth) { $outerwidth='520px'; } |
unless ($outerwidth) { $outerwidth='520px'; } |
unless ($width) { $width='500px'; } |
unless ($width) { $width='500px'; } |
unless ($height) { $height='200px'; } |
unless ($height) { $height='200px'; } |
my ($table_id,$div_id); |
my ($table_id,$div_id,$tdcol); |
if ($id ne '') { |
if ($id ne '') { |
$table_id = " id='table_$id'"; |
$table_id = " id='table_$id'"; |
$div_id = " id='div_$id'"; |
$div_id = " id='div_$id'"; |
} |
} |
return "<table style='width: $outerwidth; border: 1px solid none;'$table_id><tr><td style='width: $width;' bgcolor='#FFFFFF'><div style='overflow:auto; width:$width; height: $height;'$div_id>"; |
if ($bgcolor ne '') { |
|
$tdcol = "background-color: $bgcolor;"; |
|
} |
|
return <<"END"; |
|
<table style="width: $outerwidth; border: 1px solid none;"$table_id><tr><td style="width: $width;$tdcol"><div style="overflow:auto; width:$width; height: $height;"$div_id> |
|
END |
} |
} |
|
|
sub end_scrollbox { |
sub end_scrollbox { |
Line 9262 sub get_env_multiple {
|
Line 9356 sub get_env_multiple {
|
sub ask_for_embedded_content { |
sub ask_for_embedded_content { |
my ($actionurl,$state,$allfiles,$codebase,$args)=@_; |
my ($actionurl,$state,$allfiles,$codebase,$args)=@_; |
my (%subdependencies,%dependencies,%mapping,%existing,%newfiles,%pathchanges, |
my (%subdependencies,%dependencies,%mapping,%existing,%newfiles,%pathchanges, |
%currsubfile,%unused); |
%currsubfile,%unused,$rem); |
my $counter = 0; |
my $counter = 0; |
my $numnew = 0; |
my $numnew = 0; |
my $numremref = 0; |
my $numremref = 0; |
Line 9275 sub ask_for_embedded_content {
|
Line 9369 sub ask_for_embedded_content {
|
my $heading = &mt('Upload embedded files'); |
my $heading = &mt('Upload embedded files'); |
my $buttontext = &mt('Upload'); |
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')) { |
if (($actionurl eq '/adm/portfolio') || ($actionurl eq '/adm/coursegrp_portfolio')) { |
my $current_path='/'; |
my $current_path='/'; |
if ($env{'form.currentpath'}) { |
if ($env{'form.currentpath'}) { |
Line 9304 sub ask_for_embedded_content {
|
Line 9402 sub ask_for_embedded_content {
|
if (ref($args) eq 'HASH') { |
if (ref($args) eq 'HASH') { |
$url = $args->{'docs_url'}; |
$url = $args->{'docs_url'}; |
$toplevel = $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') { |
} elsif ($actionurl eq '/adm/dependencies') { |
if ($env{'request.course.id'} ne '') { |
if ($env{'request.course.id'} ne '') { |
Line 9313 sub ask_for_embedded_content {
|
Line 9418 sub ask_for_embedded_content {
|
$url = $args->{'docs_url'}; |
$url = $args->{'docs_url'}; |
$title = $args->{'docs_title'}; |
$title = $args->{'docs_title'}; |
$toplevel = "/$url"; |
$toplevel = "/$url"; |
|
($rem) = ($toplevel =~ m{^(.+/)[^/]+$}); |
($path) = |
($path) = |
($toplevel =~ m{^(\Q/uploaded/$cdom/$cnum/\E(?:docs|supplemental)/(?:default|\d+)/\d+)/}); |
($toplevel =~ m{^(\Q/uploaded/$cdom/$cnum/\E(?:docs|supplemental)/(?:default|\d+)/\d+)/}); |
$fileloc = &Apache::lonnet::filelocation('',$toplevel); |
$fileloc = &Apache::lonnet::filelocation('',$toplevel); |
Line 9375 sub ask_for_embedded_content {
|
Line 9481 sub ask_for_embedded_content {
|
my @subdir_list = grep(!/^\./,readdir($dir)); |
my @subdir_list = grep(!/^\./,readdir($dir)); |
map {$currsubfile{$path}{$_} = 1;} @subdir_list; |
map {$currsubfile{$path}{$_} = 1;} @subdir_list; |
} |
} |
} elsif ($actionurl eq '/adm/dependencies') { |
} elsif (($actionurl eq '/adm/dependencies') || |
|
(($actionurl eq '/adm/coursedocs') && (ref($args) eq 'HASH') && |
|
($args->{'context'} eq 'paste'))) { |
if ($env{'request.course.id'} ne '') { |
if ($env{'request.course.id'} ne '') { |
my ($dir) = ($fileloc =~ m{^(.+/)[^/]+$}); |
my ($dir) = ($fileloc =~ m{^(.+/)[^/]+$}); |
if ($dir ne '') { |
if ($dir ne '') { |
Line 9411 sub ask_for_embedded_content {
|
Line 9519 sub ask_for_embedded_content {
|
if (ref($currsubfile{$path}) eq 'HASH') { |
if (ref($currsubfile{$path}) eq 'HASH') { |
foreach my $file (keys(%{$currsubfile{$path}})) { |
foreach my $file (keys(%{$currsubfile{$path}})) { |
unless ($subdependencies{$path}{$file}) { |
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; |
$unused{$path.'/'.$file} = 1; |
} |
} |
} |
} |
Line 9433 sub ask_for_embedded_content {
|
Line 9547 sub ask_for_embedded_content {
|
my @dir_list = grep(!/^\./,readdir($dir)); |
my @dir_list = grep(!/^\./,readdir($dir)); |
map {$currfile{$_} = 1;} @dir_list; |
map {$currfile{$_} = 1;} @dir_list; |
} |
} |
} elsif ($actionurl eq '/adm/dependencies') { |
} elsif (($actionurl eq '/adm/dependencies') || |
|
(($actionurl eq '/adm/coursedocs') && (ref($args) eq 'HASH') && |
|
($args->{'context'} eq 'paste'))) { |
if ($env{'request.course.id'} ne '') { |
if ($env{'request.course.id'} ne '') { |
my ($dir) = ($fileloc =~ m{^(.+/)[^/]+$}); |
my ($dir) = ($fileloc =~ m{^(.+/)[^/]+$}); |
if ($dir ne '') { |
if ($dir ne '') { |
Line 9467 sub ask_for_embedded_content {
|
Line 9583 sub ask_for_embedded_content {
|
unless (($file eq $filename) || |
unless (($file eq $filename) || |
($file eq $filename.'.bak') || |
($file eq $filename.'.bak') || |
($dependencies{$file})) { |
($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; |
$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)) { |
foreach my $embed_file (sort {lc($a) cmp lc($b)} keys(%newfiles)) { |
if ($actionurl eq '/adm/dependencies') { |
if ($actionurl eq '/adm/dependencies') { |
next if ($embed_file =~ m{^\w+://}); |
next if ($embed_file =~ m{^\w+://}); |
Line 9486 sub ask_for_embedded_content {
|
Line 9616 sub ask_for_embedded_content {
|
$numremref++; |
$numremref++; |
} elsif ($args->{'error_on_invalid_names'} |
} elsif ($args->{'error_on_invalid_names'} |
&& $embed_file ne &Apache::lonnet::clean_filename($embed_file,{'keep_path' => 1,})) { |
&& $embed_file ne &Apache::lonnet::clean_filename($embed_file,{'keep_path' => 1,})) { |
|
|
$upload_output.='<span class="LC_warning">'.&mt('Invalid characters').'</span>'; |
$upload_output.='<span class="LC_warning">'.&mt('Invalid characters').'</span>'; |
$numinvalid++; |
$numinvalid++; |
} else { |
} else { |
Line 10974 function dependencyCheck(form,count,offs
|
Line 11103 function dependencyCheck(form,count,offs
|
document.getElementById('arc_depon_'+count).style.display='block'; |
document.getElementById('arc_depon_'+count).style.display='block'; |
form.elements[depitem].options.length = 0; |
form.elements[depitem].options.length = 0; |
form.elements[depitem].options[0] = new Option('Select','',true,true); |
form.elements[depitem].options[0] = new Option('Select','',true,true); |
for (var i=1; i<count; i++) { |
for (var i=1; i<=numitems; i++) { |
|
if (i == count) { |
|
continue; |
|
} |
var startelement = $startcount + (i-1) * 7; |
var startelement = $startcount + (i-1) * 7; |
for (var j=1; j<6; j++) { |
for (var j=1; j<6; j++) { |
if ((j != 2) && (j!= 4)) { |
if ((j != 2) && (j!= 4)) { |
Line 11115 sub process_extracted_files {
|
Line 11247 sub process_extracted_files {
|
my (%referrer,%orphaned,%todelete,%todeletedir,%newdest,%newseqid); |
my (%referrer,%orphaned,%todelete,%todeletedir,%newdest,%newseqid); |
if ($numitems) { |
if ($numitems) { |
for (my $i=1; $i<=$numitems; $i++) { |
for (my $i=1; $i<=$numitems; $i++) { |
|
next if ($env{'form.archive_'.$i} eq 'dependency'); |
my $path = $env{'form.archive_content_'.$i}; |
my $path = $env{'form.archive_content_'.$i}; |
if ($path =~ /^\Q$pathtocheck\E/) { |
if ($path =~ /^\Q$pathtocheck\E/) { |
if ($env{'form.archive_'.$i} eq 'discard') { |
if ($env{'form.archive_'.$i} eq 'discard') { |
Line 11165 sub process_extracted_files {
|
Line 11298 sub process_extracted_files {
|
my ($outtext,$errtext) = |
my ($outtext,$errtext) = |
&LONCAPA::map::storemap('/uploaded/'.$docudom.'/'. |
&LONCAPA::map::storemap('/uploaded/'.$docudom.'/'. |
$docuname.'/'.$folders{$outer}. |
$docuname.'/'.$folders{$outer}. |
'.'.$containers{$outer},1); |
'.'.$containers{$outer},1,1); |
$newseqid{$i} = $newidx; |
$newseqid{$i} = $newidx; |
unless ($errtext) { |
unless ($errtext) { |
$result .= '<li>'.&mt('Folder: [_1] added to course',$docstitle).'</li>'."\n"; |
$result .= '<li>'.&mt('Folder: [_1] added to course',$docstitle).'</li>'."\n"; |
Line 11198 sub process_extracted_files {
|
Line 11331 sub process_extracted_files {
|
my ($outtext,$errtext)= |
my ($outtext,$errtext)= |
&LONCAPA::map::storemap('/uploaded/'.$docudom.'/'. |
&LONCAPA::map::storemap('/uploaded/'.$docudom.'/'. |
$docuname.'/'.$folders{$outer}. |
$docuname.'/'.$folders{$outer}. |
'.'.$containers{$outer},1); |
'.'.$containers{$outer},1,1); |
unless ($errtext) { |
unless ($errtext) { |
if (-e "$prefix$dir/$docstype/$mapinner{$outer}/$newidx/$title") { |
if (-e "$prefix$dir/$docstype/$mapinner{$outer}/$newidx/$title") { |
$result .= '<li>'.&mt('File: [_1] added to course',$docstitle).'</li>'."\n"; |
$result .= '<li>'.&mt('File: [_1] added to course',$docstitle).'</li>'."\n"; |
Line 11206 sub process_extracted_files {
|
Line 11339 sub process_extracted_files {
|
} |
} |
} |
} |
} |
} |
} elsif ($env{'form.archive_'.$i} eq 'dependency') { |
} |
my ($title) = ($path =~ m{/([^/]+)$}); |
} else { |
$referrer{$i} = $env{'form.archive_dependent_on_'.$i}; |
$warning .= &mt('Item extracted from archive: [_1] has unexpected path.',$path).'<br />'; |
if ($env{'form.archive_'.$referrer{$i}} eq 'display') { |
} |
if (ref($dirorder{$i}) eq 'ARRAY') { |
} |
my ($itemidx,$fullpath,$relpath); |
for (my $i=1; $i<=$numitems; $i++) { |
|
next unless ($env{'form.archive_'.$i} eq 'dependency'); |
|
my $path = $env{'form.archive_content_'.$i}; |
|
if ($path =~ /^\Q$pathtocheck\E/) { |
|
my ($title) = ($path =~ m{/([^/]+)$}); |
|
$referrer{$i} = $env{'form.archive_dependent_on_'.$i}; |
|
if ($env{'form.archive_'.$referrer{$i}} eq 'display') { |
|
if (ref($dirorder{$i}) eq 'ARRAY') { |
|
my ($itemidx,$fullpath,$relpath); |
|
if (ref($dirorder{$referrer{$i}}) eq 'ARRAY') { |
|
my $container = $dirorder{$referrer{$i}}->[-1]; |
for (my $j=0; $j<@{$dirorder{$i}}; $j++) { |
for (my $j=0; $j<@{$dirorder{$i}}; $j++) { |
if (ref($dirorder{$referrer{$i}}) eq 'ARRAY') { |
if ($dirorder{$i}->[$j] eq $container) { |
my $container = $dirorder{$referrer{$i}}->[-1]; |
$itemidx = $j; |
for (my $j=0; $j<@{$dirorder{$i}}; $j++) { |
|
if ($dirorder{$i}->[$j] eq $container) { |
|
$itemidx = $j; |
|
} |
|
} |
|
} |
} |
} |
} |
if ($itemidx ne '') { |
} |
if (grep(/^\Q$referrer{$i}\E$/,@archdirs)) { |
if ($itemidx eq '') { |
if ($mapinner{$referrer{$i}}) { |
$itemidx = 0; |
$fullpath = "$prefix$dir/$docstype/$mapinner{$referrer{$i}}"; |
} |
for (my $j=$itemidx; $j<@{$dirorder{$i}}; $j++) { |
if (grep(/^\Q$referrer{$i}\E$/,@archdirs)) { |
if (grep(/^\Q$dirorder{$i}->[$j]\E$/,@archdirs)) { |
if ($mapinner{$referrer{$i}}) { |
unless (defined($newseqid{$dirorder{$i}->[$j]})) { |
$fullpath = "$prefix$dir/$docstype/$mapinner{$referrer{$i}}"; |
$fullpath .= '/'.$titles{$dirorder{$i}->[$j]}; |
for (my $j=$itemidx; $j<@{$dirorder{$i}}; $j++) { |
$relpath .= '/'.$titles{$dirorder{$i}->[$j]}; |
if (grep(/^\Q$dirorder{$i}->[$j]\E$/,@archdirs)) { |
if (!-e $fullpath) { |
unless (defined($newseqid{$dirorder{$i}->[$j]})) { |
mkdir($fullpath,0755); |
$fullpath .= '/'.$titles{$dirorder{$i}->[$j]}; |
} |
$relpath .= '/'.$titles{$dirorder{$i}->[$j]}; |
} |
if (!-e $fullpath) { |
} else { |
mkdir($fullpath,0755); |
last; |
|
} |
} |
} |
} |
|
} else { |
|
last; |
} |
} |
} elsif ($newdest{$referrer{$i}}) { |
} |
$fullpath = $newdest{$referrer{$i}}; |
} |
for (my $j=$itemidx; $j<@{$dirorder{$i}}; $j++) { |
} elsif ($newdest{$referrer{$i}}) { |
if ($env{'form.archive_'.$dirorder{$i}->[$j]} eq 'discard') { |
$fullpath = $newdest{$referrer{$i}}; |
$orphaned{$i} = $env{'form.archive_'.$dirorder{$i}->[$j]}; |
for (my $j=$itemidx; $j<@{$dirorder{$i}}; $j++) { |
last; |
if ($env{'form.archive_'.$dirorder{$i}->[$j]} eq 'discard') { |
} elsif (grep(/^\Q$dirorder{$i}->[$j]\E$/,@archdirs)) { |
$orphaned{$i} = $env{'form.archive_'.$dirorder{$i}->[$j]}; |
unless (defined($newseqid{$dirorder{$i}->[$j]})) { |
last; |
$fullpath .= '/'.$titles{$dirorder{$i}->[$j]}; |
} elsif (grep(/^\Q$dirorder{$i}->[$j]\E$/,@archdirs)) { |
$relpath .= '/'.$titles{$dirorder{$i}->[$j]}; |
unless (defined($newseqid{$dirorder{$i}->[$j]})) { |
if (!-e $fullpath) { |
$fullpath .= '/'.$titles{$dirorder{$i}->[$j]}; |
mkdir($fullpath,0755); |
$relpath .= '/'.$titles{$dirorder{$i}->[$j]}; |
} |
if (!-e $fullpath) { |
} |
mkdir($fullpath,0755); |
} else { |
|
last; |
|
} |
} |
} |
} |
|
} else { |
|
last; |
} |
} |
if ($fullpath ne '') { |
} |
if (-e "$prefix$path") { |
} |
system("mv $prefix$path $fullpath/$title"); |
if ($fullpath ne '') { |
} |
if (-e "$prefix$path") { |
if (-e "$fullpath/$title") { |
system("mv $prefix$path $fullpath/$title"); |
my $showpath; |
} |
if ($relpath ne '') { |
if (-e "$fullpath/$title") { |
$showpath = "$relpath/$title"; |
my $showpath; |
} else { |
if ($relpath ne '') { |
$showpath = "/$title"; |
$showpath = "$relpath/$title"; |
} |
} else { |
$result .= '<li>'.&mt('[_1] included as a dependency',$showpath).'</li>'."\n"; |
$showpath = "/$title"; |
} |
|
unless ($ishome) { |
|
my $fetch = "$fullpath/$title"; |
|
$fetch =~ s/^\Q$prefix$dir\E//; |
|
$prompttofetch{$fetch} = 1; |
|
} |
|
} |
} |
|
$result .= '<li>'.&mt('[_1] included as a dependency',$showpath).'</li>'."\n"; |
|
} |
|
unless ($ishome) { |
|
my $fetch = "$fullpath/$title"; |
|
$fetch =~ s/^\Q$prefix$dir\E//; |
|
$prompttofetch{$fetch} = 1; |
} |
} |
} |
} |
} elsif ($env{'form.archive_'.$referrer{$i}} eq 'discard') { |
|
$warning .= &mt('[_1] is a dependency of [_2], which was discarded.', |
|
$path,$env{'form.archive_content_'.$referrer{$i}}).'<br />'; |
|
} |
} |
|
} elsif ($env{'form.archive_'.$referrer{$i}} eq 'discard') { |
|
$warning .= &mt('[_1] is a dependency of [_2], which was discarded.', |
|
$path,$env{'form.archive_content_'.$referrer{$i}}).'<br />'; |
} |
} |
} else { |
} else { |
$warning .= &mt('Item extracted from archive: [_1] has unexpected path.',$path).'<br />'; |
$warning .= &mt('Item extracted from archive: [_1] has unexpected path.',$path).'<br />'; |
} |
} |
} |
} |
if (keys(%todelete)) { |
if (keys(%todelete)) { |
Line 13666 sub init_user_environment {
|
Line 13805 sub init_user_environment {
|
%domdef = &Apache::lonnet::get_domain_defaults($domain); |
%domdef = &Apache::lonnet::get_domain_defaults($domain); |
} |
} |
|
|
foreach my $tool ('aboutme','blog','portfolio') { |
foreach my $tool ('aboutme','blog','webdav','portfolio') { |
$userenv{'availabletools.'.$tool} = |
$userenv{'availabletools.'.$tool} = |
&Apache::lonnet::usertools_access($username,$domain,$tool,'reload', |
&Apache::lonnet::usertools_access($username,$domain,$tool,'reload', |
undef,\%userenv,\%domdef,\%is_adv); |
undef,\%userenv,\%domdef,\%is_adv); |
Line 13793 sub build_release_hashes {
|
Line 13932 sub build_release_hashes {
|
return; |
return; |
} |
} |
|
|
|
sub update_content_constraints { |
|
my ($cdom,$cnum,$chome,$cid) = @_; |
|
my %curr_reqd_hash = &Apache::lonnet::userenvironment($cdom,$cnum,'internal.releaserequired'); |
|
my ($reqdmajor,$reqdminor) = split(/\./,$curr_reqd_hash{'internal.releaserequired'}); |
|
my %checkresponsetypes; |
|
foreach my $key (keys(%Apache::lonnet::needsrelease)) { |
|
my ($item,$name,$value) = split(/:/,$key); |
|
if ($item eq 'resourcetag') { |
|
if ($name eq 'responsetype') { |
|
$checkresponsetypes{$value} = $Apache::lonnet::needsrelease{$key} |
|
} |
|
} |
|
} |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if (defined($navmap)) { |
|
my %allresponses; |
|
foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) { |
|
my %responses = $res->responseTypes(); |
|
foreach my $key (keys(%responses)) { |
|
next unless(exists($checkresponsetypes{$key})); |
|
$allresponses{$key} += $responses{$key}; |
|
} |
|
} |
|
foreach my $key (keys(%allresponses)) { |
|
my ($major,$minor) = split(/\./,$checkresponsetypes{$key}); |
|
if (($major > $reqdmajor) || ($major == $reqdmajor && $minor > $reqdminor)) { |
|
($reqdmajor,$reqdminor) = ($major,$minor); |
|
} |
|
} |
|
undef($navmap); |
|
} |
|
unless (($reqdmajor eq '') && ($reqdminor eq '')) { |
|
&Apache::lonnet::update_released_required($reqdmajor.'.'.$reqdminor,$cdom,$cnum,$chome,$cid); |
|
} |
|
return; |
|
} |
|
|
|
sub parse_supplemental_title { |
|
my ($title) = @_; |
|
|
|
my ($foldertitle,$renametitle); |
|
if ($title =~ /&&&/) { |
|
$title = &HTML::Entites::decode($title); |
|
} |
|
if ($title =~ m/^(\d+)___&&&___($match_username)___&&&___($match_domain)___&&&___(.*)$/) { |
|
$renametitle=$4; |
|
my ($time,$uname,$udom) = ($1,$2,$3); |
|
$foldertitle=&Apache::lontexconvert::msgtexconverted($4); |
|
my $name = &plainname($uname,$udom); |
|
$name = &HTML::Entities::encode($name,'"<>&\''); |
|
$renametitle = &HTML::Entities::encode($renametitle,'"<>&\''); |
|
$title='<i>'.&Apache::lonlocal::locallocaltime($time).'</i> '. |
|
$name.': <br />'.$foldertitle; |
|
} |
|
if (wantarray) { |
|
return ($title,$foldertitle,$renametitle); |
|
} |
|
return $title; |
|
} |
|
|
=pod |
=pod |
|
|
=back |
=back |