version 1.689, 2022/12/17 18:07:47
|
version 1.690, 2022/12/31 14:08:59
|
Line 6294 FUFORM
|
Line 6294 FUFORM
|
SEDFFORM |
SEDFFORM |
my $importcrsresform; |
my $importcrsresform; |
my ($numdirs,$pickfile) = |
my ($numdirs,$pickfile) = |
&Apache::loncommon::import_crsauthor_form('crsresimportform','coursepath','coursefile', |
&Apache::loncommon::import_crsauthor_form('coursepath','coursefile', |
"resize_scrollbox('contentscroll','1','0');", |
"resize_scrollbox('contentscroll','1','0');", |
undef,'res'); |
undef,'res'); |
if ($pickfile) { |
if ($pickfile) { |
$importcrsresform=(<<CRSFORM); |
$importcrsresform=(<<CRSFORM); |
<a class="LC_menubuttons_link" href="javascript:toggleImportCrsres('res','$numdirs');"> |
<a class="LC_menubuttons_link" href="javascript:toggleImportCrsres('res');"> |
$lt{'imcr'}</a>$help{'Course_Resources'} |
$lt{'imcr'}</a>$help{'Course_Resources'} |
<form action="/adm/coursedocs" method="post" name="crsresimportform" onsubmit="return validImportCrsRes();"> |
<form action="/adm/coursedocs" method="post" name="crsresimportform" onsubmit="return validImportCrsRes();"> |
<fieldset id="importcrsresform" style="display: none;"> |
<fieldset id="importcrsresform" style="display: none;"> |
Line 6310 SEDFFORM
|
Line 6310 SEDFFORM
|
$lt{'title'}: <input type="textbox" name="crsrestitle" value="" $disabled /> |
$lt{'title'}: <input type="textbox" name="crsrestitle" value="" $disabled /> |
</p> |
</p> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="submit" name="crsres" value="$lt{'impo'}" $disabled /> |
<input type="submit" name="crsres" value="$lt{'impo'}" $disabled /><br /> |
</fieldset> |
</fieldset> |
</form> |
</form> |
CRSFORM |
CRSFORM |
Line 6330 CRSFORM
|
Line 6330 CRSFORM
|
{ '<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 }, |
); |
); |
if ($pickfile) { |
if ($pickfile) { |
push(@importpubforma,{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{imcr}.'" onclick="javascript:toggleImportCrsres(\'res\','."'$numdirs'".');"/>' => $importcrsresform}); |
push(@importpubforma,{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{imcr}.'" onclick="javascript:toggleImportCrsres(\'res\');" />' => $importcrsresform}); |
} |
} |
$importpubform = &create_form_ul(&create_list_elements(@importpubforma)); |
$importpubform = &create_form_ul(&create_list_elements(@importpubforma)); |
my $extresourcesform = |
my $extresourcesform = |
Line 6537 NWEBFORM
|
Line 6537 NWEBFORM
|
my $numcrsdirs = 0; |
my $numcrsdirs = 0; |
my ($showstdprob,$showswitch,$switchlink); |
my ($showstdprob,$showswitch,$switchlink); |
my $toppath = "/priv/$env{'user.domain'}/$env{'user.name'}"; |
my $toppath = "/priv/$env{'user.domain'}/$env{'user.name'}"; |
|
my $exclude = &Apache::lonnet::priv_exclude(); |
if ($env{'user.author'}) { |
if ($env{'user.author'}) { |
$numauthor ++; |
$numauthor ++; |
$select_menus{'author'}->{'text'} = &Apache::lonnet::plaintext('au'); |
$select_menus{'author'}->{'text'} = &Apache::lonnet::plaintext('au'); |
if (grep(/^\Q$env{'user.home'}\E$/,@ids)) { |
if (grep(/^\Q$env{'user.home'}\E$/,@ids)) { |
my $is_home = 1; |
my $is_home = 1; |
my %subdirs; |
my %subdirs; |
&Apache::lonnet::recursedirs($is_home,'priv',$londocroot,$toppath,'',\%subdirs); |
&Apache::lonnet::recursedirs($is_home,1,'',$exclude,0,$toppath,'',\%subdirs); |
$select_menus{'author'}->{'default'} = '/'; |
$select_menus{'author'}->{'default'} = '/'; |
$select_menus{'author'}->{'select2'}->{'/'} = '/'; |
my @ordered = (); |
my @ordered = ('/'); |
|
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
$select_menus{'author'}->{'select2'}->{$relpath} = $relpath; |
$select_menus{'author'}->{'select2'}->{$relpath} = $relpath; |
push(@ordered,$relpath); |
push(@ordered,$relpath); |
Line 6578 NWEBFORM
|
Line 6578 NWEBFORM
|
my $is_home = 1; |
my $is_home = 1; |
my (%subdirs,@ordered); |
my (%subdirs,@ordered); |
my $toppath="/priv/$audom/$auname"; |
my $toppath="/priv/$audom/$auname"; |
&Apache::lonnet::recursedirs($is_home,'priv',$londocroot,$toppath,'',\%subdirs); |
&Apache::lonnet::recursedirs($is_home,1,'',$exclude,0,$toppath,'',\%subdirs); |
$select_menus{$key}->{'default'} = '/'; |
$select_menus{$key}->{'default'} = '/'; |
$select_menus{$key}->{'select2'}->{'/'} = '/'; |
|
my @ordered = ('/'); |
|
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
$select_menus{$key}->{'select2'}->{$relpath} = $relpath; |
$select_menus{$key}->{'select2'}->{$relpath} = $relpath; |
push(@ordered,$relpath); |
push(@ordered,$relpath); |
Line 6626 NWEBFORM
|
Line 6624 NWEBFORM
|
my $is_home = 1; |
my $is_home = 1; |
my %subdirs; |
my %subdirs; |
my $toppath="/priv/$coursedom/$coursenum"; |
my $toppath="/priv/$coursedom/$coursenum"; |
&Apache::lonnet::recursedirs($is_home,'priv',$londocroot,$toppath,'',\%subdirs); |
&Apache::lonnet::recursedirs($is_home,1,'',$exclude,0,$toppath,'',\%subdirs); |
$numcrsdirs = keys(%subdirs); |
$numcrsdirs = keys(%subdirs); |
$select_menus{'course'}->{'default'} = '/'; |
$select_menus{'course'}->{'default'} = '/'; |
$select_menus{'course'}->{'select2'}->{'/'} = '/'; |
my @ordered = (); |
my @ordered = ('/'); |
|
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
foreach my $relpath (sort { lc($a) cmp lc($b) } (keys(%subdirs))) { |
$select_menus{'course'}->{'select2'}->{$relpath} = $relpath; |
$select_menus{'course'}->{'select2'}->{$relpath} = $relpath; |
push(@ordered,$relpath); |
push(@ordered,$relpath); |
Line 6658 NWEBFORM
|
Line 6655 NWEBFORM
|
$pickdir .= '<input type="hidden" name="authorrole" value="course" />'; |
$pickdir .= '<input type="hidden" name="authorrole" value="course" />'; |
my $toppath="/priv/$coursedom/$coursenum'}"; |
my $toppath="/priv/$coursedom/$coursenum'}"; |
my %subdirs; |
my %subdirs; |
&Apache::lonnet::recursedirs($is_home,'priv',$londocroot,$toppath,'',\%subdirs); |
&Apache::lonnet::recursedirs($is_home,1,'',$exclude,0,$toppath,'',\%subdirs); |
$numcrsdirs = keys(%subdirs); |
$numcrsdirs = keys(%subdirs); |
if ($numcrsdirs) { |
if ($numcrsdirs) { |
$pickdir .= $lt{'dire'}.' <select name="authorpath">'."\n". |
$pickdir .= $lt{'dire'}.' <select name="authorpath">'."\n". |
Line 6679 NWEBFORM
|
Line 6676 NWEBFORM
|
$select_menus{'course'}->{'default'} = 'switch'; |
$select_menus{'course'}->{'default'} = 'switch'; |
$select_menus{'course'}->{'order'} = ['switch']; |
$select_menus{'course'}->{'order'} = ['switch']; |
push(@order,'course'); |
push(@order,'course'); |
my $defrole; |
my $defrole = 'course'; |
$pickdir = $lt{'loca'}. |
$pickdir = $lt{'loca'}. |
&Apache::loncommon::linked_select_forms('courseresform','<br />'.$lt{'dire'}, |
&Apache::loncommon::linked_select_forms('courseresform','<br />'.$lt{'dire'}, |
$defrole,'authorrole','authorpath', |
$defrole,'authorrole','authorpath', |
Line 7530 sub editing_js {
|
Line 7527 sub editing_js {
|
my $backtourl; |
my $backtourl; |
my $toplevelmain = &escape(&default_folderpath($coursenum,$coursedom,$navmapref)); |
my $toplevelmain = &escape(&default_folderpath($coursenum,$coursedom,$navmapref)); |
my $toplevelsupp = &supplemental_base(); |
my $toplevelsupp = &supplemental_base(); |
|
my $showfile_js = &Apache::loncommon::show_crsfiles_js(); |
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 8056 function getExample(width,height,scrolli
|
Line 8053 function getExample(width,height,scrolli
|
} |
} |
} |
} |
|
|
function toggleImportCrsres(caller,dircount) { |
function toggleImportCrsres(caller) { |
var disp = 'none'; |
var disp = 'none'; |
if (document.getElementById('importcrsresform')) { |
if (document.getElementById('importcrsresform')) { |
if (caller == 'res') { |
if (caller == 'res') { |
var numdirs = parseInt(dircount); |
|
var curr = document.getElementById('importcrsresform').style.display; |
var curr = document.getElementById('importcrsresform').style.display; |
if (curr == 'none') { |
if (curr == 'none') { |
disp='block'; |
disp='block'; |
if (numdirs > 1) { |
populateCrsSelects(document.crsresimportform,'coursepath','coursefile',1,'',1,0,1,1); |
select1res_changed(); |
|
} |
|
} |
} |
} |
} |
document.getElementById('importcrsresform').style.display=disp; |
document.getElementById('importcrsresform').style.display=disp; |
Line 8075 function toggleImportCrsres(caller,dirco
|
Line 8069 function toggleImportCrsres(caller,dirco
|
return; |
return; |
} |
} |
|
|
|
$showfile_js |
|
|
function switchForProb() { |
function switchForProb() { |
if (document.courseresform.authorpath.options[document.courseresform.authorpath.selectedIndex].value == 'switch') { |
if (document.courseresform.authorpath.options[document.courseresform.authorpath.selectedIndex].value == 'switch') { |
var url = '/adm/switchserver?otherserver='; |
var url = '/adm/switchserver?otherserver='; |