version 1.618, 2016/11/30 00:27:20
|
version 1.621, 2017/02/18 23:39:15
|
Line 3339 sub editor {
|
Line 3339 sub editor {
|
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$coursenum,$coursedom,$crstype, |
$coursenum,$coursedom,$crstype, |
$pathitem,$supplementalflag,$container, |
$pathitem,$supplementalflag,$container, |
\%filters,\%curr_groups,$ltitoolsref,$canedit,$isencrypted,$navmapref); |
\%filters,\%curr_groups,$ltitoolsref,$canedit, |
|
$isencrypted,$navmapref); |
$idx++; |
$idx++; |
$shown++; |
$shown++; |
} |
} |
Line 3969 END
|
Line 3970 END
|
} |
} |
} |
} |
|
|
my ($editlink,$extresform,$anchor,$hiddenres); |
my ($editlink,$extresform,$anchor,$hiddenres,$nomodal); |
my $orig_url = $url; |
my $orig_url = $url; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
$url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
Line 3991 END
|
Line 3992 END
|
$url='/adm/wrapper'.$url; |
$url='/adm/wrapper'.$url; |
} elsif ($url=~m{^/adm/$coursedom/$coursenum/\d+/exttools?$}) { |
} elsif ($url=~m{^/adm/$coursedom/$coursenum/\d+/exttools?$}) { |
$url='/adm/wrapper'.$url; |
$url='/adm/wrapper'.$url; |
|
} elsif ($url eq "/public/$coursedom/$coursenum/syllabus") { |
|
if (($ENV{'SERVER_PORT'} == 443) && |
|
($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { |
|
$url .= '?usehttp=1'; |
|
$nomodal = 1; |
|
} |
} |
} |
if (&Apache::lonnet::symbverify($symb,$url)) { |
if (&Apache::lonnet::symbverify($symb,$url)) { |
my $shownsymb = $symb; |
my $shownsymb = $symb; |
Line 4020 END
|
Line 4027 END
|
if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) || |
if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) || |
$isencrypted || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) { |
$isencrypted || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) { |
$checkencrypt = 1; |
$checkencrypt = 1; |
} else { |
} elsif (ref($navmapref)) { |
unless (ref($$navmapref)) { |
unless (ref($$navmapref)) { |
$$navmapref = Apache::lonnavmaps::navmap->new(); |
$$navmapref = Apache::lonnavmaps::navmap->new(); |
} |
} |
Line 4048 END
|
Line 4055 END
|
$url=''; |
$url=''; |
} |
} |
} |
} |
} elsif ($supplementalflag) { |
} elsif ($supplementalflag) { |
if ($isexternal) { |
if ($isexternal) { |
if ($url =~ /^([^#]+)#([^#]+)$/) { |
if ($url =~ /^([^#]+)#([^#]+)$/) { |
$url = $1; |
$url = $1; |
$anchor = $2; |
$anchor = $2; |
} |
} |
|
} elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) { |
|
if (($ENV{'SERVER_PORT'} == 443) && |
|
($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { |
|
$url .= (($url =~ /\?/) ? '&':'?').'usehttp=1'; |
|
$nomodal = 1; |
|
} |
} |
} |
} |
} |
my ($rand_pick_text,$rand_order_text,$hiddenfolder); |
my ($rand_pick_text,$rand_order_text,$hiddenfolder); |
Line 4075 END
|
Line 4088 END
|
my $encryptmap = ((&LONCAPA::map::getparameter($orderidx, |
my $encryptmap = ((&LONCAPA::map::getparameter($orderidx, |
'parameter_encrypturl'))[0]=~/^yes$/i); |
'parameter_encrypturl'))[0]=~/^yes$/i); |
unless ($hiddenmap) { |
unless ($hiddenmap) { |
unless (ref($$navmapref)) { |
if (ref($navmapref)) { |
$$navmapref = Apache::lonnavmaps::navmap->new(); |
unless (ref($$navmapref)) { |
} |
$$navmapref = Apache::lonnavmaps::navmap->new(); |
if (ref($$navmapref)) { |
} |
if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.hiddenresource")) eq 'yes') { |
if (ref($$navmapref)) { |
my @resources = $$navmapref->retrieveResources($folderurl,$filterFunc,1,1); |
if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.hiddenresource")) eq 'yes') { |
unless (@resources) { |
my @resources = $$navmapref->retrieveResources($folderurl,$filterFunc,1,1); |
$hiddenmap = 1; |
unless (@resources) { |
unless ($env{'request.role.adv'}) { |
$hiddenmap = 1; |
$url = ''; |
unless ($env{'request.role.adv'}) { |
$hiddenfolder = 1; |
$url = ''; |
|
$hiddenfolder = 1; |
|
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
unless ($encryptmap) { |
unless ($encryptmap) { |
if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.encrypturl")) eq 'yes') { |
if ((ref($navmapref)) && (ref($$navmapref))) { |
$encryptmap = 1; |
if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.encrypturl")) eq 'yes') { |
|
$encryptmap = 1; |
|
} |
} |
} |
} |
} |
|
|
Line 4200 $form_end;
|
Line 4217 $form_end;
|
$reinit = &mt('(re-initialize course to access)'); |
$reinit = &mt('(re-initialize course to access)'); |
} |
} |
$line.='<td class="LC_docs_entry_commands"'.$tdalign.'><span class="LC_nobreak">'.$editlink.$renamelink; |
$line.='<td class="LC_docs_entry_commands"'.$tdalign.'><span class="LC_nobreak">'.$editlink.$renamelink; |
|
my $link; |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
$line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
$line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
} elsif ($url) { |
} elsif ($url) { |
Line 4210 $form_end;
|
Line 4228 $form_end;
|
$anchor = '#'.&HTML::Entities::encode($anchor,'"<>&'); |
$anchor = '#'.&HTML::Entities::encode($anchor,'"<>&'); |
} |
} |
} |
} |
$line.=&Apache::loncommon::modal_link(&js_escape($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. |
$link = &js_escape($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. |
(($anchor ne '')?$anchor:'')), |
(($anchor ne '')?$anchor:'')); |
'<img src="'.$icon.'" alt="" class="LC_icon" />',600,500); |
if ($nomodal) { |
|
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
|
'<img src="'.$icon.'" alt="" class="LC_icon" border="0" /></a>'; |
|
} else { |
|
$line.=&Apache::loncommon::modal_link($link, |
|
'<img src="'.$icon.'" alt="" class="LC_icon" />',600,500); |
|
} |
} else { |
} else { |
$line.='<img src="'.$icon.'" alt="" class="LC_icon" />'; |
$line.='<img src="'.$icon.'" alt="" class="LC_icon" />'; |
} |
} |
Line 4220 $form_end;
|
Line 4244 $form_end;
|
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
$line.='<a href="'.$url.'">'.$title.'</a>'; |
$line.='<a href="'.$url.'">'.$title.'</a>'; |
} elsif ($url) { |
} elsif ($url) { |
$line.=&Apache::loncommon::modal_link(&js_escape($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. |
if ($nomodal) { |
(($anchor ne '')?$anchor:'')), |
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
$title,600,500); |
$title.'</a>'; |
|
} else { |
|
$line.=&Apache::loncommon::modal_link($link,$title,600,500); |
|
} |
} elsif (($hiddenfolder) || ($hiddenres)) { |
} elsif (($hiddenfolder) || ($hiddenres)) { |
$line.=$title.' <span class="LC_warning LC_docs_reinit_warn">'.&mt('(Hidden)').'</span>'; |
$line.=$title.' <span class="LC_warning LC_docs_reinit_warn">'.&mt('(Hidden)').'</span>'; |
} else { |
} else { |
Line 5557 sub handler {
|
Line 5584 sub handler {
|
if ($disk_quota == 0) { |
if ($disk_quota == 0) { |
$percent = 100.0; |
$percent = 100.0; |
} else { |
} else { |
$percent = 100*($current_disk_usage/$disk_quota); |
$percent = 100*($usage/$disk_quota); |
} |
} |
$usage = sprintf("%.2f",$usage); |
$usage = sprintf("%.2f",$usage); |
$quota = sprintf("%.2f",$quota); |
$quota = sprintf("%.2f",$quota); |