--- loncom/interface/londocs.pm 2023/09/27 14:52:26 1.705 +++ loncom/interface/londocs.pm 2024/01/10 20:07:37 1.709 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.705 2023/09/27 14:52:26 raeburn Exp $ +# $Id: londocs.pm,v 1.709 2024/01/10 20:07:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -102,6 +102,7 @@ sub authorhosts { my %outhash=(); my $home=0; my $other=0; + my @ids=&Apache::lonnet::current_machine_ids(); foreach my $key (keys(%env)) { if ($key=~/^user\.role\.(au|ca)\.(.+)$/) { my $role=$1; @@ -118,7 +119,6 @@ sub authorhosts { } my $allowed=0; my $myhome=&Apache::lonnet::homeserver($ca,$cd); - my @ids=&Apache::lonnet::current_machine_ids(); foreach my $id (@ids) { if ($id eq $myhome) { $allowed=1; @@ -263,8 +263,8 @@ ENDJS add_entries => {'onload' => "hide_searching();"}, }; } - $r->print(&Apache::loncommon::start_page('Copy '.$crstype.' Content to Authoring Space',$js,$starthash)."\n". - &Apache::lonhtmlcommon::breadcrumbs('Copy '.$crstype.' Content to Authoring Space')."\n"); + $r->print(&Apache::loncommon::start_page('Copy uploaded content to Authoring Space',$js,$starthash)."\n". + &Apache::lonhtmlcommon::breadcrumbs('Copy uploaded content to Authoring Space')."\n"); $r->print(&startContentScreen('tools')); my ($home,$other,%outhash)=&authorhosts(); unless ($home) { @@ -5892,7 +5892,9 @@ sub handler { 'Load_Map','Supplemental','Score_Upload_Form', 'Adding_Pages','Importing_LON-CAPA_Resource', 'Importing_IMS_Course','Uploading_From_Harddrive', - 'Course_Roster','Web_Page','Dropbox','Simple_Problem') { + 'Course_Roster','Web_Page','Dropbox','Simple_Problem', + 'Standard_Problem','Course_Resources', + 'Search_LON-CAPA_Resource','Import_Stored_Links') { $help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); } # Composite help files @@ -5963,7 +5965,7 @@ sub handler { &init_breadcrumbs('versions','Check/Set Resource Versions','Docs_Check_Resource_Versions'); &checkversions($r,$canedit); } elsif ($canedit && $env{'form.dumpcourse'}) { - &init_breadcrumbs('dumpcourse','Copy '.&Apache::loncommon::course_type().' Content to Authoring Space'); + &init_breadcrumbs('dumpcourse','Copy uploaded content to Authoring Space'); &dumpcourse($r); } elsif ($canedit && $env{'form.exportcourse'}) { &init_breadcrumbs('exportcourse','IMS Export'); @@ -6147,8 +6149,8 @@ sub handler { &Apache::loncommon::validate_folderpath($supplementalflag,$allowed,$coursenum,$coursedom); } } - -# If we are not allowed to make changes and this is supplemental content set folderpath + +# Set folderpath if we are not allowed to make changes and this is supplemental content if ((!$allowed) && ($supplementalflag)) { unless ($env{'form.folderpath'} =~ /^supplemental/) { $env{'form.folderpath'} = &supplemental_base(); @@ -6501,7 +6503,7 @@ sub handler { if ($allowed && $toolsflag) { $r->print(&startContentScreen('tools')); - $r->print(&generate_admin_menu($crstype,$canedit)); + $r->print(&generate_admin_menu($crstype,$canedit,$coursenum,$coursedom)); $r->print(&endContentScreen()); } elsif ((!$showdoc) && (!$uploadphase)) { # ----------------------------------------------------------------------------- @@ -6509,8 +6511,8 @@ sub handler { 'copm' => 'All documents out of a published map into this folder', 'upfi' => 'Upload File', 'upld' => 'Upload Content', - 'srch' => 'Search', - 'impo' => 'Import', + 'srch' => 'Search Repository', + 'impo' => 'Import from Repository', 'lnks' => 'Import from Stored Links', 'impm' => 'Import from Assembled Map', 'imcr' => 'Import from Course Resources', @@ -6687,13 +6689,22 @@ FUFORM SEDFFORM - my $importcrsresform; - my ($numdirs,$pickfile) = - &Apache::loncommon::import_crsauthor_form('coursepath','coursefile', - "resize_scrollbox('contentscroll','1','0');", - undef,'res'); - if ($pickfile) { - $importcrsresform=(< $lt{'imcr'}$help{'Course_Resources'}
@@ -6716,6 +6727,7 @@ SEDFFORM
CRSFORM + } } my $fromstoredjs; @@ -6726,13 +6738,13 @@ CRSFORM } my @importpubforma = ( - { ''.$lt{srch}.'' => $pathitem."$lt{'srch'}" }, + { ''.$lt{srch}.'' => $pathitem."$lt{'srch'}$help{'Search_LON-CAPA_Resource'}" }, { ''.$lt{impo}.'' => "$lt{'impo'}$help{'Importing_LON-CAPA_Resource'}" }, - { ''.$lt{lnks}.'' => ''.$lt{'lnks'}.'' }, + { ''.$lt{lnks}.'' => ''.$lt{'lnks'}.''.$help{'Import_Stored_Links'} }, { ''.$lt{impm}.'' => $importpubform }, ); - if ($pickfile) { - push(@importpubforma,{ ''.$lt{imcr}.'' => $importcrsresform}); + if ($importcrsresform) { + push(@importpubforma,{ ''.$lt{imcr}.'' => $importcrsresform}); } $importpubform = &create_form_ul(&create_list_elements(@importpubforma)); my $extresourcesform = @@ -6984,13 +6996,14 @@ NWEBFORM } } } - $pickdir .= ''."\n". - '
'."\n". + if ($checkcrsres) { + $pickdir .= ''."\n"; + } + $pickdir .= '
'."\n". $lt{'dire'}. '
'."\n"; - my %seltemplate_menus; my @files = &Apache::lonhomework::get_template_list('problem'); my @noexamplelink = ('blank.problem','blank.library','script.library'); @@ -7031,9 +7044,11 @@ NWEBFORM "toggleExampleText();",'template').'
'; my $templatepreview = ''. ''.&mt('Example').''; - my $crsresform=(< - $lt{'stpr'}$help{'Course_Resource'} + $lt{'stpr'}$help{'Standard_Problem'}