version 1.484.2.50, 2014/02/24 17:10:37
|
version 1.484.2.75, 2017/11/10 15:52:26
|
Line 46 use Apache::lonsimplepage();
|
Line 46 use Apache::lonsimplepage();
|
use HTML::Entities; |
use HTML::Entities; |
use HTML::TokeParser; |
use HTML::TokeParser; |
use GDBM_File; |
use GDBM_File; |
|
use File::MMagic; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Cwd; |
use Cwd; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
Line 138 sub clean {
|
Line 139 sub clean {
|
return $title; |
return $title; |
} |
} |
|
|
|
sub default_folderpath { |
|
my ($coursenum,$coursedom,$navmapref) = @_; |
|
return unless ($coursenum && $coursedom && ref($navmapref)); |
|
# Check if entire course is hidden and/or encrypted |
|
my ($hiddenmap,$encryptmap,$folderpath,$hiddentop); |
|
my $toplevel = "uploaded/$coursedom/$coursenum/default.sequence"; |
|
unless (ref($$navmapref)) { |
|
$$navmapref = Apache::lonnavmaps::navmap->new(); |
|
} |
|
if (ref($$navmapref)) { |
|
if (lc($$navmapref->get_mapparam(undef,$toplevel,"0.hiddenresource")) eq 'yes') { |
|
my $filterFunc = sub { my $res = shift; return (!$res->randomout() && !$res->is_map()) }; |
|
my @resources = $$navmapref->retrieveResources($toplevel,$filterFunc,1,1); |
|
unless (@resources) { |
|
$hiddenmap = 1; |
|
unless ($env{'request.role.adv'}) { |
|
$hiddentop = 1; |
|
if ($env{'form.folder'}) { |
|
undef($env{'form.folder'}); |
|
} |
|
} |
|
} |
|
} |
|
if (lc($$navmapref->get_mapparam(undef,$toplevel,"0.encrypturl")) eq 'yes') { |
|
$encryptmap = 1; |
|
} |
|
} |
|
unless ($hiddentop) { |
|
$folderpath='default&'.&escape(&mt('Main Content')). |
|
'::'.$hiddenmap.':'.$encryptmap.'::'; |
|
} |
|
if (wantarray) { |
|
return ($folderpath,$hiddentop); |
|
} else { |
|
return $folderpath; |
|
} |
|
} |
|
|
sub dumpcourse { |
sub dumpcourse { |
my ($r) = @_; |
my ($r) = @_; |
Line 651 sub group_import {
|
Line 688 sub group_import {
|
} else { |
} else { |
$fname =~ s/\W/_/g; |
$fname =~ s/\W/_/g; |
} |
} |
if (length($fname > 15)) { |
if (length($fname) > 15) { |
$fname = substr($fname,0,14); |
$fname = substr($fname,0,14); |
} |
} |
my $initialtext = &mt('Replace with your own content.'); |
my $initialtext = &mt('Replace with your own content.'); |
Line 790 sub log_docs {
|
Line 827 sub log_docs {
|
} |
} |
|
|
sub docs_change_log { |
sub docs_change_log { |
my ($r,$coursenum,$coursedom,$folder,$allowed,$crstype,$iconpath)=@_; |
my ($r,$coursenum,$coursedom,$folder,$allowed,$crstype,$iconpath,$canedit)=@_; |
my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/); |
my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/); |
|
my $navmap; |
my $js = '<script type="text/javascript">'."\n". |
my $js = '<script type="text/javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
&Apache::loncommon::display_filter_js('docslog')."\n". |
&Apache::loncommon::display_filter_js('docslog')."\n". |
&editing_js($env{'user.domain'},$env{'user.name'},$supplementalflag)."\n". |
&editing_js($env{'user.domain'},$env{'user.name'},$supplementalflag, |
|
$coursedom,$coursenum,$canedit,\$navmap)."\n". |
&history_tab_js()."\n". |
&history_tab_js()."\n". |
&Apache::lonratedt::editscript('simple')."\n". |
&Apache::lonratedt::editscript('simple')."\n". |
'// ]]>'."\n". |
'// ]]>'."\n". |
Line 811 sub docs_change_log {
|
Line 850 sub docs_change_log {
|
} |
} |
my $folderpath=$env{'form.folderpath'}; |
my $folderpath=$env{'form.folderpath'}; |
if ($folderpath eq '') { |
if ($folderpath eq '') { |
$folderpath = 'default&'.&escape(&mt('Main Content').':::::'); |
$folderpath = &default_folderpath($coursenum,$coursedom,\$navmap); |
} |
} |
|
undef($navmap); |
$pathitem = '<input type="hidden" name="folderpath" value="'. |
$pathitem = '<input type="hidden" name="folderpath" value="'. |
&HTML::Entities::encode($folderpath,'<>&"').'" />'; |
&HTML::Entities::encode($folderpath,'<>&"').'" />'; |
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; |
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; |
Line 976 sub docs_change_log {
|
Line 1016 sub docs_change_log {
|
|
|
sub update_paste_buffer { |
sub update_paste_buffer { |
my ($coursenum,$coursedom,$folder) = @_; |
my ($coursenum,$coursedom,$folder) = @_; |
my (@possibles,%removals,%cuts); |
my (@possibles,%removals,%cuts,$output); |
if ($env{'form.multiremove'}) { |
if ($env{'form.multiremove'}) { |
$env{'form.multiremove'} =~ s/,$//; |
$env{'form.multiremove'} =~ s/,$//; |
map { $removals{$_} = 1; } split(/,/,$env{'form.multiremove'}); |
map { $removals{$_} = 1; } split(/,/,$env{'form.multiremove'}); |
Line 1044 sub update_paste_buffer {
|
Line 1084 sub update_paste_buffer {
|
next if (exists($pasteurls{$coursedom.'_'.$coursenum.'_'.$url})); |
next if (exists($pasteurls{$coursedom.'_'.$coursenum.'_'.$url})); |
my ($suffix,$errortxt,$locknotfreed) = |
my ($suffix,$errortxt,$locknotfreed) = |
&new_timebased_suffix($env{'user.domain'},$env{'user.name'},'paste'); |
&new_timebased_suffix($env{'user.domain'},$env{'user.name'},'paste'); |
push(@newpaste,$suffix); |
if ($suffix ne '') { |
if ($locknotfreed) { |
push(@newpaste,$suffix); |
return $locknotfreed; |
} else { |
last; |
if ($locknotfreed) { |
|
return $locknotfreed; |
|
} |
} |
} |
if (&is_supplemental_title($title)) { |
if (&is_supplemental_title($title)) { |
&Apache::lonnet::appenv({'docs.markedcopy_supplemental_'.$suffix => $title}); |
&Apache::lonnet::appenv({'docs.markedcopy_supplemental_'.$suffix => $title}); |
Line 1081 sub update_paste_buffer {
|
Line 1123 sub update_paste_buffer {
|
} |
} |
} |
} |
} |
} |
|
if ($locknotfreed) { |
|
$output = $locknotfreed; |
|
last; |
|
} |
} |
} |
if (@newpaste) { |
if (@newpaste) { |
$addtoenv{'docs.markedcopies'} = join(',',(@currpaste,@newpaste)); |
$addtoenv{'docs.markedcopies'} = join(',',(@currpaste,@newpaste)); |
} |
} |
&Apache::lonnet::appenv(\%addtoenv); |
&Apache::lonnet::appenv(\%addtoenv); |
delete($env{'form.markcopy'}); |
delete($env{'form.markcopy'}); |
return; |
return $output; |
} |
} |
|
|
sub recurse_uploaded_maps { |
sub recurse_uploaded_maps { |
Line 1190 sub print_paste_buffer {
|
Line 1236 sub print_paste_buffer {
|
$icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); |
$icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL')); |
$icon .= '/navmap.folder.closed.gif'; |
$icon .= '/navmap.folder.closed.gif'; |
} |
} |
|
my $title = $env{'docs.markedcopy_title_'.$suffix}; |
|
if ($title eq '') { |
|
($title) = ($url =~ m{/([^/]+)$}); |
|
} |
$buffer = '<img src="'.$icon.'" alt="" class="LC_icon" />'. |
$buffer = '<img src="'.$icon.'" alt="" class="LC_icon" />'. |
': '. |
': '. |
&Apache::loncommon::parse_supplemental_title( |
&Apache::loncommon::parse_supplemental_title( |
&LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix})); |
&LONCAPA::map::qtescape($title)); |
} |
} |
$pasteitems .= '<div class="LC_left_float">'; |
$pasteitems .= '<div class="LC_left_float">'; |
my ($options,$onclick); |
my ($options,$onclick); |
Line 1342 sub supp_pasteable {
|
Line 1392 sub supp_pasteable {
|
} |
} |
|
|
sub paste_popup_js { |
sub paste_popup_js { |
my %lt = &Apache::lonlocal::texthash( |
my %html_js_lt = &Apache::lonlocal::texthash( |
show => 'Show Options', |
show => 'Show Options', |
hide => 'Hide Options', |
hide => 'Hide Options', |
|
); |
|
my %js_lt = &Apache::lonlocal::texthash( |
none => 'No items selected from clipboard.', |
none => 'No items selected from clipboard.', |
); |
); |
|
&html_escape(\%html_js_lt); |
|
&js_escape(\%html_js_lt); |
|
&js_escape(\%js_lt); |
return <<"END"; |
return <<"END"; |
|
|
function showPasteOptions(suffix) { |
function showPasteOptions(suffix) { |
document.getElementById('pasteoptions_'+suffix).style.display='block'; |
document.getElementById('pasteoptions_'+suffix).style.display='block'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML = ' <a href="javascript:hidePasteOptions(\\''+suffix+'\\');" class="LC_menubuttons_link">$lt{'hide'}</a>'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML = ' <a href="javascript:hidePasteOptions(\\''+suffix+'\\');" class="LC_menubuttons_link">$html_js_lt{'hide'}</a>'; |
return; |
return; |
} |
} |
|
|
function hidePasteOptions(suffix) { |
function hidePasteOptions(suffix) { |
document.getElementById('pasteoptions_'+suffix).style.display='none'; |
document.getElementById('pasteoptions_'+suffix).style.display='none'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =' <a href="javascript:showPasteOptions(\\''+suffix+'\\')" class="LC_menubuttons_link">$lt{'show'}</a>'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =' <a href="javascript:showPasteOptions(\\''+suffix+'\\')" class="LC_menubuttons_link">$html_js_lt{'show'}</a>'; |
return; |
return; |
} |
} |
|
|
function showOptions(caller,suffix) { |
function showOptions(caller,suffix) { |
if (document.getElementById('pasteoptionstext_'+suffix)) { |
if (document.getElementById('pasteoptionstext_'+suffix)) { |
if (caller.checked) { |
if (caller.checked) { |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =' <a href="javascript:showPasteOptions(\\''+suffix+'\\')" class="LC_menubuttons_link">$lt{'show'}</a>'; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =' <a href="javascript:showPasteOptions(\\''+suffix+'\\')" class="LC_menubuttons_link">$html_js_lt{'show'}</a>'; |
} else { |
} else { |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =''; |
document.getElementById('pasteoptionstext_'+suffix).innerHTML =''; |
} |
} |
Line 1393 function validateClipboard() {
|
Line 1448 function validateClipboard() {
|
if (numchk > 0) { |
if (numchk > 0) { |
return true; |
return true; |
} else { |
} else { |
alert("$lt{'none'}"); |
alert("$js_lt{'none'}"); |
return false; |
return false; |
} |
} |
} |
} |
Line 1904 sub get_newmap_url {
|
Line 1959 sub get_newmap_url {
|
sub dbcopy { |
sub dbcopy { |
my ($dbref,$coursedom,$coursenum,$lockerrorsref) = @_; |
my ($dbref,$coursedom,$coursenum,$lockerrorsref) = @_; |
my ($url,$result,$errtext); |
my ($url,$result,$errtext); |
$url = $dbref->{'src'}; |
|
if (ref($dbref) eq 'HASH') { |
if (ref($dbref) eq 'HASH') { |
|
$url = $dbref->{'src'}; |
if ($url =~ m{/(smppg|bulletinboard)$}) { |
if ($url =~ m{/(smppg|bulletinboard)$}) { |
my $prefix = $1; |
my $prefix = $1; |
if (($dbref->{'cdom'} =~ /^$match_domain$/) && |
if (($dbref->{'cdom'} =~ /^$match_domain$/) && |
Line 2602 sub update_parameter {
|
Line 2657 sub update_parameter {
|
} |
} |
return $haschanges; |
return $haschanges; |
} else { |
} else { |
return 0 if ($env{'form.changeparms'} !~ /^($valid_parameters_re)$/); |
my $haschanges = 0; |
|
return $haschanges if ($env{'form.changeparms'} !~ /^($valid_parameters_re)$/); |
|
|
my $which = $env{'form.changeparms'}; |
my $which = $env{'form.changeparms'}; |
my $idx = $env{'form.setparms'}; |
my $idx = $env{'form.setparms'}; |
|
my $oldvalue = 0; |
|
my $newvalue = 0; |
|
my $current = (&LONCAPA::map::getparameter($idx,'parameter_'.$which))[0]; |
|
if ($which eq 'randompick') { |
|
if ($current =~ /^(\d+)$/) { |
|
$oldvalue = $1; |
|
} |
|
} elsif ($current =~ /^yes$/i) { |
|
$oldvalue = 1; |
|
} |
if ($env{'form.'.$which.'_'.$idx}) { |
if ($env{'form.'.$which.'_'.$idx}) { |
my $value = ($which eq 'randompick') ? $env{'form.rpicknum_'.$idx} |
$newvalue = ($which eq 'randompick') ? $env{'form.rpicknum_'.$idx} |
: 'yes'; |
: 1; |
&LONCAPA::map::storeparameter($idx, 'parameter_'.$which, $value, |
|
$parameter_type{$which}); |
|
&remember_parms($idx,$which,'set',$value); |
|
} else { |
|
&LONCAPA::map::delparameter($idx,'parameter_'.$which); |
|
|
|
&remember_parms($idx,$which,'del'); |
|
} |
} |
return 1; |
if ($oldvalue ne $newvalue) { |
|
$haschanges = 1; |
|
if ($newvalue) { |
|
my $storeval = 'yes'; |
|
if ($which eq 'randompick') { |
|
$storeval = $newvalue; |
|
} |
|
&LONCAPA::map::storeparameter($idx, 'parameter_'.$which, $storeval, |
|
$parameter_type{$which}); |
|
&remember_parms($idx,$which,'set',$storeval); |
|
} else { |
|
&LONCAPA::map::delparameter($idx,'parameter_'.$which); |
|
&remember_parms($idx,$which,'del'); |
|
} |
|
} |
|
return $haschanges; |
} |
} |
|
return; |
} |
} |
|
|
|
|
sub handle_edit_cmd { |
sub handle_edit_cmd { |
my ($coursenum,$coursedom) =@_; |
my ($coursenum,$coursedom) =@_; |
if ($env{'form.cmd'} eq '') { |
if ($env{'form.cmd'} eq '') { |
Line 2671 sub handle_edit_cmd {
|
Line 2745 sub handle_edit_cmd {
|
|
|
sub editor { |
sub editor { |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype, |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype, |
$supplementalflag,$orderhash,$iconpath,$pathitem)=@_; |
$supplementalflag,$orderhash,$iconpath,$pathitem,$canedit,$navmapref, |
|
$hiddentop)=@_; |
my ($randompick,$ishidden,$isencrypted,$plain,$is_random_order,$container); |
my ($randompick,$ishidden,$isencrypted,$plain,$is_random_order,$container); |
if ($allowed) { |
if ($allowed) { |
(my $breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain, |
(my $breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain, |
Line 2694 sub editor {
|
Line 2769 sub editor {
|
$randompick = -1; |
$randompick = -1; |
} |
} |
|
|
my ($errtext,$fatal) = &mapread($coursenum,$coursedom, |
my ($errtext,$fatal); |
$folder.'.'.$container); |
if (($folder eq '') && (!$supplementalflag)) { |
return $errtext if ($fatal); |
if (@LONCAPA::map::order) { |
|
undef(@LONCAPA::map::order); |
|
undef(@LONCAPA::map::resources); |
|
undef(@LONCAPA::map::resparms); |
|
undef(@LONCAPA::map::zombies); |
|
} |
|
$folder = 'default'; |
|
$container = 'sequence'; |
|
} else { |
|
($errtext,$fatal) = &mapread($coursenum,$coursedom, |
|
$folder.'.'.$container); |
|
return $errtext if ($fatal); |
|
} |
|
|
if ($#LONCAPA::map::order<1) { |
if ($#LONCAPA::map::order<1) { |
my $idx=&LONCAPA::map::getresidx(); |
my $idx=&LONCAPA::map::getresidx(); |
Line 2708 sub editor {
|
Line 2795 sub editor {
|
# ------------------------------------------------------------ Process commands |
# ------------------------------------------------------------ Process commands |
|
|
# ---------------- if they are for this folder and user allowed to make changes |
# ---------------- if they are for this folder and user allowed to make changes |
if (($allowed) && ($env{'form.folder'} eq $folder)) { |
if (($allowed && $canedit) && ($env{'form.folder'} eq $folder)) { |
# set parameters and change order |
# set parameters and change order |
&snapshotbefore(); |
&snapshotbefore(); |
|
|
if (&update_parameter()) { |
if (&update_parameter()) { |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container); |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container,1); |
return $errtext if ($fatal); |
return $errtext if ($fatal); |
} |
} |
|
|
Line 2775 sub editor {
|
Line 2862 sub editor {
|
$r->print($upload_output); |
$r->print($upload_output); |
|
|
# Rename, cut, copy or remove a single resource |
# Rename, cut, copy or remove a single resource |
if (&handle_edit_cmd()) { |
if (&handle_edit_cmd($coursenum,$coursedom)) { |
my $contentchg; |
my $contentchg; |
if ($env{'form.cmd'} =~ m{^(del|cut)_}) { |
if ($env{'form.cmd'} =~ m{^(remove|cut)_}) { |
$contentchg = 1; |
$contentchg = 1; |
} |
} |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container,$contentchg); |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container,$contentchg); |
Line 2809 sub editor {
|
Line 2896 sub editor {
|
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); |
my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]); |
$name=&LONCAPA::map::qtescape($name); |
$name=&LONCAPA::map::qtescape($name); |
$url=&LONCAPA::map::qtescape($url); |
$url=&LONCAPA::map::qtescape($url); |
next unless ($name && $url); |
next unless $url; |
my %denied = |
my %denied = |
&action_restrictions($coursenum,$coursedom,$url, |
&action_restrictions($coursenum,$coursedom,$url, |
$env{'form.folderpath'},\%curr_groups); |
$env{'form.folderpath'},\%curr_groups); |
Line 2974 sub editor {
|
Line 3061 sub editor {
|
if ($url =~ m{/uploaded/.+\.(page|sequence)$}) { |
if ($url =~ m{/uploaded/.+\.(page|sequence)$}) { |
push(@allmapidx,$res); |
push(@allmapidx,$res); |
} |
} |
|
|
$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); |
\%filters,\%curr_groups,$canedit, |
|
$isencrypted,$navmapref); |
$idx++; |
$idx++; |
$shown++; |
$shown++; |
} |
} |
&Apache::loncommon::end_data_table_count(); |
&Apache::loncommon::end_data_table_count(); |
|
|
my $need_save; |
my $need_save; |
if (($allowed) || ($supplementalflag && $folder eq 'supplemental')) { |
if ($allowed || ($supplementalflag && $folder eq 'supplemental')) { |
my $toolslink; |
my $toolslink; |
if ($allowed || &Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
if ($allowed) { |
$toolslink = '<table><tr><td>' |
$toolslink = '<table><tr><td>' |
.&Apache::loncommon::help_open_menu('Navigation Screen', |
.&Apache::loncommon::help_open_menu('Navigation Screen', |
'Navigation_Screen',undef,'RAT') |
'Navigation_Screen',undef,'RAT') |
Line 3033 sub editor {
|
Line 3122 sub editor {
|
&Apache::loncommon::continue_data_table_row(). |
&Apache::loncommon::continue_data_table_row(). |
'<td colspan="2"> </td>'. |
'<td colspan="2"> </td>'. |
'<td>'. |
'<td>'. |
&multiple_check_form('actions',\%lists). |
&multiple_check_form('actions',\%lists,$canedit). |
'</td>'. |
'</td>'. |
'<td> </td>'. |
'<td> </td>'. |
'<td> </td>'. |
'<td> </td>'. |
'<td colspan="4">'. |
'<td colspan="4">'. |
&multiple_check_form('settings',\%lists). |
&multiple_check_form('settings',\%lists,$canedit). |
'</td>'. |
'</td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
$need_save = 1; |
$need_save = 1; |
Line 3059 sub editor {
|
Line 3148 sub editor {
|
if (!$allowed) { |
if (!$allowed) { |
$to_show .= $toolslink; |
$to_show .= $toolslink; |
} |
} |
|
my $noresmsg; |
|
if ($allowed && $hiddentop && !$supplementalflag) { |
|
$noresmsg = &mt('Main Content Hidden'); |
|
} else { |
|
$noresmsg = &mt('Currently empty'); |
|
} |
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll') |
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll') |
.'<div class="LC_info" id="contentlist">' |
.'<div class="LC_info" id="contentlist">' |
.&mt('Currently empty') |
.$noresmsg |
.'</div>' |
.'</div>' |
.&Apache::loncommon::end_scrollbox(); |
.&Apache::loncommon::end_scrollbox(); |
} |
} |
Line 3085 sub editor {
|
Line 3180 sub editor {
|
if ($allowed) { |
if ($allowed) { |
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; |
my $readfile="/uploaded/$coursedom/$coursenum/$folder.$container"; |
$r->print(&generate_edit_table($tid,$orderhash,$to_show,$iconpath, |
$r->print(&generate_edit_table($tid,$orderhash,$to_show,$iconpath, |
$jumpto,$readfile,$need_save,"$folder.$container")); |
$jumpto,$readfile,$need_save,"$folder.$container",$canedit)); |
&print_paste_buffer($r,$container,$folder,$coursedom,$coursenum); |
if ($canedit) { |
|
&print_paste_buffer($r,$container,$folder,$coursedom,$coursenum); |
|
} |
} else { |
} else { |
$r->print($to_show); |
$r->print($to_show); |
} |
} |
Line 3094 sub editor {
|
Line 3191 sub editor {
|
} |
} |
|
|
sub multiple_check_form { |
sub multiple_check_form { |
my ($caller,$listsref) = @_; |
my ($caller,$listsref,$canedit) = @_; |
return unless (ref($listsref) eq 'HASH'); |
return unless (ref($listsref) eq 'HASH'); |
|
my $disabled; |
|
unless ($canedit) { |
|
$disabled = 'disabled="disabled"'; |
|
} |
my $output = |
my $output = |
'<form action="/adm/coursedocs" method="post" name="togglemult'.$caller.'">'. |
'<form action="/adm/coursedocs" method="post" name="togglemult'.$caller.'">'. |
'<span class="LC_nobreak" style="font-size:x-small;font-weight:bold;">'. |
'<span class="LC_nobreak" style="font-size:x-small;font-weight:bold;">'. |
Line 3108 sub multiple_check_form {
|
Line 3209 sub multiple_check_form {
|
'<table><tr>'. |
'<table><tr>'. |
'<td class="LC_docs_entry_parameter">'. |
'<td class="LC_docs_entry_parameter">'. |
'<span class="LC_nobreak"><label>'. |
'<span class="LC_nobreak"><label>'. |
'<input type="checkbox" name="hiddenresourceall" id="hiddenresourceall" onclick="propagateState(this.form,'."'hiddenresource'".')" />'.&mt('Hidden'). |
'<input type="checkbox" name="hiddenresourceall" id="hiddenresourceall" onclick="propagateState(this.form,'."'hiddenresource'".')"'.$disabled.' />'.&mt('Hidden'). |
'</label></span></td>'. |
'</label></span></td>'. |
'<td class="LC_docs_entry_parameter">'. |
'<td class="LC_docs_entry_parameter">'. |
'<span class="LC_nobreak"><label><input type="checkbox" name="randompickall" id="randompickall" onclick="updatePick(this.form,'."'all','check'".');propagateState(this.form,'."'randompick'".');propagateState(this.form,'."'rpicknum'".');" />'.&mt('Randomly Pick').'</label><span id="rpicktextall"></span><input type="hidden" name="rpicknumall" id="rpicknumall" value="" />'. |
'<span class="LC_nobreak"><label><input type="checkbox" name="randompickall" id="randompickall" onclick="updatePick(this.form,'."'all','check'".');propagateState(this.form,'."'randompick'".');propagateState(this.form,'."'rpicknum'".');"'.$disabled.' />'.&mt('Randomly Pick').'</label><span id="rpicktextall"></span><input type="hidden" name="rpicknumall" id="rpicknumall" value="" />'. |
'</span></td>'. |
'</span></td>'. |
'</tr>'."\n". |
'</tr>'."\n". |
'<tr>'. |
'<tr>'. |
'<td class="LC_docs_entry_parameter">'. |
'<td class="LC_docs_entry_parameter">'. |
'<span class="LC_nobreak"><label><input type="checkbox" name="encrypturlall" id="encrypturlall" onclick="propagateState(this.form,'."'encrypturl'".')" />'.&mt('URL hidden').'</label></span></td><td class="LC_docs_entry_parameter"><span class="LC_nobreak"><label><input type="checkbox" name="randomorderall" id="randomorderall" onclick="propagateState(this.form,'."'randomorder'".')" />'.&mt('Random Order'). |
'<span class="LC_nobreak"><label><input type="checkbox" name="encrypturlall" id="encrypturlall" onclick="propagateState(this.form,'."'encrypturl'".')"'.$disabled.' />'.&mt('URL hidden').'</label></span></td><td class="LC_docs_entry_parameter"><span class="LC_nobreak"><label><input type="checkbox" name="randomorderall" id="randomorderall" onclick="propagateState(this.form,'."'randomorder'".')"'.$disabled.' />'.&mt('Random Order'). |
'</label></span>'. |
'</label></span>'. |
'</td></tr></table>'."\n"; |
'</td></tr></table>'."\n"; |
} else { |
} else { |
Line 3124 sub multiple_check_form {
|
Line 3225 sub multiple_check_form {
|
'<table><tr>'. |
'<table><tr>'. |
'<td class="LC_docs_entry_parameter">'. |
'<td class="LC_docs_entry_parameter">'. |
'<span class="LC_nobreak LC_docs_remove">'. |
'<span class="LC_nobreak LC_docs_remove">'. |
'<label><input type="checkbox" name="removeall" id="removeall" onclick="propagateState(this.form,'."'remove'".')" />'.&mt('Remove'). |
'<label><input type="checkbox" name="removeall" id="removeall" onclick="propagateState(this.form,'."'remove'".')"'.$disabled.' />'.&mt('Remove'). |
'</label></span></td>'. |
'</label></span></td>'. |
'<td class="LC_docs_entry_parameter">'. |
'<td class="LC_docs_entry_parameter">'. |
'<span class="LC_nobreak LC_docs_cut">'. |
'<span class="LC_nobreak LC_docs_cut">'. |
'<label><input type="checkbox" name="cut" id="cutall" onclick="propagateState(this.form,'."'cut'".');" />'.&mt('Cut'). |
'<label><input type="checkbox" name="cut" id="cutall" onclick="propagateState(this.form,'."'cut'".');"'.$disabled.' />'.&mt('Cut'). |
'</label></span></td>'."\n". |
'</label></span></td>'."\n". |
'<td class="LC_docs_entry_parameter">'. |
'<td class="LC_docs_entry_parameter">'. |
'<span class="LC_nobreak LC_docs_copy">'. |
'<span class="LC_nobreak LC_docs_copy">'. |
'<label><input type="checkbox" name="copyall" id="copyall" onclick="propagateState(this.form,'."'copy'".')" />'.&mt('Copy'). |
'<label><input type="checkbox" name="copyall" id="copyall" onclick="propagateState(this.form,'."'copy'".')"'.$disabled.' />'.&mt('Copy'). |
'</label></span></td>'. |
'</label></span></td>'. |
'</tr></table>'."\n"; |
'</tr></table>'."\n"; |
} |
} |
Line 3174 sub process_file_upload {
|
Line 3275 sub process_file_upload {
|
my $quotatype = 'unofficial'; |
my $quotatype = 'unofficial'; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$quotatype = 'community'; |
$quotatype = 'community'; |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) { |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) { |
$quotatype = 'official'; |
$quotatype = 'official'; |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) { |
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) { |
$quotatype = 'textbook'; |
$quotatype = 'textbook'; |
Line 3182 sub process_file_upload {
|
Line 3283 sub process_file_upload {
|
if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) { |
if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) { |
$filesize = int($filesize/1000); #expressed in kb |
$filesize = int($filesize/1000); #expressed in kb |
$$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course', |
$$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course', |
$env{'form.uploaddoc.filename'},$filesize,'upload'); |
$env{'form.uploaddoc.filename'},$filesize, |
|
'upload',$quotatype); |
return if ($$upload_output); |
return if ($$upload_output); |
} |
} |
my ($parseaction,$showupload,$nextphase,$mimetype); |
my ($parseaction,$showupload,$nextphase,$mimetype); |
Line 3280 sub process_file_upload {
|
Line 3382 sub process_file_upload {
|
$$upload_output .= &mt('No embedded items identified').'<br />'; |
$$upload_output .= &mt('No embedded items identified').'<br />'; |
} |
} |
$$upload_output = '<div id="uploadfileresult">'.$$upload_output.'</div>'; |
$$upload_output = '<div id="uploadfileresult">'.$$upload_output.'</div>'; |
} elsif (&Apache::loncommon::is_archive_file($mimetype)) { |
} elsif ((&Apache::loncommon::is_archive_file($mimetype)) && |
|
($env{'form.uploaddoc.filename'} =~ /\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/i)) { |
$nextphase = 'decompress_uploaded'; |
$nextphase = 'decompress_uploaded'; |
my $position = scalar(@LONCAPA::map::order)-1; |
my $position = scalar(@LONCAPA::map::order)-1; |
my $noextract = &return_to_editor(); |
my $noextract = &return_to_editor(); |
Line 3341 sub is_supplemental_title {
|
Line 3444 sub is_supplemental_title {
|
|
|
sub entryline { |
sub entryline { |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups)=@_; |
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups, |
my ($foldertitle,$renametitle); |
$canedit,$isencrypted,$navmapref)=@_; |
|
my ($foldertitle,$renametitle,$oldtitle); |
if (&is_supplemental_title($title)) { |
if (&is_supplemental_title($title)) { |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
} else { |
} else { |
Line 3351 sub entryline {
|
Line 3455 sub entryline {
|
$foldertitle=$title; |
$foldertitle=$title; |
} |
} |
|
|
|
my ($disabled,$readonly,$js_lt); |
|
unless ($canedit) { |
|
$disabled = 'disabled="disabled"'; |
|
$readonly = 1; |
|
} |
|
|
my $orderidx=$LONCAPA::map::order[$index]; |
my $orderidx=$LONCAPA::map::order[$index]; |
|
|
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/\'\;/\\\'/g; |
$renametitle=~s/"/%22/g; |
$renametitle=~s/ /%20/g; |
$renametitle=~s/ /%20/g; |
|
$oldtitle = $renametitle; |
|
$renametitle=~s/\'\;/\\\'/g; |
my $line=&Apache::loncommon::start_data_table_row(); |
my $line=&Apache::loncommon::start_data_table_row(); |
my ($form_start,$form_end,$form_common,$form_param); |
my ($form_start,$form_end,$form_common,$form_param); |
# Edit commands |
# Edit commands |
Line 3412 END
|
Line 3524 END
|
ne '')) { |
ne '')) { |
$selectbox= |
$selectbox= |
'<input type="hidden" name="currentpos" value="'.$incindex.'" />'. |
'<input type="hidden" name="currentpos" value="'.$incindex.'" />'. |
'<select name="newpos" onchange="this.form.submit()">'; |
'<select name="newpos" onchange="this.form.submit()"'.$disabled.'>'; |
for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) { |
for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) { |
if ($i==$incindex) { |
if ($i==$incindex) { |
$selectbox.='<option value="" selected="selected">('.$i.')</option>'; |
$selectbox.='<option value="" selected="selected">('.$i.')</option>'; |
Line 3434 END
|
Line 3546 END
|
'pr' => 'Preview', |
'pr' => 'Preview', |
'sv' => 'Save', |
'sv' => 'Save', |
'ul' => 'URL', |
'ul' => 'URL', |
'ti' => 'Title', |
'ti' => 'Title', |
|
'er' => 'Editing rights unavailable for your current role.', |
); |
); |
my %denied = &action_restrictions($coursenum,$coursedom,$url, |
my %denied = &action_restrictions($coursenum,$coursedom,$url, |
$env{'form.folderpath'}, |
$env{'form.folderpath'}, |
$currgroups); |
$currgroups); |
my ($copylink,$cutlink,$removelink); |
my ($copylink,$cutlink,$removelink); |
my $skip_confirm = 0; |
my $skip_confirm = 0; |
|
my $confirm_removal = 0; |
if ( $folder =~ /^supplemental/ |
if ( $folder =~ /^supplemental/ |
|| ($url =~ m{( /smppg$ |
|| ($url =~ m{( /smppg$ |
|/syllabus$ |
|/syllabus$ |
Line 3451 END
|
Line 3565 END
|
|| $isexternal) { |
|| $isexternal) { |
$skip_confirm = 1; |
$skip_confirm = 1; |
} |
} |
|
if (($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) && |
|
($url!~/$LONCAPA::assess_page_seq_re/)) { |
|
$confirm_removal = 1; |
|
} |
|
|
if ($denied{'copy'}) { |
if ($denied{'copy'}) { |
$copylink=(<<ENDCOPY) |
$copylink=(<<ENDCOPY) |
Line 3462 ENDCOPY
|
Line 3580 ENDCOPY
|
$copylink=(<<ENDCOPY); |
$copylink=(<<ENDCOPY); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="checkbox" name="copy" id="copy_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','copy');" class="LC_hidden" /><a href="$js" class="LC_docs_copy">$lt{'cp'}</a> |
<input type="checkbox" name="copy" id="copy_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','copy');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_copy">$lt{'cp'}</a> |
$form_end |
$form_end |
ENDCOPY |
ENDCOPY |
if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) { |
Line 3480 ENDCUT
|
Line 3598 ENDCUT
|
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="hidden" name="skip_$orderidx" id="skip_cut_$orderidx" value="$skip_confirm" /> |
<input type="hidden" name="skip_$orderidx" id="skip_cut_$orderidx" value="$skip_confirm" /> |
<input type="checkbox" name="cut" id="cut_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','cut');" class="LC_hidden" /><a href="$js" class="LC_docs_cut">$lt{'ct'}</a> |
<input type="checkbox" name="cut" id="cut_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','cut');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_cut">$lt{'ct'}</a> |
$form_end |
$form_end |
ENDCUT |
ENDCUT |
if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) { |
Line 3493 ENDCUT
|
Line 3611 ENDCUT
|
ENDREM |
ENDREM |
} else { |
} else { |
my $formname = 'edit_remove_'.$orderidx; |
my $formname = 'edit_remove_'.$orderidx; |
my $js = "javascript:checkForSubmit(document.forms.renameform,'remove','actions','$orderidx','$esc_path','$index','$renametitle',$skip_confirm);"; |
my $js = "javascript:checkForSubmit(document.forms.renameform,'remove','actions','$orderidx','$esc_path','$index','$renametitle',$skip_confirm,'$container','$folder',$confirm_removal);"; |
$removelink=(<<ENDREM); |
$removelink=(<<ENDREM); |
<form name="$formname" method="post" action="/adm/coursedocs"> |
<form name="$formname" method="post" action="/adm/coursedocs"> |
$form_common |
$form_common |
<input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" /> |
<input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" /> |
<input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a> |
<input type="hidden" name="confirm_rem_$orderidx" id="confirm_removal_$orderidx" value="$confirm_removal" /> |
|
<input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a> |
$form_end |
$form_end |
ENDREM |
ENDREM |
if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) { |
Line 3506 ENDREM
|
Line 3625 ENDREM
|
} |
} |
} |
} |
$renamelink=(<<ENDREN); |
$renamelink=(<<ENDREN); |
<a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a> |
<a href='javascript:changename("$esc_path","$index","$oldtitle");' class="LC_docs_rename">$lt{'rn'}</a> |
ENDREN |
ENDREN |
|
my ($uplink,$downlink); |
|
if ($canedit) { |
|
$uplink = "/adm/coursedocs?cmd=up_$index&folderpath=$esc_path&symb=$symb"; |
|
$downlink = "/adm/coursedocs?cmd=down_$index&folderpath=$esc_path&symb=$symb"; |
|
} else { |
|
$uplink = "javascript:alert('".&js_escape($lt{'er'})."');"; |
|
$downlink = $uplink; |
|
} |
$line.=(<<END); |
$line.=(<<END); |
<td> |
<td> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
<a href='/adm/coursedocs?cmd=up_$index&folderpath=$esc_path&symb=$symb'> |
<a href="$uplink"> |
<img src="${iconpath}move_up.gif" alt="$lt{'up'}" class="LC_icon" /> |
<img src="${iconpath}move_up.gif" alt="$lt{'up'}" class="LC_icon" /> |
</a> |
</a> |
</div> |
</div> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
<a href='/adm/coursedocs?cmd=down_$index&folderpath=$esc_path&symb=$symb'> |
<a href="$downlink"> |
<img src="${iconpath}move_down.gif" alt="$lt{'dw'}" class="LC_icon" /> |
<img src="${iconpath}move_down.gif" alt="$lt{'dw'}" class="LC_icon" /> |
</a> |
</a> |
</div> |
</div> |
Line 3542 END
|
Line 3669 END
|
my $isfolder; |
my $isfolder; |
my $ispage; |
my $ispage; |
my $containerarg; |
my $containerarg; |
|
my $folderurl; |
if ($uploaded) { |
if ($uploaded) { |
if (($extension eq 'sequence') || ($extension eq 'page')) { |
if (($extension eq 'sequence') || ($extension eq 'page')) { |
$url=~/\Q$coursenum\E\/([\/\w]+)\.\Q$extension\E$/; |
$url=~/\Q$coursenum\E\/([\/\w]+)\.\Q$extension\E$/; |
Line 3553 END
|
Line 3681 END
|
$icon=$iconpath.'page.gif'; |
$icon=$iconpath.'page.gif'; |
$ispage=1; |
$ispage=1; |
} |
} |
|
$folderurl = &Apache::lonnet::declutter($url); |
if ($allowed) { |
if ($allowed) { |
$url='/adm/coursedocs?'; |
$url='/adm/coursedocs?'; |
} else { |
} else { |
Line 3563 END
|
Line 3692 END
|
} |
} |
} |
} |
|
|
my ($editlink,$extresform); |
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 3581 END
|
Line 3710 END
|
} elsif ($url!~/\.(sequence|page)$/) { |
} elsif ($url!~/\.(sequence|page)$/) { |
$url='/adm/coursedocs/showdoc'.$url; |
$url='/adm/coursedocs/showdoc'.$url; |
} |
} |
} elsif ($url=~m|^/ext/|) { |
} elsif ($url=~m{^(|/adm/wrapper)/ext/([^#]+)}) { |
$url='/adm/wrapper'.$url; |
my $wrapped = $1; |
|
my $exturl = $2; |
|
if ($wrapped eq '') { |
|
$url='/adm/wrapper'.$url; |
|
} |
|
if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) { |
|
$nomodal = 1; |
|
} |
|
} elsif ($url eq "/public/$coursedom/$coursenum/syllabus") { |
|
if (($ENV{'SERVER_PORT'} == 443) && |
|
($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { |
|
$nomodal = 1; |
|
} |
} |
} |
if (&Apache::lonnet::symbverify($symb,$url)) { |
if (&Apache::lonnet::symbverify($symb,$url)) { |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
my $shownsymb = $symb; |
|
if ($isexternal) { |
|
if ($url =~ /^([^#]+)#([^#]+)$/) { |
|
$url = $1; |
|
$anchor = $2; |
|
if ($symb =~ m{^([^#]+)\Q#$anchor\E$}) { |
|
$shownsymb = $1.&escape('#').$anchor; |
|
} |
|
} |
|
} |
|
unless ($env{'request.role.adv'}) { |
|
if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { |
|
$url = ''; |
|
} |
|
if (&Apache::lonnet::EXT('resource.0.hiddenresource',$symb) =~ /^yes$/i) { |
|
$url = ''; |
|
$hiddenres = 1; |
|
} |
|
} |
|
if ($url ne '') { |
|
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($shownsymb); |
|
} |
|
} elsif (!$env{'request.role.adv'}) { |
|
my $checkencrypt; |
|
if (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) || |
|
$isencrypted || (&Apache::lonnet::EXT('resource.0.encrypturl',$symb) =~ /^yes$/i)) { |
|
$checkencrypt = 1; |
|
} elsif (ref($navmapref)) { |
|
unless (ref($$navmapref)) { |
|
$$navmapref = Apache::lonnavmaps::navmap->new(); |
|
} |
|
if (ref($$navmapref)) { |
|
if (lc($$navmapref->get_mapparam($symb,undef,"0.encrypturl")) eq 'yes') { |
|
$checkencrypt = 1; |
|
} |
|
} |
|
} |
|
if ($checkencrypt) { |
|
my $shownsymb = &Apache::lonenc::encrypted($symb); |
|
my $shownurl = &Apache::lonenc::encrypted($url); |
|
if (&Apache::lonnet::symbverify($shownsymb,$shownurl)) { |
|
$url = $shownurl.(($shownurl=~/\?/)?'&':'?').'symb='.&HTML::Entities::encode($shownsymb,'"<>&'); |
|
if ($env{'request.enc'} ne '') { |
|
delete($env{'request.enc'}); |
|
} |
|
} else { |
|
$url=''; |
|
} |
|
} else { |
|
$url=''; |
|
} |
} else { |
} else { |
$url=''; |
$url=''; |
} |
} |
} |
} |
|
} elsif ($supplementalflag) { |
|
if ($isexternal) { |
|
if ($url =~ /^([^#]+)#([^#]+)$/) { |
|
$url = $1; |
|
$anchor = $2; |
|
if (($url =~ m{^(|/adm/wrapper)/ext/(?!https:)}) && ($ENV{'SERVER_PORT'} == 443)) { |
|
$nomodal = 1; |
|
} |
|
} |
|
} elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) { |
|
if (($ENV{'SERVER_PORT'} == 443) && |
|
($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { |
|
$nomodal = 1; |
|
} |
|
} |
} |
} |
my ($rand_pick_text,$rand_order_text); |
my ($rand_pick_text,$rand_order_text,$hiddenfolder); |
|
my $filterFunc = sub { my $res = shift; return (!$res->randomout() && !$res->is_map()) }; |
if ($isfolder || $ispage || $extension eq 'sequence' || $extension eq 'page') { |
if ($isfolder || $ispage || $extension eq 'sequence' || $extension eq 'page') { |
my $foldername=&escape($foldertitle); |
my $foldername=&escape($foldertitle); |
my $folderpath=$env{'form.folderpath'}; |
my $folderpath=$env{'form.folderpath'}; |
Line 3600 END
|
Line 3807 END
|
$folderpath.=$containerarg.'&'.$foldername; |
$folderpath.=$containerarg.'&'.$foldername; |
$url.='folderpath='.&escape($folderpath); |
$url.='folderpath='.&escape($folderpath); |
} else { |
} else { |
# Append randompick number, hidden, and encrypted with ":" to foldername, |
|
# so it gets transferred between levels |
|
$folderpath.=$containerarg.'&'.$foldername. |
|
':'.(&LONCAPA::map::getparameter($orderidx, |
|
'parameter_randompick'))[0] |
|
.':'.((&LONCAPA::map::getparameter($orderidx, |
|
'parameter_hiddenresource'))[0]=~/^yes$/i) |
|
.':'.((&LONCAPA::map::getparameter($orderidx, |
|
'parameter_encrypturl'))[0]=~/^yes$/i) |
|
.':'.((&LONCAPA::map::getparameter($orderidx, |
|
'parameter_randomorder'))[0]=~/^yes$/i) |
|
.':'.$ispage; |
|
$url.='folderpath='.&escape($folderpath); |
|
my $rpicknum = (&LONCAPA::map::getparameter($orderidx, |
my $rpicknum = (&LONCAPA::map::getparameter($orderidx, |
'parameter_randompick'))[0]; |
'parameter_randompick'))[0]; |
|
my $randorder = ((&LONCAPA::map::getparameter($orderidx, |
|
'parameter_randomorder'))[0]=~/^yes$/i); |
|
my $hiddenmap = ((&LONCAPA::map::getparameter($orderidx, |
|
'parameter_hiddenresource'))[0]=~/^yes$/i); |
|
my $encryptmap = ((&LONCAPA::map::getparameter($orderidx, |
|
'parameter_encrypturl'))[0]=~/^yes$/i); |
|
unless ($hiddenmap) { |
|
if (ref($navmapref)) { |
|
unless (ref($$navmapref)) { |
|
$$navmapref = Apache::lonnavmaps::navmap->new(); |
|
} |
|
if (ref($$navmapref)) { |
|
if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.hiddenresource")) eq 'yes') { |
|
my @resources = $$navmapref->retrieveResources($folderurl,$filterFunc,1,1); |
|
unless (@resources) { |
|
$hiddenmap = 1; |
|
unless ($env{'request.role.adv'}) { |
|
$url = ''; |
|
$hiddenfolder = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
unless ($encryptmap) { |
|
if ((ref($navmapref)) && (ref($$navmapref))) { |
|
if (lc($$navmapref->get_mapparam(undef,$folderurl,"0.encrypturl")) eq 'yes') { |
|
$encryptmap = 1; |
|
} |
|
} |
|
} |
|
|
|
# Append randompick number, hidden, and encrypted with ":" to foldername, |
|
# so it gets transferred between levels |
|
$folderpath.=$containerarg.'&'.$foldername. |
|
':'.$rpicknum.':'.$hiddenmap.':'.$encryptmap.':'.$randorder.':'.$ispage; |
|
unless ($url eq '') { |
|
$url.='folderpath='.&escape($folderpath); |
|
} |
my $rpckchk; |
my $rpckchk; |
if ($rpicknum) { |
if ($rpicknum) { |
$rpckchk = ' checked="checked"'; |
$rpckchk = ' checked="checked"'; |
Line 3627 END
|
Line 3861 END
|
'<form action="/adm/coursedocs" method="post" name="'.$formname.'">'."\n". |
'<form action="/adm/coursedocs" method="post" name="'.$formname.'">'."\n". |
$form_param."\n". |
$form_param."\n". |
$form_common."\n". |
$form_common."\n". |
'<span class="LC_nobreak"><label><input type="checkbox" name="randompick_'.$orderidx.'" id="randompick_'.$orderidx.'" onclick="'."updatePick(this.form,'$orderidx','check');".'"'.$rpckchk.' /> '.&mt('Randomly Pick').'</label><input type="hidden" name="rpicknum_'.$orderidx.'" id="rpicknum_'.$orderidx.'" value="'.$rpicknum.'" /><span id="randompicknum_'.$orderidx.'">'; |
'<span class="LC_nobreak"><label><input type="checkbox" name="randompick_'.$orderidx.'" id="randompick_'.$orderidx.'" onclick="'."updatePick(this.form,'$orderidx','check');".'"'.$rpckchk.$disabled.' /> '.&mt('Randomly Pick').'</label><input type="hidden" name="rpicknum_'.$orderidx.'" id="rpicknum_'.$orderidx.'" value="'.$rpicknum.'" /><span id="randompicknum_'.$orderidx.'">'; |
if ($rpicknum ne '') { |
if ($rpicknum ne '') { |
$rand_pick_text .= ': <a href="javascript:updatePick('."document.$formname,'$orderidx','link'".')">'.$rpicknum.'</a>'; |
$rand_pick_text .= ': <a href="javascript:updatePick('."document.$formname,'$orderidx','link'".')">'.$rpicknum.'</a>'; |
} |
} |
$rand_pick_text .= '</span></span>'. |
$rand_pick_text .= '</span></span>'. |
$form_end; |
$form_end; |
my $ro_set; |
my $ro_set; |
if ((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i) { |
if ($randorder) { |
$ro_set = 'checked="checked"'; |
$ro_set = 'checked="checked"'; |
if (($ishash) && (ref($filtersref->{'randomorder'}) eq 'ARRAY')) { |
if (($ishash) && (ref($filtersref->{'randomorder'}) eq 'ARRAY')) { |
push(@{$filtersref->{'randomorder'}},$orderidx); |
push(@{$filtersref->{'randomorder'}},$orderidx); |
Line 3645 $form_common."\n".
|
Line 3879 $form_common."\n".
|
'<form action="/adm/coursedocs" method="post" name="'.$formname.'">'."\n". |
'<form action="/adm/coursedocs" method="post" name="'.$formname.'">'."\n". |
$form_param."\n". |
$form_param."\n". |
$form_common."\n". |
$form_common."\n". |
'<span class="LC_nobreak"><label><input type="checkbox" name="randomorder_'.$orderidx.'" id="randomorder_'.$orderidx.'" onclick="checkForSubmit(this.form,'."'randomorder','settings'".');" '.$ro_set.' /> '.&mt('Random Order').' </label></span>'. |
'<span class="LC_nobreak"><label><input type="checkbox" name="randomorder_'.$orderidx.'" id="randomorder_'.$orderidx.'" onclick="checkForSubmit(this.form,'."'randomorder','settings'".');" '.$ro_set.$disabled.' /> '.&mt('Random Order').' </label></span>'. |
$form_end; |
$form_end; |
} |
} |
} elsif ($supplementalflag && !$allowed) { |
} elsif ($supplementalflag && !$allowed) { |
Line 3657 $form_end;
|
Line 3891 $form_end;
|
if ($isexternal && $orderidx) { |
if ($isexternal && $orderidx) { |
$url .= '&idx='.$orderidx; |
$url .= '&idx='.$orderidx; |
} |
} |
|
if ($anchor ne '') { |
|
$url .= '&anchor='.&HTML::Entities::encode($anchor,'"<>&'); |
|
} |
} |
} |
my ($tdalign,$tdwidth); |
my ($tdalign,$tdwidth); |
if ($allowed) { |
if ($allowed) { |
Line 3664 $form_end;
|
Line 3901 $form_end;
|
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); |
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); |
if ($isexternal) { |
if ($isexternal) { |
($editlink,$extresform) = |
($editlink,$extresform) = |
&Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem); |
&Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem, |
|
undef,undef,undef,$disabled); |
} elsif (!$isfolder && !$ispage) { |
} elsif (!$isfolder && !$ispage) { |
my ($cfile,$home,$switchserver,$forceedit,$forceview) = |
my ($cfile,$home,$switchserver,$forceedit,$forceview) = |
&Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url); |
&Apache::lonnet::can_edit_resource($fileloc,$coursenum,$coursedom,$orig_url); |
if (($cfile ne '') && ($symb ne '' || $supplementalflag)) { |
if (($cfile ne '') && ($symb ne '' || $supplementalflag)) { |
|
my $suppanchor; |
|
if ($supplementalflag) { |
|
$suppanchor = $anchor; |
|
} |
my $jscall = |
my $jscall = |
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home, |
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home, |
$switchserver, |
$switchserver, |
$forceedit, |
$forceedit, |
undef,$symb, |
undef,$symb, |
&escape($env{'form.folderpath'}), |
&escape($env{'form.folderpath'}), |
$renametitle,'','',1); |
$renametitle,'','',1,$suppanchor); |
if ($jscall) { |
if ($jscall) { |
$editlink = '<a class="LC_docs_ext_edit" href="javascript:'. |
$editlink = '<a class="LC_docs_ext_edit" href="javascript:'. |
$jscall.'" >'.&mt('Edit').'</a> '."\n"; |
$jscall.'" >'.&mt('Edit').'</a> '."\n"; |
Line 3692 $form_end;
|
Line 3934 $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.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes', |
if ($anchor ne '') { |
'<img src="'.$icon.'" alt="" class="LC_icon" />',600,500); |
if ($supplementalflag) { |
|
$anchor = '&anchor='.&HTML::Entities::encode($anchor,'"<>&'); |
|
} else { |
|
$anchor = '#'.&HTML::Entities::encode($anchor,'"<>&'); |
|
} |
|
} |
|
$link = &js_escape($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. |
|
(($anchor ne '')?$anchor:'')); |
|
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 3704 $form_end;
|
Line 3961 $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($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes', |
if ($nomodal) { |
$title,600,500); |
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
|
$title.'</a>'; |
|
} else { |
|
$line.=&Apache::loncommon::modal_link($link,$title,600,500); |
|
} |
|
} elsif (($hiddenfolder) || ($hiddenres)) { |
|
$line.=$title.' <span class="LC_warning LC_docs_reinit_warn">('.&mt('Hidden').')</span>'; |
} else { |
} else { |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
$line.=$title.' <span class="LC_docs_reinit_warn">'.$reinit.'</span>'; |
} |
} |
Line 3736 $form_end;
|
Line 3999 $form_end;
|
<form action="/adm/coursedocs" method="post" name="$formhidden"> |
<form action="/adm/coursedocs" method="post" name="$formhidden"> |
$form_param |
$form_param |
$form_common |
$form_common |
<label><input type="checkbox" name="hiddenresource_$orderidx" id="hiddenresource_$orderidx" onclick="checkForSubmit(this.form,'hiddenresource','settings');" $hidtext /> $lt{'hd'}</label> |
<label><input type="checkbox" name="hiddenresource_$orderidx" id="hiddenresource_$orderidx" onclick="checkForSubmit(this.form,'hiddenresource','settings');" $hidtext $disabled /> $lt{'hd'}</label> |
$form_end |
$form_end |
<br /> |
<br /> |
<form action="/adm/coursedocs" method="post" name="$formurlhidden"> |
<form action="/adm/coursedocs" method="post" name="$formurlhidden"> |
$form_param |
$form_param |
$form_common |
$form_common |
<label><input type="checkbox" name="encrypturl_$orderidx" id="encrypturl_$orderidx" onclick="checkForSubmit(this.form,'encrypturl','settings');" $enctext /> $lt{'ec'}</label> |
<label><input type="checkbox" name="encrypturl_$orderidx" id="encrypturl_$orderidx" onclick="checkForSubmit(this.form,'encrypturl','settings');" $enctext $disabled /> $lt{'ec'}</label> |
$form_end |
$form_end |
</td> |
</td> |
<td class="LC_docs_entry_parameter">$rand_pick_text<br /> |
<td class="LC_docs_entry_parameter">$rand_pick_text<br /> |
Line 3821 sub new_timebased_suffix {
|
Line 4084 sub new_timebased_suffix {
|
if ($type eq 'paste') { |
if ($type eq 'paste') { |
$prefix = $type; |
$prefix = $type; |
$namespace = 'courseeditor'; |
$namespace = 'courseeditor'; |
|
$idtype = 'addcode'; |
} elsif ($type eq 'map') { |
} elsif ($type eq 'map') { |
$prefix = 'docs'; |
$prefix = 'docs'; |
if ($area eq 'supplemental') { |
if ($area eq 'supplemental') { |
Line 3832 sub new_timebased_suffix {
|
Line 4096 sub new_timebased_suffix {
|
$prefix = $type; |
$prefix = $type; |
$namespace = 'templated'; |
$namespace = 'templated'; |
} |
} |
$idtype = 'concat'; |
|
my ($suffix,$freedlock,$error) = |
my ($suffix,$freedlock,$error) = |
&Apache::lonnet::get_timebased_id($prefix,'num',$namespace,$dom,$num); |
&Apache::lonnet::get_timebased_id($prefix,'num',$namespace,$dom,$num,$idtype); |
if (!$suffix) { |
if (!$suffix) { |
if ($type eq 'paste') { |
if ($type eq 'paste') { |
$errtext = &mt('Failed to acquire a unique timestamp-based suffix when adding to the paste buffer.'); |
$errtext = &mt('Failed to acquire a unique timestamp-based suffix when adding to the paste buffer.'); |
Line 3854 sub new_timebased_suffix {
|
Line 4117 sub new_timebased_suffix {
|
'<div class="LC_error">'. |
'<div class="LC_error">'. |
&mt('There was a problem removing a lockfile.').' '; |
&mt('There was a problem removing a lockfile.').' '; |
if ($type eq 'paste') { |
if ($type eq 'paste') { |
&mt('This will prevent use of the paste buffer until th next log-in.'); |
if ($freedlock eq 'nolock') { |
|
$locknotfreed = |
|
'<div class="LC_error">'. |
|
&mt('A lockfile was not released when you added content to the clipboard earlier in this session.').' '. |
|
|
|
&mt('As a result addition of items to the clipboard will be unavailable until your next log-in.'); |
|
} else { |
|
$locknotfreed .= |
|
&mt('This will prevent addition of items to the clipboard until your next log-in.'); |
|
} |
} elsif ($type eq 'map') { |
} elsif ($type eq 'map') { |
&mt('This will prevent creation of additional folders or composite pages in this course.'); |
$locknotfreed .= |
|
&mt('This will prevent creation of additional folders or composite pages in this course.'); |
} elsif ($type eq 'smppg') { |
} elsif ($type eq 'smppg') { |
$locknotfreed .= |
$locknotfreed .= |
&mt('This will prevent creation of additional simple pages in this course.'); |
&mt('This will prevent creation of additional simple pages in this course.'); |
Line 4067 sub devalidateversioncache {
|
Line 4340 sub devalidateversioncache {
|
} |
} |
|
|
sub checkversions { |
sub checkversions { |
my ($r) = @_; |
my ($r,$canedit) = @_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
$r->print(&Apache::loncommon::start_page("Check $crstype Resource Versions")); |
$r->print(&Apache::loncommon::start_page("Check $crstype Resource Versions")); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $crstype Resource Versions")); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $crstype Resource Versions")); |
Line 4088 sub checkversions {
|
Line 4361 sub checkversions {
|
|
|
$hashtied=0; |
$hashtied=0; |
&tiehash(); |
&tiehash(); |
my %newsetversions=(); |
if ($canedit) { |
if ($env{'form.setmostrecent'}) { |
my %newsetversions=(); |
$haschanged=1; |
if ($env{'form.setmostrecent'}) { |
foreach my $key (keys(%hash)) { |
$haschanged=1; |
if ($key=~/^ids\_(\/res\/.+)$/) { |
foreach my $key (keys(%hash)) { |
$newsetversions{$1}='mostrecent'; |
if ($key=~/^ids\_(\/res\/.+)$/) { |
&devalidateversioncache($1); |
$newsetversions{$1}='mostrecent'; |
|
&devalidateversioncache($1); |
|
} |
} |
} |
} |
} elsif ($env{'form.setcurrent'}) { |
} elsif ($env{'form.setcurrent'}) { |
$haschanged=1; |
$haschanged=1; |
foreach my $key (keys(%hash)) { |
foreach my $key (keys(%hash)) { |
if ($key=~/^ids\_(\/res\/.+)$/) { |
if ($key=~/^ids\_(\/res\/.+)$/) { |
my $getvers=&Apache::lonnet::getversion($1); |
my $getvers=&Apache::lonnet::getversion($1); |
if ($getvers>0) { |
if ($getvers>0) { |
$newsetversions{$1}=$getvers; |
$newsetversions{$1}=$getvers; |
&devalidateversioncache($1); |
&devalidateversioncache($1); |
} |
} |
} |
} |
} |
} |
} elsif ($env{'form.setversions'}) { |
} elsif ($env{'form.setversions'}) { |
$haschanged=1; |
$haschanged=1; |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
if ($key=~/^form\.set_version_(.+)$/) { |
if ($key=~/^form\.set_version_(.+)$/) { |
my $src=$1; |
my $src=$1; |
if (($env{$key}) && ($env{$key} ne $setversions{$src})) { |
if (($env{$key}) && ($env{$key} ne $setversions{$src})) { |
$newsetversions{$src}=$env{$key}; |
$newsetversions{$src}=$env{$key}; |
&devalidateversioncache($src); |
&devalidateversioncache($src); |
} |
} |
} |
} |
} |
} |
} |
} |
if ($haschanged) { |
if ($haschanged) { |
if (&Apache::lonnet::put('resourceversions',\%newsetversions, |
if (&Apache::lonnet::put('resourceversions',\%newsetversions, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') { |
$env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') { |
$r->print(&Apache::loncommon::confirmwrapper( |
$r->print(&Apache::loncommon::confirmwrapper( |
&Apache::lonhtmlcommon::confirm_success(&mt('Your Version Settings have been Saved')))); |
&Apache::lonhtmlcommon::confirm_success(&mt('Your Version Settings have been Saved')))); |
} else { |
} else { |
$r->print(&Apache::loncommon::confirmwrapper( |
$r->print(&Apache::loncommon::confirmwrapper( |
&Apache::lonhtmlcommon::confirm_success(&mt('An Error Occured while Attempting to Save your Version Settings'),1))); |
&Apache::lonhtmlcommon::confirm_success(&mt('An Error Occured while Attempting to Save your Version Settings'),1))); |
} |
} |
&mark_hash_old(); |
&mark_hash_old(); |
} |
|
&changewarning($r,''); |
} |
} |
&changewarning($r,''); |
|
if ($env{'form.timerange'} eq 'all') { |
if ($env{'form.timerange'} eq 'all') { |
# show all documents |
# show all documents |
$header=&mt('All content in '.$crstype); |
$header=&mt('All content in '.$crstype); |
Line 4199 sub checkversions {
|
Line 4474 sub checkversions {
|
'save' => 'Save changes', |
'save' => 'Save changes', |
'vers' => 'Version choice(s) for specific resources', |
'vers' => 'Version choice(s) for specific resources', |
'act' => 'Actions'); |
'act' => 'Actions'); |
|
my ($disabled,$readonly); |
|
unless ($canedit) { |
|
$disabled = 'disabled="disabled"'; |
|
$readonly = 1; |
|
} |
$r->print(<<ENDHEADERS); |
$r->print(<<ENDHEADERS); |
<h4 class="LC_info">$header</h4> |
<h4 class="LC_info">$header</h4> |
<form action="/adm/coursedocs" method="post"> |
<form action="/adm/coursedocs" method="post"> |
Line 4219 sub checkversions {
|
Line 4499 sub checkversions {
|
<div class="LC_left_float"> |
<div class="LC_left_float"> |
<fieldset> |
<fieldset> |
<legend>$lt{'act'}</legend> |
<legend>$lt{'act'}</legend> |
$lt{'sm'}: <input type="submit" name="setmostrecent" value="Go" /><br /> |
$lt{'sm'}: <input type="submit" name="setmostrecent" value="Go" $disabled /><br /> |
$lt{'sc'}: <input type="submit" name="setcurrent" value="Go" /> |
$lt{'sc'}: <input type="submit" name="setcurrent" value="Go" $disabled /> |
</fieldset> |
</fieldset> |
</div> |
</div> |
<br clear="all" /> |
<br clear="all" /> |
Line 4249 ENDHEADERS
|
Line 4529 ENDHEADERS
|
return; |
return; |
} |
} |
$r->print( |
$r->print( |
'<input type="submit" name="setversions" value="'.$lt{'save'}.'" />'. |
'<input type="submit" name="setversions" value="'.$lt{'save'}.'"'.$disabled.' />'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th>'.&mt('Resources').'</th>'. |
'<th>'.&mt('Resources').'</th>'. |
Line 4294 ENDHEADERS
|
Line 4574 ENDHEADERS
|
{'select_form_order' => ['',1..$currentversion,'mostrecent'], |
{'select_form_order' => ['',1..$currentversion,'mostrecent'], |
'' => '', |
'' => '', |
'mostrecent' => &mt('most recent'), |
'mostrecent' => &mt('most recent'), |
map {$_,$_} (1..$currentversion)})); |
map {$_,$_} (1..$currentversion)},'',$readonly)); |
my $lastold=1; |
my $lastold=1; |
for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { |
for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { |
my $url=$root.'.'.$prevvers.'.'.$extension; |
my $url=$root.'.'.$prevvers.'.'.$extension; |
Line 4328 ENDHEADERS
|
Line 4608 ENDHEADERS
|
} |
} |
$r->print( |
$r->print( |
&Apache::loncommon::end_data_table(). |
&Apache::loncommon::end_data_table(). |
'<input type="submit" name="setversions" value="'.$lt{'save'}.'" />'. |
'<input type="submit" name="setversions" value="'.$lt{'save'}.'"'.$disabled.' />'. |
'</form>' |
'</form>' |
); |
); |
|
|
Line 4494 sub handler {
|
Line 4774 sub handler {
|
$help{'Group Portfolio'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files'); |
$help{'Group Portfolio'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files'); |
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching'); |
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching'); |
|
|
my $allowed; |
my ($allowed,$canedit,$canview,$disabled); |
# URI is /adm/supplemental when viewing supplemental docs in non-edit mode. |
# URI is /adm/supplemental when viewing supplemental docs in non-edit mode. |
unless ($r->uri eq '/adm/supplemental') { |
unless ($r->uri eq '/adm/supplemental') { |
# does this user have privileges to modify content. |
# does this user have privileges to modify content. |
$allowed = &Apache::lonnet::allowed('mdc',$env{'request.course.id'}); |
if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) { |
|
$allowed = 1; |
|
$canedit = 1; |
|
$canview = 1; |
|
} elsif (&Apache::lonnet::allowed('cev',$env{'request.course.id'})) { |
|
$allowed = 1; |
|
$canview = 1; |
|
} |
} |
} |
|
unless ($canedit) { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['chooseserver', |
$disabled = ' disabled="disabled"'; |
'inhibitmenu']); |
} |
if ($allowed && $env{'form.chooseserver'}) { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']); |
&choose_dump_server($r); |
if ($allowed && $env{'form.verify'}) { |
return OK; |
|
} elsif ($allowed && $env{'form.verify'}) { |
|
&init_breadcrumbs('verify','Verify Content','Docs_Verify_Content'); |
&init_breadcrumbs('verify','Verify Content','Docs_Verify_Content'); |
&verifycontent($r); |
&verifycontent($r); |
} elsif ($allowed && $env{'form.listsymbs'}) { |
} elsif ($allowed && $env{'form.listsymbs'}) { |
Line 4518 sub handler {
|
Line 4803 sub handler {
|
if ($folder eq '') { |
if ($folder eq '') { |
$folder='default'; |
$folder='default'; |
} |
} |
&docs_change_log($r,$coursenum,$coursedom,$folder,$allowed,$crstype,$iconpath); |
&docs_change_log($r,$coursenum,$coursedom,$folder,$allowed,$crstype,$iconpath,$canedit); |
} elsif ($allowed && $env{'form.versions'}) { |
} elsif ($allowed && $env{'form.versions'}) { |
&init_breadcrumbs('versions','Check/Set Resource Versions','Docs_Check_Resource_Versions'); |
&init_breadcrumbs('versions','Check/Set Resource Versions','Docs_Check_Resource_Versions'); |
&checkversions($r); |
&checkversions($r,$canedit); |
} elsif ($allowed && $env{'form.dumpcourse'}) { |
} elsif ($canedit && $env{'form.dumpcourse'}) { |
&init_breadcrumbs('dumpcourse','Copy '.&Apache::loncommon::course_type().' Content to Authoring Space'); |
&init_breadcrumbs('dumpcourse','Copy '.&Apache::loncommon::course_type().' Content to Authoring Space'); |
&dumpcourse($r); |
&dumpcourse($r); |
} elsif ($allowed && $env{'form.exportcourse'}) { |
} elsif ($allowed && $env{'form.exportcourse'}) { |
Line 4567 sub handler {
|
Line 4852 sub handler {
|
my $container; |
my $container; |
my $containertag; |
my $containertag; |
my $pathitem; |
my $pathitem; |
|
my $hiddentop; |
|
my $navmap; |
|
my $filterFunc = sub { my $res = shift; return (!$res->randomout() && !$res->is_map()) }; |
|
|
# Do we directly jump somewhere? |
# Do we directly jump somewhere? |
|
|
if (($env{'form.command'} eq 'direct') || ($env{'form.command'} eq 'directnav')) { |
if (($env{'form.command'} eq 'direct') || ($env{'form.command'} eq 'directnav')) { |
if ($env{'form.symb'} ne '') { |
if ($env{'form.symb'} ne '') { |
$env{'form.folderpath'}= |
$env{'form.folderpath'}= |
&Apache::loncommon::symb_to_docspath($env{'form.symb'}); |
&Apache::loncommon::symb_to_docspath($env{'form.symb'},\$navmap); |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => |
$env{'form.command'}.'_'.$env{'form.symb'}}); |
$env{'form.command'}.'_'.$env{'form.symb'}}); |
} elsif ($env{'form.supppath'} ne '') { |
} elsif ($env{'form.supppath'} ne '') { |
Line 4582 sub handler {
|
Line 4869 sub handler {
|
$env{'form.command'}.'_'.$env{'form.supppath'}}); |
$env{'form.command'}.'_'.$env{'form.supppath'}}); |
} |
} |
} elsif ($env{'form.command'} eq 'editdocs') { |
} elsif ($env{'form.command'} eq 'editdocs') { |
$env{'form.folderpath'} = 'default&'. |
$env{'form.folderpath'} = &default_folderpath($coursenum,$coursedom,\$navmap); |
&escape(&mt('Main Content').':::::'); |
|
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => $env{'form.command'}}); |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => $env{'form.command'}}); |
} elsif ($env{'form.command'} eq 'editsupp') { |
} elsif ($env{'form.command'} eq 'editsupp') { |
$env{'form.folderpath'} = 'supplemental&'. |
$env{'form.folderpath'} = &supplemental_base(); |
&escape('Supplemental Content'); |
|
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => '/adm/supplemental'}); |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => '/adm/supplemental'}); |
} elsif ($env{'form.command'} eq 'contents') { |
} elsif ($env{'form.command'} eq 'contents') { |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => '/adm/navmaps'}); |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => '/adm/navmaps'}); |
Line 4606 sub handler {
|
Line 4891 sub handler {
|
if ((!$env{'form.folderpath'}) && $allowed) { |
if ((!$env{'form.folderpath'}) && $allowed) { |
&Apache::loncommon::restore_course_settings($stored_folderpath, |
&Apache::loncommon::restore_course_settings($stored_folderpath, |
{'folderpath' => 'scalar'}); |
{'folderpath' => 'scalar'}); |
unless (&unescape($env{'form.folderpath'}) =~ m{^(default|supplemental)&}) { |
|
|
if (&unescape($env{'form.folderpath'}) =~ m{^(default|supplemental)&}) { |
|
if ($supplementalflag) { |
|
undef($env{'form.folderpath'}) if ($1 eq 'default'); |
|
} else { |
|
undef($env{'form.folderpath'}) if ($1 eq 'supplemental'); |
|
} |
|
} else { |
undef($env{'form.folderpath'}); |
undef($env{'form.folderpath'}); |
} |
} |
} |
} |
Line 4623 sub handler {
|
Line 4915 sub handler {
|
.'&'. |
.'&'. |
$env{'form.folderpath'}; |
$env{'form.folderpath'}; |
} |
} |
|
# If allowed and user's role is not advanced check folderpath is not hidden |
|
if (($allowed) && (!$env{'request.role.adv'}) && |
|
($env{'form.folderpath'} ne '') && (!$supplementalflag)) { |
|
my $folderurl; |
|
my @pathitems = split(/\&/,$env{'form.folderpath'}); |
|
my $folder = $pathitems[-2]; |
|
if ($folder eq '') { |
|
undef($env{'form.folderpath'}); |
|
} else { |
|
$folderurl = "uploaded/$coursedom/$coursenum/$folder"; |
|
if ((split(/\:/,$pathitems[-1]))[4]) { |
|
$folderurl .= '.page'; |
|
} else { |
|
$folderurl .= '.sequence'; |
|
} |
|
unless (ref($navmap)) { |
|
$navmap = Apache::lonnavmaps::navmap->new(); |
|
} |
|
if (ref($navmap)) { |
|
if (lc($navmap->get_mapparam(undef,$folderurl,"0.hiddenresource")) eq 'yes') { |
|
my @resources = $navmap->retrieveResources($folderurl,$filterFunc,1,1); |
|
unless (@resources) { |
|
undef($env{'form.folderpath'}); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
|
# If after all of this, we still don't have any paths, make them |
# If after all of this, we still don't have any paths, make them |
unless ($env{'form.folderpath'}) { |
unless ($env{'form.folderpath'}) { |
if ($supplementalflag) { |
if ($supplementalflag) { |
$env{'form.folderpath'}=&supplemental_base(); |
$env{'form.folderpath'}=&supplemental_base(); |
} else { |
} elsif ($allowed) { |
$env{'form.folderpath'}='default&'.&escape(&mt('Main Content'). |
($env{'form.folderpath'},$hiddentop) = &default_folderpath($coursenum,$coursedom,\$navmap); |
':::::'); |
|
} |
} |
} |
} |
|
|
# Store this |
# Store this |
unless ($toolsflag) { |
unless ($toolsflag) { |
if ($allowed) { |
if (($allowed) && ($env{'form.folderpath'} ne '')) { |
&Apache::loncommon::store_course_settings($stored_folderpath, |
&Apache::loncommon::store_course_settings($stored_folderpath, |
{'folderpath' => 'scalar'}); |
{'folderpath' => 'scalar'}); |
} |
} |
Line 4653 sub handler {
|
Line 4974 sub handler {
|
} else { |
} else { |
if ($env{'form.folder'} eq '' || |
if ($env{'form.folder'} eq '' || |
$env{'form.folder'} eq 'supplemental') { |
$env{'form.folder'} eq 'supplemental') { |
$folderpath='default&'. |
if ($env{'form.folder'} eq 'supplemental') { |
&escape(&mt('Main Content').':::::'); |
$folderpath=&supplemental_base(); |
|
} elsif (!$hiddentop) { |
|
$folderpath='default&'. |
|
&escape(&mt('Main Content').':::::'); |
|
} |
} |
} |
} |
} |
$containertag = '<input type="hidden" name="folderpath" value="" />'; |
$containertag = '<input type="hidden" name="folderpath" value="" />'; |
Line 4665 sub handler {
|
Line 4990 sub handler {
|
if ($showdoc) { # got called in sequence from course |
if ($showdoc) { # got called in sequence from course |
$allowed=0; |
$allowed=0; |
} else { |
} else { |
if ($allowed) { |
if ($canedit) { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); |
$script=&Apache::lonratedt::editscript('simple'); |
$script=&Apache::lonratedt::editscript('simple'); |
} |
} |
Line 4704 sub handler {
|
Line 5029 sub handler {
|
} |
} |
} |
} |
my $tabidstr = join("','",@tabids); |
my $tabidstr = join("','",@tabids); |
$script .= &editing_js($udom,$uname,$supplementalflag). |
$script .= &editing_js($udom,$uname,$supplementalflag,$coursedom,$coursenum, |
|
$canedit,\$navmap). |
&history_tab_js(). |
&history_tab_js(). |
&inject_data_js(). |
&inject_data_js(). |
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid). |
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid). |
Line 4733 sub handler {
|
Line 5059 sub handler {
|
$r->print(&Apache::loncommon::start_page("$crstype documents",undef, |
$r->print(&Apache::loncommon::start_page("$crstype documents",undef, |
{'force_register' => $showdoc,})); |
{'force_register' => $showdoc,})); |
} elsif ($toolsflag) { |
} elsif ($toolsflag) { |
|
my ($breadtext,$breadtitle); |
|
$breadtext = "$crstype Editor"; |
|
if ($canedit) { |
|
$breadtitle = 'Editing '.$crstype.' Contents'; |
|
} else { |
|
$breadtext .= ' (View-only mode)'; |
|
$breadtitle = 'Viewing '.$crstype.' Contents'; |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb({ |
&Apache::lonhtmlcommon::add_breadcrumb({ |
href=>"/adm/coursedocs",text=>"$crstype Contents"}); |
href=>"/adm/coursedocs",text=>$breadtext}); |
$r->print(&Apache::loncommon::start_page("$crstype Contents", $script) |
$r->print(&Apache::loncommon::start_page("$crstype Contents", $script) |
.&Apache::loncommon::help_open_menu('','',273,'RAT') |
.&Apache::loncommon::help_open_menu('','',273,'RAT') |
.&Apache::lonhtmlcommon::breadcrumbs( |
.&Apache::lonhtmlcommon::breadcrumbs( |
'Editing Course Contents') |
$breadtitle) |
); |
); |
} elsif ($r->uri eq '/adm/supplemental') { |
} elsif ($r->uri eq '/adm/supplemental') { |
my $brcrum = &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype); |
my $brcrum = &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype); |
$r->print(&Apache::loncommon::start_page("Supplemental $crstype Content",undef, |
$r->print(&Apache::loncommon::start_page("Supplemental $crstype Content",undef, |
{'bread_crumbs' => $brcrum,})); |
{'bread_crumbs' => $brcrum,})); |
} else { |
} else { |
|
my ($breadtext,$breadtitle,$helpitem); |
|
$breadtext = "$crstype Editor"; |
|
if ($canedit) { |
|
$breadtitle = 'Editing '.$crstype.' Contents'; |
|
$helpitem = 'Docs_Adding_Course_Doc'; |
|
} else { |
|
$breadtext .= ' (View-only mode)'; |
|
$breadtitle = 'Viewing '.$crstype.' Contents'; |
|
$helpitem = 'Docs_Viewing_Course_Doc'; |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb({ |
&Apache::lonhtmlcommon::add_breadcrumb({ |
href=>"/adm/coursedocs",text=>"$crstype Contents"}); |
href=>"/adm/coursedocs",text=>$breadtext}); |
$r->print(&Apache::loncommon::start_page("$crstype Contents", $script, |
$r->print(&Apache::loncommon::start_page("$crstype Contents", $script, |
{'add_entries' => $addentries} |
{'add_entries' => $addentries} |
) |
) |
.&Apache::loncommon::help_open_menu('','',273,'RAT') |
.&Apache::loncommon::help_open_menu('','',273,'RAT') |
.&Apache::lonhtmlcommon::breadcrumbs( |
.&Apache::lonhtmlcommon::breadcrumbs( |
'Editing '.$crstype.' Contents', |
$breadtitle, |
'Docs_Adding_Course_Doc') |
$helpitem) |
); |
); |
} |
} |
|
|
my %allfiles = (); |
my %allfiles = (); |
my %codebase = (); |
my %codebase = (); |
my ($upload_result,$upload_output,$uploadphase); |
my ($upload_result,$upload_output,$uploadphase); |
if ($allowed) { |
if ($canedit) { |
if (($env{'form.uploaddoc.filename'}) && |
if (($env{'form.uploaddoc.filename'}) && |
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
my $context = $1; |
my $context = $1; |
Line 4768 sub handler {
|
Line 5112 sub handler {
|
undef($hadchanges); |
undef($hadchanges); |
$uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom, |
$uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom, |
\%allfiles,\%codebase,$context,$crstype); |
\%allfiles,\%codebase,$context,$crstype); |
|
undef($navmap); |
if ($hadchanges) { |
if ($hadchanges) { |
&mark_hash_old(); |
&mark_hash_old(); |
} |
} |
Line 4812 sub handler {
|
Line 5157 sub handler {
|
|
|
if ($allowed && $toolsflag) { |
if ($allowed && $toolsflag) { |
$r->print(&startContentScreen('tools')); |
$r->print(&startContentScreen('tools')); |
$r->print(&generate_admin_menu($crstype)); |
$r->print(&generate_admin_menu($crstype,$canedit)); |
$r->print(&endContentScreen()); |
$r->print(&endContentScreen()); |
} elsif ((!$showdoc) && (!$uploadphase)) { |
} elsif ((!$showdoc) && (!$uploadphase)) { |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
Line 4852 sub handler {
|
Line 5197 sub handler {
|
'bb6' => 'Blackboard 6', |
'bb6' => 'Blackboard 6', |
'angel5' => 'ANGEL 5.5', |
'angel5' => 'ANGEL 5.5', |
'webctce4' => 'WebCT 4 Campus Edition', |
'webctce4' => 'WebCT 4 Campus Edition', |
|
'er' => 'Editing rights unavailable for your current role.', |
); |
); |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
|
# Calculate free quota space for a user or course. |
|
my $quotatype = 'unofficial'; |
|
if ($crstype eq 'Community') { |
|
$quotatype = 'community'; |
|
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) { |
|
$quotatype = 'official'; |
|
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) { |
|
$quotatype = 'textbook'; |
|
} |
|
my $disk_quota = &Apache::loncommon::get_user_quota($coursenum,$coursedom, |
|
'course',$quotatype); # expressed in MB |
|
my $current_disk_usage = 0; |
|
foreach my $subdir ('docs','supplemental') { |
|
$current_disk_usage += &Apache::lonnet::diskusage($coursedom,$coursenum, |
|
"userfiles/$subdir",1); # expressed in kB |
|
} |
|
my $free_space = 1024 * ((1024 * $disk_quota) - $current_disk_usage); |
|
my $usage = $current_disk_usage/1024; # in MB |
|
my $quota = $disk_quota; |
|
my $percent; |
|
if ($disk_quota == 0) { |
|
$percent = 100.0; |
|
} else { |
|
$percent = 100*($usage/$disk_quota); |
|
} |
|
$usage = sprintf("%.2f",$usage); |
|
$quota = sprintf("%.2f",$quota); |
|
$percent = sprintf("%.0f",$percent); |
|
my $quotainfo = '<p>'.&mt('Currently using [_1] of the [_2] available.', |
|
$percent.'%',$quota.' MB').'</p>'; |
|
|
my $fileupload=(<<FIUP); |
my $fileupload=(<<FIUP); |
|
$quotainfo |
$lt{'file'}:<br /> |
$lt{'file'}:<br /> |
<input type="file" name="uploaddoc" size="40" /> |
<input type="file" name="uploaddoc" size="40" $disabled /> |
FIUP |
FIUP |
|
|
my $checkbox=(<<CHBO); |
my $checkbox=(<<CHBO); |
Line 4864 FIUP
|
Line 5242 FIUP
|
<input type="checkbox" name="parserflag" /> |
<input type="checkbox" name="parserflag" /> |
</label> --> |
</label> --> |
<label> |
<label> |
<input type="checkbox" name="parserflag" checked="checked" /> $lt{'parse'} |
<input type="checkbox" name="parserflag" checked="checked" $disabled /> $lt{'parse'} |
</label> |
</label> |
CHBO |
CHBO |
my $imsfolder = $env{'form.folder'}; |
my $imsfolder = $env{'form.folder'}; |
Line 4881 CHBO
|
Line 5259 CHBO
|
<br /> |
<br /> |
<p> |
<p> |
$lt{'cms'}: |
$lt{'cms'}: |
<select name="source"> |
<select name="source" $disabled> |
<option value="-1" selected="selected">$lt{'se'}</option> |
<option value="-1" selected="selected">$lt{'se'}</option> |
<option value="bb5">$lt{'bb5'}</option> |
<option value="bb5">$lt{'bb5'}</option> |
<option value="bb6">$lt{'bb6'}</option> |
<option value="bb6">$lt{'bb6'}</option> |
Line 4891 CHBO
|
Line 5269 CHBO
|
<input type="hidden" name="folder" value="$imsfolder" /> |
<input type="hidden" name="folder" value="$imsfolder" /> |
</p> |
</p> |
<input type="hidden" name="phase" value="one" /> |
<input type="hidden" name="phase" value="one" /> |
<input type="button" value="$lt{'imsl'}" onclick="makeims(this.form);" /> |
<input type="button" value="$lt{'imsl'}" onclick="makeims(this.form);" $disabled /> |
</fieldset> |
</fieldset> |
</form> |
</form> |
IMSFORM |
IMSFORM |
Line 4906 IMSFORM
|
Line 5284 IMSFORM
|
$fileupload |
$fileupload |
<br /> |
<br /> |
$lt{'title'}:<br /> |
$lt{'title'}:<br /> |
<input type="text" size="60" name="comment" /> |
<input type="text" size="60" name="comment" $disabled /> |
$pathitem |
$pathitem |
<input type="hidden" name="cmd" value="upload_default" /> |
<input type="hidden" name="cmd" value="upload_default" /> |
<br /> |
<br /> |
Line 4914 IMSFORM
|
Line 5292 IMSFORM
|
$checkbox |
$checkbox |
</span> |
</span> |
<br clear="all" /> |
<br clear="all" /> |
<input type="submit" value="$lt{'upld'}" /> |
<input type="submit" value="$lt{'upld'}" $disabled /> |
</fieldset> |
</fieldset> |
</form> |
</form> |
FUFORM |
FUFORM |
|
|
|
my $mapimportjs; |
|
if ($canedit) { |
|
$mapimportjs = "javascript:openbrowser('mapimportform','importmap','sequence,page','');"; |
|
} else { |
|
$mapimportjs = "javascript:alert('".&js_escape($lt{'er'})."');"; |
|
} |
my $importpubform=(<<SEDFFORM); |
my $importpubform=(<<SEDFFORM); |
<a class="LC_menubuttons_link" href="javascript:toggleMap('map');"> |
<a class="LC_menubuttons_link" href="javascript:toggleMap('map');"> |
$lt{'impm'}</a>$help{'Load_Map'} |
$lt{'impm'}</a>$help{'Load_Map'} |
Line 4929 FUFORM
|
Line 5313 FUFORM
|
$lt{'copm'}<br /> |
$lt{'copm'}<br /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input type="text" name="importmap" size="40" value="" |
<input type="text" name="importmap" size="40" value="" |
onfocus="this.blur();openbrowser('mapimportform','importmap','sequence,page','');" /> |
onfocus="this.blur();$mapimportjs" $disabled /> |
<a href="javascript:openbrowser('mapimportform','importmap','sequence,page','');">$lt{'selm'}</a></span><br /> |
<a href="$mapimportjs">$lt{'selm'}</a></span><br /> |
<input type="submit" name="loadmap" value="$lt{'load'}" /> |
<input type="submit" name="loadmap" value="$lt{'load'}" $disabled /> |
</fieldset> |
</fieldset> |
</form> |
</form> |
|
|
SEDFFORM |
SEDFFORM |
|
|
|
my $fromstoredjs; |
|
if ($canedit) { |
|
$fromstoredjs = 'open_StoredLinks_Import()'; |
|
} else { |
|
$fromstoredjs = "alert('".&js_escape($lt{'er'})."')"; |
|
} |
|
|
my @importpubforma = ( |
my @importpubforma = ( |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/src.png" alt="'.$lt{srch}.'" onclick="javascript:groupsearch()" />' => $pathitem."<a class='LC_menubuttons_link' href='javascript:groupsearch()'>$lt{'srch'}</a>" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/src.png" alt="'.$lt{srch}.'" onclick="javascript:groupsearch()" />' => $pathitem."<a class='LC_menubuttons_link' href='javascript:groupsearch()'>$lt{'srch'}</a>" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{impo}.'" onclick="javascript:groupimport();"/>' => "<a class='LC_menubuttons_link' href='javascript:groupimport();'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{impo}.'" onclick="javascript:groupimport();"/>' => "<a class='LC_menubuttons_link' href='javascript:groupimport();'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/wishlist.png" alt="'.$lt{lnks}.'" onclick="javascript:open_StoredLinks_Import();" />' => "<a class='LC_menubuttons_link' href='javascript:open_StoredLinks_Import();'>$lt{'lnks'}</a>" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/wishlist.png" alt="'.$lt{lnks}.'" onclick="javascript:'.$fromstoredjs.';" />' => '<a class="LC_menubuttons_link" href="javascript:'.$fromstoredjs.';">'.$lt{'lnks'}.'</a>' }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/sequence.png" alt="'.$lt{impm}.'" onclick="javascript:toggleMap(\'map\');" />' => $importpubform } |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/sequence.png" alt="'.$lt{impm}.'" onclick="javascript:toggleMap(\'map\');" />' => $importpubform } |
); |
); |
$importpubform = &create_form_ul(&create_list_elements(@importpubforma)); |
$importpubform = &create_form_ul(&create_list_elements(@importpubforma)); |
my $extresourcesform = |
my $extresourcesform = |
&Apache::lonextresedit::extedit_form(0,0,undef,undef,$pathitem, |
&Apache::lonextresedit::extedit_form(0,0,undef,undef,$pathitem, |
$help{'Adding_External_Resource'}); |
$help{'Adding_External_Resource'}, |
|
undef,undef,$disabled); |
if ($allowed) { |
if ($allowed) { |
my $folder = $env{'form.folder'}; |
my $folder = $env{'form.folder'}; |
if ($folder eq '') { |
if ($folder eq '') { |
$folder='default'; |
$folder='default'; |
} |
} |
my $output = &update_paste_buffer($coursenum,$coursedom,$folder); |
if ($canedit) { |
if ($output) { |
my $output = &update_paste_buffer($coursenum,$coursedom,$folder); |
$r->print($output); |
if ($output) { |
|
$r->print($output); |
|
} |
} |
} |
$r->print(<<HIDDENFORM); |
$r->print(<<HIDDENFORM); |
<form name="renameform" method="post" action="/adm/coursedocs"> |
<form name="renameform" method="post" action="/adm/coursedocs"> |
Line 4990 HIDDENFORM
|
Line 5385 HIDDENFORM
|
|
|
if ($allowed) { |
if ($allowed) { |
my $folder=$env{'form.folder'}; |
my $folder=$env{'form.folder'}; |
if ($folder eq '' || $supplementalflag) { |
if ((($folder eq '') && (!$hiddentop)) || ($supplementalflag)) { |
$folder='default'; |
$folder='default'; |
$savefolderpath = $env{'form.folderpath'}; |
$savefolderpath = $env{'form.folderpath'}; |
$env{'form.folderpath'}='default&'.&escape(&mt('Main Content')); |
$env{'form.folderpath'}='default&'.&escape(&mt('Main Content')); |
Line 5018 HIDDENFORM
|
Line 5413 HIDDENFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'navc'}=/adm/navmaps" /> |
value="$lt{'navc'}=/adm/navmaps" /> |
<a class="LC_menubuttons_link" href="javascript:document.newnav.submit()">$lt{'navc'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenew(document.newnav);">$lt{'navc'}</a> |
$help{'Navigate_Content'} |
$help{'Navigate_Content'} |
</form> |
</form> |
NNFORM |
NNFORM |
Line 5079 NBFORM
|
Line 5474 NBFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$plainname=/adm/$udom/$uname/aboutme" /> |
value="$plainname=/adm/$udom/$uname/aboutme" /> |
<a class="LC_menubuttons_link" href="javascript:document.newaboutme.submit()">$lt{'mypi'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenew(document.newaboutme);">$lt{'mypi'}</a> |
$help{'My Personal Information Page'} |
$help{'My Personal Information Page'} |
</form> |
</form> |
NAMFORM |
NAMFORM |
Line 5099 NASOFORM
|
Line 5494 NASOFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'rost'}=/adm/viewclasslist" /> |
value="$lt{'rost'}=/adm/viewclasslist" /> |
<a class="LC_menubuttons_link" href="javascript:document.newroster.submit()">$lt{'rost'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenew(document.newroster);">$lt{'rost'}</a> |
$help{'Course_Roster'} |
$help{'Course_Roster'} |
</form> |
</form> |
NROSTFORM |
NROSTFORM |
Line 5162 NFFORM
|
Line 5557 NFFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" /> |
value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" /> |
<a class="LC_menubuttons_link" href="javascript:document.newsyl.submit()">$lt{'syll'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenew(document.newsyl);">$lt{'syll'}</a> |
$help{'Syllabus'} |
$help{'Syllabus'} |
|
|
</form> |
</form> |
Line 5174 NSYLFORM
|
Line 5569 NSYLFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" /> |
value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" /> |
<a class="LC_menubuttons_link" href="javascript:document.newgroupfiles.submit()">$lt{'grpo'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenew(document.newgroupfiles);">$lt{'grpo'}</a> |
$help{'Group Portfolio'} |
$help{'Group Portfolio'} |
</form> |
</form> |
NGFFORM |
NGFFORM |
@specialdocumentsforma=( |
@specialdocumentsforma=( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/page.png" alt="'.$lt{newp}.'" onclick="javascript:makenewpage(document.newpage,\''.$pageseq.'\');" />'=>$newpageform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/page.png" alt="'.$lt{newp}.'" onclick="javascript:makenewpage(document.newpage,\''.$pageseq.'\');" />'=>$newpageform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/syllabus.png" alt="'.$lt{syll}.'" onclick="document.newsyl.submit()" />'=>$newsylform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/syllabus.png" alt="'.$lt{syll}.'" onclick="javascript:makenew(document.newsyl);" />'=>$newsylform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/navigation.png" alt="'.$lt{navc}.'" onclick="document.newnav.submit()" />'=>$newnavform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/navigation.png" alt="'.$lt{navc}.'" onclick="javascript:makenew(document.newnav);" />'=>$newnavform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simple.png" alt="'.$lt{sipa}.'" onclick="javascript:makesmppage();" />'=>$newsmppageform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simple.png" alt="'.$lt{sipa}.'" onclick="javascript:makesmppage();" />'=>$newsmppageform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/webpage.png" alt="'.$lt{webp}.'" onclick="javascript:makewebpage();" />'=>$newwebpageform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/webpage.png" alt="'.$lt{webp}.'" onclick="javascript:makewebpage();" />'=>$newwebpageform}, |
); |
); |
Line 5213 NGFFORM
|
Line 5608 NGFFORM
|
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/bchat.png" alt="'.$lt{bull}.'" onclick="javascript:makebulboard();" />'=>$newbulform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/bchat.png" alt="'.$lt{bull}.'" onclick="javascript:makebulboard();" />'=>$newbulform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/myaboutme.png" alt="'.$lt{mypi}.'" onclick="javascript:makebulboard();" />'=>$newaboutmeform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/myaboutme.png" alt="'.$lt{mypi}.'" onclick="javascript:makebulboard();" />'=>$newaboutmeform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/aboutme.png" alt="'.$lt{abou}.'" onclick="javascript:makeabout();" />'=>$newaboutsomeoneform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/aboutme.png" alt="'.$lt{abou}.'" onclick="javascript:makeabout();" />'=>$newaboutsomeoneform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/clst.png" alt="'.$lt{rost}.'" onclick="document.newroster.submit()" />'=>$newrosterform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/clst.png" alt="'.$lt{rost}.'" onclick="javascript:makenew(document.newroster);" />'=>$newrosterform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/groupportfolio.png" alt="'.$lt{grpo}.'" onclick="document.newgroupfiles.submit()" />'=>$newgroupfileform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/groupportfolio.png" alt="'.$lt{grpo}.'" onclick="javascript:makenew(document.newgroupfiles);" />'=>$newgroupfileform}, |
); |
); |
$communityform = &create_form_ul(&create_list_elements(@communityforma)); |
$communityform = &create_form_ul(&create_list_elements(@communityforma)); |
|
|
Line 5232 unless ($container eq 'page') {
|
Line 5627 unless ($container eq 'page') {
|
$hadchanges=0; |
$hadchanges=0; |
unless (($supplementalflag || $toolsflag)) { |
unless (($supplementalflag || $toolsflag)) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%orderhash,$iconpath,$pathitem); |
$supplementalflag,\%orderhash,$iconpath,$pathitem, |
|
$canedit,\$navmap,$hiddentop); |
|
undef($navmap); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
if ($hadchanges) { |
if ($hadchanges) { |
&mark_hash_old(); |
unless (&is_hash_old()) { |
|
&mark_hash_old(); |
|
} |
} |
} |
|
|
&changewarning($r,''); |
&changewarning($r,''); |
Line 5297 SNFFORM
|
Line 5696 SNFFORM
|
|
|
my $supextform = |
my $supextform = |
&Apache::lonextresedit::extedit_form(1,0,undef,undef,$pathitem, |
&Apache::lonextresedit::extedit_form(1,0,undef,undef,$pathitem, |
$help{'Adding_External_Resource'}); |
$help{'Adding_External_Resource'}, |
|
undef,undef,$disabled); |
|
|
my $supnewsylform=(<<SNSFORM); |
my $supnewsylform=(<<SNSFORM); |
<form action="/adm/coursedocs" method="post" name="supnewsyl"> |
<form action="/adm/coursedocs" method="post" name="supnewsyl"> |
Line 5305 SNFFORM
|
Line 5705 SNFFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="Syllabus=/public/$coursedom/$coursenum/syllabus" /> |
value="Syllabus=/public/$coursedom/$coursenum/syllabus" /> |
<a class="LC_menubuttons_link" href="javascript:document.supnewsyl.submit()">$lt{'syll'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenew(document.supnewsyl);">$lt{'syll'}</a> |
$help{'Syllabus'} |
$help{'Syllabus'} |
</form> |
</form> |
SNSFORM |
SNSFORM |
Line 5316 SNSFORM
|
Line 5716 SNSFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$plainname=/adm/$udom/$uname/aboutme" /> |
value="$plainname=/adm/$udom/$uname/aboutme" /> |
<a class="LC_menubuttons_link" href="javascript:document.supnewaboutme.submit()">$lt{'mypi'}</a> |
<a class="LC_menubuttons_link" href="javascript:makenew(document.supnewaboutme);">$lt{'mypi'}</a> |
$help{'My Personal Information Page'} |
$help{'My Personal Information Page'} |
</form> |
</form> |
SNAMFORM |
SNAMFORM |
Line 5343 SWEBFORM
|
Line 5743 SWEBFORM
|
|
|
|
|
my @specialdocs = ( |
my @specialdocs = ( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/syllabus.png" alt="'.$lt{syll}.'" onclick="document.supnewsyl.submit()" />' |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/syllabus.png" alt="'.$lt{syll}.'" onclick="javascript:makenew(document.supnewsyl);" />' |
=>$supnewsylform}, |
=>$supnewsylform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/myaboutme.png" alt="'.$lt{mypi}.'" onclick="document.supnewaboutme.submit()" />' |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/myaboutme.png" alt="'.$lt{mypi}.'" onclick="javascript:makenew(document.supnewaboutme);" />' |
=>$supnewaboutmeform}, |
=>$supnewaboutmeform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/webpage.png" alt="'.$lt{webp}.'" onclick="javascript:makewebpage('."'supp'".');" />'=>$supwebpageform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/webpage.png" alt="'.$lt{webp}.'" onclick="javascript:makewebpage('."'supp'".');" />'=>$supwebpageform}, |
|
|
Line 5365 my %suporderhash = (
|
Line 5765 my %suporderhash = (
|
); |
); |
if ($supplementalflag) { |
if ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%suporderhash,$iconpath,$pathitem); |
$supplementalflag,\%suporderhash,$iconpath,$pathitem, |
|
$canedit); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} else { |
} else { |
Line 5459 sub decompression_info {
|
Line 5860 sub decompression_info {
|
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $container='sequence'; |
my $container='sequence'; |
my ($pathitem,$hiddenelem); |
my ($pathitem,$hiddenelem); |
my @hiddens = ('newidx','comment','position','folderpath'); |
my @hiddens = ('newidx','comment','position','folderpath','archiveurl'); |
if ($env{'form.folderpath'} =~ /\:1$/) { |
if ($env{'form.folderpath'} =~ /\:1$/) { |
$container='page'; |
$container='page'; |
} |
} |
Line 5467 sub decompression_info {
|
Line 5868 sub decompression_info {
|
foreach my $item (@hiddens) { |
foreach my $item (@hiddens) { |
if ($env{'form.'.$item}) { |
if ($env{'form.'.$item}) { |
$hiddenelem .= '<input type="hidden" name="'.$item.'" value="'. |
$hiddenelem .= '<input type="hidden" name="'.$item.'" value="'. |
$env{'form.'.$item}.'" />'."\n"; |
&HTML::Entities::encode($env{'form.'.$item},'<>&"').'" />'."\n"; |
} |
} |
} |
} |
return ($destination,$dir_root,$londocroot,$docudom,$docuname,$container, |
return ($destination,$dir_root,$londocroot,$docudom,$docuname,$container, |
Line 5524 sub remove_archive {
|
Line 5925 sub remove_archive {
|
} else { |
} else { |
$delwarning = &mt('An error occurred retrieving the contents of the current folder.'); |
$delwarning = &mt('An error occurred retrieving the contents of the current folder.'); |
} |
} |
$delwarning .= &mt('As a result the archive file has not been removed.'); |
$delwarning .= ' '.&mt('As a result the archive file has not been removed.'); |
} else { |
} else { |
my $currcmd = $env{'form.cmd'}; |
my $currcmd = $env{'form.cmd'}; |
my $position = $env{'form.position'}; |
my $position = $env{'form.position'}; |
if ($position > 0) { |
my $archiveidx = $position; |
$env{'form.cmd'} = 'remove_'.$position; |
if ($position > 0) { |
my ($title,$url,@rrest) = |
if (($env{'form.autoextract_camtasia'}) && (scalar(@LONCAPA::map::order) == 2)) { |
split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$position]]); |
$archiveidx = $position-1; |
if (&handle_edit_cmd($docuname,$docudom)) { |
} |
($errtext,$fatal) = &storemap($docuname,$docudom,$map,1); |
$env{'form.cmd'} = 'remove_'.$archiveidx; |
if ($fatal) { |
my ($title,$url,@rrest) = |
if ($container eq 'page') { |
split(/:/,$LONCAPA::map::resources[$LONCAPA::map::order[$archiveidx]]); |
$delwarning = &mt('An error occurred updating the contents of the current page.'); |
if ($url eq $env{'form.archiveurl'}) { |
|
if (&handle_edit_cmd($docuname,$docudom)) { |
|
($errtext,$fatal) = &storemap($docuname,$docudom,$map,1); |
|
if ($fatal) { |
|
if ($container eq 'page') { |
|
$delwarning = &mt('An error occurred updating the contents of the current page.'); |
|
} else { |
|
$delwarning = &mt('An error occurred updating the contents of the current folder.'); |
|
} |
} else { |
} else { |
$delwarning = &mt('An error occurred updating the contents of the current folder.'); |
$delresult = &mt('Archive file removed.'); |
} |
} |
} else { |
|
$delresult = &mt('Archive file removed.'); |
|
} |
} |
|
} else { |
|
$delwarning .= &mt('Archive file had unexpected item number in folder.'). |
|
' '.&mt('As a result the archive file has not been removed.'); |
} |
} |
} |
} |
$env{'form.cmd'} = $currcmd; |
$env{'form.cmd'} = $currcmd; |
Line 5561 sub remove_archive {
|
Line 5971 sub remove_archive {
|
} |
} |
|
|
sub generate_admin_menu { |
sub generate_admin_menu { |
my ($crstype) = @_; |
my ($crstype,$canedit) = @_; |
my $lc_crstype = lc($crstype); |
my $lc_crstype = lc($crstype); |
my ($home,$other,%outhash)=&authorhosts(); |
my ($home,$other,%outhash)=&authorhosts(); |
my %lt= ( # do not translate here |
my %lt= ( # do not translate here |
Line 5619 sub generate_admin_menu {
|
Line 6029 sub generate_admin_menu {
|
linktitle => "List the unique identifier used for each resource instance in your $lc_crstype" |
linktitle => "List the unique identifier used for each resource instance in your $lc_crstype" |
}, |
}, |
] |
] |
}, |
}); |
|
if ($canedit) { |
|
push(@menu, |
{ categorytitle=>'Export', |
{ categorytitle=>'Export', |
items =>[ |
items =>[ |
{ linktext => $lt{'imse'}, |
{ linktext => $lt{'imse'}, |
Line 5638 sub generate_admin_menu {
|
Line 6050 sub generate_admin_menu {
|
}, |
}, |
] |
] |
}); |
}); |
|
} |
return '<form action="/adm/coursedocs" method="post" name="courseverify">'."\n". |
return '<form action="/adm/coursedocs" method="post" name="courseverify">'."\n". |
'<input type="hidden" id="dummy" />'."\n". |
'<input type="hidden" id="dummy" />'."\n". |
&Apache::lonhtmlcommon::generate_menu(@menu)."\n". |
&Apache::lonhtmlcommon::generate_menu(@menu)."\n". |
Line 5646 sub generate_admin_menu {
|
Line 6059 sub generate_admin_menu {
|
|
|
sub generate_edit_table { |
sub generate_edit_table { |
my ($tid,$orderhash_ref,$to_show,$iconpath,$jumpto,$readfile, |
my ($tid,$orderhash_ref,$to_show,$iconpath,$jumpto,$readfile, |
$need_save,$copyfolder) = @_; |
$need_save,$copyfolder,$canedit) = @_; |
return unless(ref($orderhash_ref) eq 'HASH'); |
return unless(ref($orderhash_ref) eq 'HASH'); |
my %orderhash = %{$orderhash_ref}; |
my %orderhash = %{$orderhash_ref}; |
my $form; |
my ($form, $activetab, $active, $disabled); |
my $activetab; |
|
my $active; |
|
if (($env{'form.active'} ne '') && ($env{'form.active'} ne '00')) { |
if (($env{'form.active'} ne '') && ($env{'form.active'} ne '00')) { |
$activetab = $env{'form.active'}; |
$activetab = $env{'form.active'}; |
} |
} |
|
unless ($canedit) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
my $backicon = $iconpath.'clickhere.gif'; |
my $backicon = $iconpath.'clickhere.gif'; |
my $backtext = &mt('Exit Editor'); |
my $backtext = &mt('Exit Editor'); |
$form = '<div class="LC_Box" style="margin:0;">'. |
$form = '<div class="LC_Box" style="margin:0;">'. |
Line 5718 sub generate_edit_table {
|
Line 6132 sub generate_edit_table {
|
<input type="hidden" name="multicopy" value="" /> |
<input type="hidden" name="multicopy" value="" /> |
<input type="hidden" name="multichange" value="" /> |
<input type="hidden" name="multichange" value="" /> |
<input type="hidden" name="copyfolder" value="$copyfolder" /> |
<input type="hidden" name="copyfolder" value="$copyfolder" /> |
<input type="submit" name="savemultiples" value="$button" /> |
<input type="submit" name="savemultiples" value="$button" $disabled /> |
</form> |
</form> |
</div> |
</div> |
END |
END |
Line 5744 END
|
Line 6158 END
|
} |
} |
|
|
sub editing_js { |
sub editing_js { |
my ($udom,$uname,$supplementalflag) = @_; |
my ($udom,$uname,$supplementalflag,$coursedom,$coursenum,$canedit,$navmapref) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %js_lt = &Apache::lonlocal::texthash( |
p_mnf => 'Name of New Folder', |
p_mnf => 'Name of New Folder', |
t_mnf => 'New Folder', |
t_mnf => 'New Folder', |
p_mnp => 'Name of New Page', |
p_mnp => 'Name of New Page', |
Line 5762 sub editing_js {
|
Line 6176 sub editing_js {
|
p_mab_alrt2 => 'Please enter both user and domain in the format user:domain', |
p_mab_alrt2 => 'Please enter both user and domain in the format user:domain', |
p_chn => 'New Title', |
p_chn => 'New Title', |
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', |
p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!', |
p_rmr2a => 'Remove[_99]', |
p_rmr2a => 'Remove', |
p_rmr2b => '?[_99]', |
p_rmr2b => '?', |
p_rmr3a => 'Remove those [_2]', |
p_rmr3a => 'Remove those', |
p_rmr3b => 'items?[_2]', |
p_rmr3b => 'items?', |
|
p_rmr4 => 'WARNING: Removing a resource uploaded to a course cannot be undone via "Undo Delete".', |
|
p_rmr5 => 'Push "Cancel" and then use "Cut" instead if you might need to undo this change.', |
p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!', |
p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!', |
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.', |
p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.', |
p_ctr2a => 'Cut[_98]', |
p_ctr2a => 'Cut', |
p_ctr2b => '?[_98]', |
p_ctr2b => '?', |
p_ctr3a => 'Cut those[_2]', |
p_ctr3a => 'Cut those', |
p_ctr3b => 'items?[_2]', |
p_ctr3b => 'items?', |
rpck => 'Enter number to pick (e.g., 3)', |
rpck => 'Enter number to pick (e.g., 3)', |
imsfile => 'You must choose an IMS package for import', |
imsfile => 'You must choose an IMS package for import', |
imscms => 'You must select which Course Management System was the source of the IMS package', |
imscms => 'You must select which Course Management System was the source of the IMS package', |
Line 5782 sub editing_js {
|
Line 6198 sub editing_js {
|
noor => 'No actions selected or changes to settings specified.', |
noor => 'No actions selected or changes to settings specified.', |
noch => 'No changes to settings specified.', |
noch => 'No changes to settings specified.', |
noac => 'No actions selected.', |
noac => 'No actions selected.', |
|
edri => 'Editing rights unavailable for your current role.', |
); |
); |
|
|
|
&js_escape(\%js_lt); |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"'); |
my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"'); |
my $main_container_page; |
my $main_container_page; |
if (&HTML::Entities::decode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'}) =~ /\:1$/) { |
if (&HTML::Entities::decode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'}) =~ /\:1$/) { |
$main_container_page = 1; |
$main_container_page = 1; |
} |
} |
my $toplevelmain = |
my $backtourl; |
&escape(&mt('Main Content').':::::'); |
my $toplevelmain = &escape(&default_folderpath($coursenum,$coursedom,$navmapref)); |
my $toplevelsupp = &supplemental_base(); |
my $toplevelsupp = &supplemental_base(); |
|
|
my $backtourl; |
|
if ($env{'docs.exit.'.$env{'request.course.id'}} =~ /^direct_(.+)$/) { |
if ($env{'docs.exit.'.$env{'request.course.id'}} =~ /^direct_(.+)$/) { |
my $caller = $1; |
my $caller = $1; |
if ($caller =~ /^supplemental/) { |
if ($caller =~ /^supplemental/) { |
Line 5803 sub editing_js {
|
Line 6220 sub editing_js {
|
my ($map,$id,$res)=&Apache::lonnet::decode_symb($caller); |
my ($map,$id,$res)=&Apache::lonnet::decode_symb($caller); |
$res = &Apache::lonnet::clutter($res); |
$res = &Apache::lonnet::clutter($res); |
if (&Apache::lonnet::is_on_map($res)) { |
if (&Apache::lonnet::is_on_map($res)) { |
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='. |
my ($url,$anchor); |
|
if ($res =~ /^([^#]+)#([^#]+)$/) { |
|
$url = $1; |
|
$anchor = $2; |
|
if (($caller =~ m{^([^#]+)\Q#$anchor\E$})) { |
|
$caller = $1.&escape('#').$anchor; |
|
} |
|
} else { |
|
$url = $res; |
|
} |
|
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"').'?symb='. |
&HTML::Entities::encode($caller,'<>&"'); |
&HTML::Entities::encode($caller,'<>&"'); |
|
if ($anchor ne '') { |
|
$backtourl .= '#'.&HTML::Entities::encode($anchor,'<>&"'); |
|
} |
|
$backtourl = &Apache::loncommon::escape_single($backtourl); |
} else { |
} else { |
$backtourl = '/adm/navmaps'; |
$backtourl = '/adm/navmaps'; |
} |
} |
Line 5825 sub editing_js {
|
Line 6256 sub editing_js {
|
$fieldsets = "'suppext','suppdoc'"; |
$fieldsets = "'suppext','suppdoc'"; |
} |
} |
|
|
return <<ENDNEWSCRIPT; |
my $jsmakefunctions; |
|
if ($canedit) { |
|
$jsmakefunctions = <<ENDNEWSCRIPT; |
function makenewfolder(targetform,folderseq) { |
function makenewfolder(targetform,folderseq) { |
var foldername=prompt('$lt{"p_mnf"}','$lt{"t_mnf"}'); |
var foldername=prompt('$js_lt{"p_mnf"}','$js_lt{"t_mnf"}'); |
if (foldername) { |
if (foldername) { |
targetform.importdetail.value=escape(foldername)+"="+folderseq; |
targetform.importdetail.value=escape(foldername)+"="+folderseq; |
targetform.submit(); |
targetform.submit(); |
Line 5835 function makenewfolder(targetform,folder
|
Line 6268 function makenewfolder(targetform,folder
|
} |
} |
|
|
function makenewpage(targetform,folderseq) { |
function makenewpage(targetform,folderseq) { |
var pagename=prompt('$lt{"p_mnp"}','$lt{"t_mnp"}'); |
var pagename=prompt('$js_lt{"p_mnp"}','$js_lt{"t_mnp"}'); |
if (pagename) { |
if (pagename) { |
targetform.importdetail.value=escape(pagename)+"="+folderseq; |
targetform.importdetail.value=escape(pagename)+"="+folderseq; |
targetform.submit(); |
targetform.submit(); |
Line 5843 function makenewpage(targetform,folderse
|
Line 6276 function makenewpage(targetform,folderse
|
} |
} |
|
|
function makeexamupload() { |
function makeexamupload() { |
var title=prompt('$lt{"p_mxu"}'); |
var title=prompt('$js_lt{"p_mxu"}'); |
if (title) { |
if (title) { |
this.document.forms.newexamupload.importdetail.value= |
this.document.forms.newexamupload.importdetail.value= |
escape(title)+'=/res/lib/templates/examupload.problem'; |
escape(title)+'=/res/lib/templates/examupload.problem'; |
Line 5852 function makeexamupload() {
|
Line 6285 function makeexamupload() {
|
} |
} |
|
|
function makesmppage() { |
function makesmppage() { |
var title=prompt('$lt{"p_msp"}'); |
var title=prompt('$js_lt{"p_msp"}'); |
if (title) { |
if (title) { |
this.document.forms.newsmppg.importdetail.value= |
this.document.forms.newsmppg.importdetail.value= |
escape(title)+'=/adm/$udom/$uname/new/smppg'; |
escape(title)+'=/adm/$udom/$uname/new/smppg'; |
Line 5861 function makesmppage() {
|
Line 6294 function makesmppage() {
|
} |
} |
|
|
function makewebpage(type) { |
function makewebpage(type) { |
var title=prompt('$lt{"p_mwp"}'); |
var title=prompt('$js_lt{"p_mwp"}'); |
var formname; |
var formname; |
if (type == 'supp') { |
if (type == 'supp') { |
formname = this.document.forms.supwebpage; |
formname = this.document.forms.supwebpage; |
Line 5876 function makewebpage(type) {
|
Line 6309 function makewebpage(type) {
|
} |
} |
|
|
function makesmpproblem() { |
function makesmpproblem() { |
var title=prompt('$lt{"p_msb"}'); |
var title=prompt('$js_lt{"p_msb"}'); |
if (title) { |
if (title) { |
this.document.forms.newsmpproblem.importdetail.value= |
this.document.forms.newsmpproblem.importdetail.value= |
escape(title)+'=/res/lib/templates/simpleproblem.problem'; |
escape(title)+'=/res/lib/templates/simpleproblem.problem'; |
Line 5885 function makesmpproblem() {
|
Line 6318 function makesmpproblem() {
|
} |
} |
|
|
function makedropbox() { |
function makedropbox() { |
var title=prompt('$lt{"p_mdb"}'); |
var title=prompt('$js_lt{"p_mdb"}'); |
if (title) { |
if (title) { |
this.document.forms.newdropbox.importdetail.value= |
this.document.forms.newdropbox.importdetail.value= |
escape(title)+'=/res/lib/templates/DropBox.problem'; |
escape(title)+'=/res/lib/templates/DropBox.problem'; |
Line 5894 function makedropbox() {
|
Line 6327 function makedropbox() {
|
} |
} |
|
|
function makebulboard() { |
function makebulboard() { |
var title=prompt('$lt{"p_mbb"}'); |
var title=prompt('$js_lt{"p_mbb"}'); |
if (title) { |
if (title) { |
this.document.forms.newbul.importdetail.value= |
this.document.forms.newbul.importdetail.value= |
escape(title)+'=/adm/$udom/$uname/new/bulletinboard'; |
escape(title)+'=/adm/$udom/$uname/new/bulletinboard'; |
Line 5903 function makebulboard() {
|
Line 6336 function makebulboard() {
|
} |
} |
|
|
function makeabout() { |
function makeabout() { |
var user=prompt("$lt{'p_mab'}"); |
var user=prompt("$js_lt{'p_mab'}"); |
if (user) { |
if (user) { |
var comp=new Array(); |
var comp=new Array(); |
comp=user.split(':'); |
comp=user.split(':'); |
if ((typeof(comp[0])!=undefined) && (typeof(comp[1])!=undefined)) { |
if ((typeof(comp[0])!=undefined) && (typeof(comp[1])!=undefined)) { |
if ((comp[0]) && (comp[1])) { |
if ((comp[0]) && (comp[1])) { |
this.document.forms.newaboutsomeone.importdetail.value= |
this.document.forms.newaboutsomeone.importdetail.value= |
'$lt{"p_mab2"}'+escape(user)+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme'; |
'$js_lt{"p_mab2"}'+escape(user)+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme'; |
this.document.forms.newaboutsomeone.submit(); |
this.document.forms.newaboutsomeone.submit(); |
} else { |
} else { |
alert("$lt{'p_mab_alrt1'}"); |
alert("$js_lt{'p_mab_alrt1'}"); |
} |
} |
} else { |
} else { |
alert("$lt{'p_mab_alrt2'}"); |
alert("$js_lt{'p_mab_alrt2'}"); |
|
} |
|
} |
} |
} |
|
|
|
function makenew(targetform) { |
|
targetform.submit(); |
} |
} |
|
|
|
function changename(folderpath,index,oldtitle) { |
|
var title=prompt('$js_lt{"p_chn"}',oldtitle); |
|
if (title) { |
|
this.document.forms.renameform.markcopy.value=''; |
|
this.document.forms.renameform.title.value=title; |
|
this.document.forms.renameform.cmd.value='rename_'+index; |
|
this.document.forms.renameform.folderpath.value=folderpath; |
|
this.document.forms.renameform.submit(); |
|
} |
|
} |
|
|
|
ENDNEWSCRIPT |
|
} else { |
|
$jsmakefunctions = <<ENDNEWSCRIPT; |
|
|
|
function makenewfolder() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function makenewpage() { |
|
alert("$js_lt{'edri'}"); |
} |
} |
|
|
|
function makeexamupload() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function makesmppage() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function makewebpage(type) { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function makesmpproblem() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function makedropbox() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function makebulboard() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function makeabout() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function changename() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function makenew() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function groupimport() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function groupsearch() { |
|
alert("$js_lt{'edri'}"); |
|
} |
|
|
|
function groupopen(url,recover) { |
|
var options="scrollbars=1,resizable=1,menubar=0"; |
|
idxflag=1; |
|
idx=open("/adm/groupsort?inhibitmenu=yes&mode=simple&recover="+recover+"&readfile="+url,"idxout",options); |
|
idx.focus(); |
|
} |
|
|
|
ENDNEWSCRIPT |
|
|
|
} |
|
return <<ENDSCRIPT; |
|
|
|
$jsmakefunctions |
|
|
function toggleUpload(caller) { |
function toggleUpload(caller) { |
var blocks = Array($fieldsets); |
var blocks = Array($fieldsets); |
for (var i=0; i<blocks.length; i++) { |
for (var i=0; i<blocks.length; i++) { |
Line 5954 function toggleMap(caller) {
|
Line 6472 function toggleMap(caller) {
|
|
|
function makeims(imsform) { |
function makeims(imsform) { |
if ((imsform.uploaddoc.value == '') || (!imsform.uploaddoc.value)) { |
if ((imsform.uploaddoc.value == '') || (!imsform.uploaddoc.value)) { |
alert("$lt{'imsfile'}"); |
alert("$js_lt{'imsfile'}"); |
return; |
return; |
} |
} |
if (imsform.source.selectedIndex == 0) { |
if (imsform.source.selectedIndex == 0) { |
alert("$lt{'imscms'}"); |
alert("$js_lt{'imscms'}"); |
return; |
return; |
} |
} |
newWindow = window.open('', 'IMSimport',"HEIGHT=700,WIDTH=750,scrollbars=yes"); |
newWindow = window.open('', 'IMSimport',"HEIGHT=700,WIDTH=750,scrollbars=yes"); |
imsform.submit(); |
imsform.submit(); |
} |
} |
|
|
function changename(folderpath,index,oldtitle) { |
|
var title=prompt('$lt{"p_chn"}',oldtitle); |
|
if (title) { |
|
this.document.forms.renameform.markcopy.value=''; |
|
this.document.forms.renameform.title.value=title; |
|
this.document.forms.renameform.cmd.value='rename_'+index; |
|
this.document.forms.renameform.folderpath.value=folderpath; |
|
this.document.forms.renameform.submit(); |
|
} |
|
} |
|
|
|
function updatePick(targetform,index,caller) { |
function updatePick(targetform,index,caller) { |
var pickitem; |
var pickitem; |
var picknumitem; |
var picknumitem; |
Line 5990 function updatePick(targetform,index,cal
|
Line 6497 function updatePick(targetform,index,cal
|
picknumtext = document.getElementById('randompicknum_'+index); |
picknumtext = document.getElementById('randompicknum_'+index); |
} |
} |
if (pickitem.checked) { |
if (pickitem.checked) { |
var picknum=prompt('$lt{"rpck"}',picknumitem.value); |
var picknum=prompt('$js_lt{"rpck"}',picknumitem.value); |
if (picknum == '' || picknum == null) { |
if (picknum == '' || picknum == null) { |
if (caller == 'check') { |
if (caller == 'check') { |
pickitem.checked=false; |
pickitem.checked=false; |
Line 6140 function propagateState(form,param) {
|
Line 6647 function propagateState(form,param) {
|
return; |
return; |
} |
} |
|
|
function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder) { |
function checkForSubmit(targetform,param,context,idx,folderpath,index,oldtitle,skip_confirm,container,folder,confirm_removal) { |
|
var canedit = '$canedit'; |
|
if (canedit == '') { |
|
alert("$js_lt{'edri'}"); |
|
return; |
|
} |
var dosettings; |
var dosettings; |
var doaction; |
var doaction; |
var control = document.togglemultsettings; |
var control = document.togglemultsettings; |
Line 6178 function checkForSubmit(targetform,param
|
Line 6690 function checkForSubmit(targetform,param
|
targetform.markcopy.value=idx+':'+param; |
targetform.markcopy.value=idx+':'+param; |
targetform.copyfolder.value=folder+'.'+container; |
targetform.copyfolder.value=folder+'.'+container; |
if (param == 'remove') { |
if (param == 'remove') { |
if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) { |
var doremove = 0; |
|
if (skip_confirm) { |
|
if (confirm_removal) { |
|
if (confirm('$js_lt{"p_rmr4"}\\n$js_lt{"p_rmr5"}\\n\\n$js_lt{"p_rmr2a"} "'+oldtitle+'"$js_lt{"p_rmr2b"}')) { |
|
doremove = 1; |
|
} |
|
} else { |
|
doremove = 1; |
|
} |
|
} else { |
|
if (confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr2a"} "'+oldtitle+'" $js_lt{"p_rmr2b"}')) { |
|
doremove = 1; |
|
} |
|
} |
|
if (doremove) { |
targetform.markcopy.value=''; |
targetform.markcopy.value=''; |
targetform.copyfolder.value=''; |
targetform.copyfolder.value=''; |
targetform.submit(); |
targetform.submit(); |
} |
} |
} |
} |
if (param == 'cut') { |
if (param == 'cut') { |
if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) { |
if (skip_confirm || confirm('$js_lt{"p_ctr1a"}\\n$js_lt{"p_ctr1b"}\\n\\n$js_lt{"p_ctr2a"} "'+oldtitle+'" $js_lt{"p_ctr2b"}')) { |
targetform.submit(); |
targetform.submit(); |
return; |
return; |
} |
} |
Line 6364 function togglePick(caller,value) {
|
Line 6890 function togglePick(caller,value) {
|
} |
} |
document.getElementById('multi'+caller).style.display=disp; |
document.getElementById('multi'+caller).style.display=disp; |
if (value == 1) { |
if (value == 1) { |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',1);" style="text-decoration:none;">$lt{'more'}</a>'; |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',1);" style="text-decoration:none;">$js_lt{'more'}</a>'; |
} else { |
} else { |
document.getElementById('more'+caller).innerHTML = ''; |
document.getElementById('more'+caller).innerHTML = ''; |
} |
} |
Line 6390 function togglePick(caller,value) {
|
Line 6916 function togglePick(caller,value) {
|
|
|
function toggleCheckUncheck(caller,more) { |
function toggleCheckUncheck(caller,more) { |
if (more == 1) { |
if (more == 1) { |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',0);" style="text-decoration:none;">$lt{'less'}</a>'; |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',0);" style="text-decoration:none;">$js_lt{'less'}</a>'; |
document.getElementById('allfields'+caller).style.display='block'; |
document.getElementById('allfields'+caller).style.display='block'; |
} else { |
} else { |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',1);" style="text-decoration:none;">$lt{'more'}</a>'; |
document.getElementById('more'+caller).innerHTML = ' <a href="javascript:toggleCheckUncheck(\\''+caller+'\\',1);" style="text-decoration:none;">$js_lt{'more'}</a>'; |
document.getElementById('allfields'+caller).style.display='none'; |
document.getElementById('allfields'+caller).style.display='none'; |
} |
} |
resize_scrollbox('contentscroll','1','1'); |
resize_scrollbox('contentscroll','1','1'); |
Line 6435 function checkSubmits() {
|
Line 6961 function checkSubmits() {
|
var doactions = multiActions(); |
var doactions = multiActions(); |
var cutwarnings = 0; |
var cutwarnings = 0; |
var remwarnings = 0; |
var remwarnings = 0; |
|
var removalinfo = 0; |
if (doactions == 1) { |
if (doactions == 1) { |
var remidxlist = document.cumulativeactions.allremoveidx.value; |
var remidxlist = document.cumulativeactions.allremoveidx.value; |
if ((remidxlist != '') && (remidxlist != null)) { |
if ((remidxlist != '') && (remidxlist != null)) { |
Line 6449 function checkSubmits() {
|
Line 6976 function checkSubmits() {
|
remwarnings ++; |
remwarnings ++; |
} |
} |
} |
} |
|
if (document.getElementById('confirm_removal_'+remidxs[i])) { |
|
if (document.getElementById('confirm_removal_'+remidxs[i]).value == 1) { |
|
removalinfo ++; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 6547 function checkSubmits() {
|
Line 7079 function checkSubmits() {
|
} |
} |
if (doactions == 1) { |
if (doactions == 1) { |
if (numchanges > 0) { |
if (numchanges > 0) { |
if ((cutwarnings > 0) || (remwarnings > 0)) { |
if ((cutwarnings > 0) || (remwarnings > 0) || (removalinfo > 0)) { |
if (remwarnings > 0) { |
if (remwarnings > 0) { |
if (!confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr3a"} '+remwarnings+' $lt{"p_rmr3b"}')) { |
if (!confirm('$js_lt{"p_rmr1"}\\n\\n$js_lt{"p_rmr3a"} '+remwarnings+' $js_lt{"p_rmr3b"}')) { |
|
return false; |
|
} |
|
} |
|
if (removalinfo > 0) { |
|
if (!confirm('$js_lt{"p_rmr4"}\\n$js_lt{"p_rmr5"}\\n\\n$js_lt{"p_rmr3a"} '+removalinfo+' $js_lt{"p_rmr3b"}')) { |
return false; |
return false; |
} |
} |
} |
} |
if (cutwarnings > 0) { |
if (cutwarnings > 0) { |
if (!confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr3a"} '+cutwarnings+' $lt{"p_ctr3b"}')) { |
if (!confirm('$js_lt{"p_ctr1a"}\\n$js_lt{"p_ctr1b"}\\n\\n$js_lt{"p_ctr3a"} '+cutwarnings+' $js_lt{"p_ctr3b"}')) { |
return false; |
return false; |
} |
} |
} |
} |
Line 6570 function checkSubmits() {
|
Line 7107 function checkSubmits() {
|
} |
} |
} |
} |
if ((dosettings == 1) && (doactions == 1)) { |
if ((dosettings == 1) && (doactions == 1)) { |
alert("$lt{'noor'}"); |
alert("$js_lt{'noor'}"); |
} else { |
} else { |
if (dosettings == 1) { |
if (dosettings == 1) { |
alert("$lt{'noch'}"); |
alert("$js_lt{'noch'}"); |
} else { |
} else { |
alert("$lt{'noac'}"); |
alert("$js_lt{'noac'}"); |
} |
} |
} |
} |
return false; |
return false; |
Line 6661 function setBoxes(value) {
|
Line 7198 function setBoxes(value) {
|
return; |
return; |
} |
} |
|
|
ENDNEWSCRIPT |
ENDSCRIPT |
} |
} |
|
|
sub history_tab_js { |
sub history_tab_js { |
Line 6690 ENDINJECT
|
Line 7227 ENDINJECT
|
|
|
sub dump_switchserver_js { |
sub dump_switchserver_js { |
my @hosts = @_; |
my @hosts = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %js_lt = &Apache::lonlocal::texthash( |
dump => 'Copying content to Authoring Space requires switching server.', |
dump => 'Copying content to Authoring Space requires switching server.', |
swit => 'Switch server?', |
swit => 'Switch server?', |
|
); |
|
my %html_js_lt = &Apache::lonlocal::texthash( |
|
swit => 'Switch server?', |
duco => 'Copying Content to Authoring Space', |
duco => 'Copying Content to Authoring Space', |
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.', |
yone => 'You need to switch to a server housing an Authoring Space for which you are author or co-author.', |
chos => 'Choose server', |
chos => 'Choose server', |
); |
); |
|
&js_escape(\%js_lt); |
|
&html_escape(\%html_js_lt); |
|
&js_escape(\%html_js_lt); |
my $role = $env{'request.role'}; |
my $role = $env{'request.role'}; |
my $js = <<"ENDSWJS"; |
my $js = <<"ENDSWJS"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 6737 ENDSWJS
|
Line 7280 ENDSWJS
|
|
|
function dump_needs_switchserver(url) { |
function dump_needs_switchserver(url) { |
if (url!='' && url!= null) { |
if (url!='' && url!= null) { |
if (confirm("$lt{'dump'}\\n$lt{'swit'}")) { |
if (confirm("$js_lt{'dump'}\\n$js_lt{'swit'}")) { |
go(url); |
go(url); |
} |
} |
} |
} |
Line 6748 function choose_switchserver_window() {
|
Line 7291 function choose_switchserver_window() {
|
newWindow = window.open('','ChooseServer','height=400,width=500,scrollbars=yes') |
newWindow = window.open('','ChooseServer','height=400,width=500,scrollbars=yes') |
newWindow.document.open(); |
newWindow.document.open(); |
newWindow.document.writeln('$startpage'); |
newWindow.document.writeln('$startpage'); |
newWindow.document.write('<h3>$lt{'duco'}<\\/h3>\\n'+ |
newWindow.document.write('<h3>$html_js_lt{'duco'}<\\/h3>\\n'+ |
'<p>$lt{'yone'}<\\/p>\\n'+ |
'<p>$html_js_lt{'yone'}<\\/p>\\n'+ |
'<div class="LC_left_float"><fieldset><legend>$lt{'chos'}<\\/legend>\\n'+ |
'<div class="LC_left_float"><fieldset><legend>$html_js_lt{'chos'}<\\/legend>\\n'+ |
'<form name="setserver" method="post" action="" \\/>\\n'+ |
'<form name="setserver" method="post" action="" \\/>\\n'+ |
'$hostpicker\\n'+ |
'$hostpicker\\n'+ |
'<br \\/><br \\/>\\n'+ |
'<br \\/><br \\/>\\n'+ |
'<input type="button" name="makeswitch" value="$lt{'swit'}" '+ |
'<input type="button" name="makeswitch" value="$html_js_lt{'swit'}" '+ |
'onclick="write_switchserver();" \\/>\\n'+ |
'onclick="write_switchserver();" \\/>\\n'+ |
'<\\/form><\\/fieldset><\\/div><br clear="all" \\/>\\n'); |
'<\\/form><\\/fieldset><\\/div><br clear="all" \\/>\\n'); |
newWindow.document.writeln('$endpage'); |
newWindow.document.writeln('$endpage'); |