[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface londocs.pm

raeburn raeburn at source.lon-capa.org
Wed Jul 3 11:15:00 EDT 2024


raeburn		Wed Jul  3 15:15:00 2024 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	londocs.pm 
  Log:
  - For 2.11
    Backport 1.679, 1.681, 1.693, 1.694, 1.700 (part), 1.702 (part)
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.484.2.94 loncom/interface/londocs.pm:1.484.2.95
--- loncom/interface/londocs.pm:1.484.2.94	Mon Jul  1 18:29:41 2024
+++ loncom/interface/londocs.pm	Wed Jul  3 15:15:00 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.484.2.94 2024/07/01 18:29:41 raeburn Exp $
+# $Id: londocs.pm,v 1.484.2.95 2024/07/03 15:15:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1031,7 +1031,11 @@
 	}
 	$r->print('</ul>');
 	if ($docslog{$id}{'logentry'}{'parameter_res'}) {
-	    $r->print(&LONCAPA::map::qtescape((split(/\:/,$docslog{$id}{'logentry'}{'parameter_res'}))[0]).':<ul>');
+            my ($title,$url) = split(/\:/,$docslog{$id}{'logentry'}{'parameter_res'},3);
+            if ($title eq '') {
+                ($title) = ($url =~ m{/([^/]+)$});
+            }
+            $r->print(&LONCAPA::map::qtescape($title).':<ul>');
 	    foreach my $parameter ('randompick','hiddenresource','encrypturl','randomorder') {
 		if ($docslog{$id}{'logentry'}{'parameter_action_'.$parameter}) {
 # FIXME: internationalization seems wrong here
@@ -1327,7 +1331,7 @@
             }
             $pasteitems .= '<label><input type="checkbox" name="pasting" id="pasting_'.$suffix.'" value="'.$suffix.'" '.$onclick.'/>'.$buffer.'</label>';
             if ($nopaste) {
-                 $pasteitems .= $nopaste;   
+                 $pasteitems .= ' <span class="LC_cusr_emph">'.$nopaste.'</span>';   
             } else {
                 if ($othercrs) {
                     $pasteitems .= $othercrs;
@@ -2563,6 +2567,15 @@
             $storefn =~ s/^((?:default|supplemental)_)(\d+)/$1$newsubdir{$key}/;
         }
         my $mapcontent = &Apache::lonnet::getfile($key);
+        if (($mapcontent eq '-1') && ($before{'map'} eq 'supplemental') &&
+            ($after{'map'} eq 'default') &&
+            ($key =~ m{^/uploaded/$match_domain/$match_courseid/supplemental_\d+\.sequence$})) {
+            $mapcontent = '<map>'."\n".
+                          '<resource id="1" src="" type="start" />'."\n".
+                          '<link from="1" to="2" index="1" />'."\n".
+                          '<resource id="2" src="" type="finish" />'."\n".
+                          '</map>';
+        }
         if ($mapcontent eq '-1') {
             if (ref($errors) eq 'HASH') {
                 $errors->{$key} = 1;
@@ -3427,7 +3440,7 @@
     return unless (ref($listsref) eq 'HASH');
     my $disabled;
     unless ($canedit) {
-        $disabled = 'disabled="disabled"';
+        $disabled = ' disabled="disabled"';
     }
     my $output =
     '<form action="/adm/coursedocs" method="post" name="togglemult'.$caller.'">'.
@@ -3704,7 +3717,7 @@
     my $line=&Apache::loncommon::start_data_table_row();
     my ($form_start,$form_end,$form_common,$form_param);
 # Edit commands
-    my ($esc_path, $path, $symb);
+    my ($esc_path, $path, $symb, $shownsymb);
     if ($env{'form.folderpath'}) {
 	$esc_path=&escape($env{'form.folderpath'});
 	$path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
@@ -3969,7 +3982,7 @@
                 }
 	    }
             if (&Apache::lonnet::symbverify($symb,$url)) {
-                my $shownsymb = $symb;
+                $shownsymb = $symb;
                 if ($isexternal) {
                     $url =~ s/\#[^#]+$//;
                     if ($container eq 'page') {
@@ -4004,7 +4017,7 @@
                     }
                 }
                 if ($checkencrypt) {
-                    my $shownsymb = &Apache::lonenc::encrypted($symb);
+                    $shownsymb = &Apache::lonenc::encrypted($symb);
                     my $shownurl = &Apache::lonenc::encrypted($url);
                     if (&Apache::lonnet::symbverify($shownsymb,$shownurl)) {
                         $url = $shownurl.(($shownurl=~/\?/)?'&':'?').'symb='.&escape($shownsymb);
@@ -4167,7 +4180,7 @@
                     &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,
                                                             $switchserver,
                                                             $forceedit,
-                                                            undef,$symb,
+                                                            undef,$symb,$shownsymb,
                                                             &escape($env{'form.folderpath'}),
                                                             $renametitle,$hostname,
                                                             '','',1,$suppanchor);
@@ -4246,7 +4259,7 @@
         }
         if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) {
             $hidtext = ' checked="checked"';
-            if (($ishash) && (ref($filtersref->{'randomorder'}) eq 'ARRAY')) {
+            if (($ishash) && (ref($filtersref->{'hiddenresource'}) eq 'ARRAY')) {
                 push(@{$filtersref->{'hiddenresource'}},$orderidx);
             }
         }
@@ -5579,10 +5592,7 @@
 	my $fileupload=(<<FIUP);
         $quotainfo
 	$lt{'file'}:<br />
-	<input type="file" name="uploaddoc" class="LC_flUpload" size="40" $disabled />
-        <input type="hidden" id="LC_free_space" value="$free_space" />
 FIUP
-
 	my $checkbox=(<<CHBO);
 	<!-- <label>$lt{'parse'}?
 	<input type="checkbox" name="parserflag" />
@@ -5602,6 +5612,8 @@
         <fieldset id="uploadimsform" style="display: none;">
         <legend>$lt{'imsf'}</legend>
         $fileupload
+        <input type="file" name="uploaddoc" id="uploaddocims" class="LC_flUpload LC_uploaddoc" size="40" $disabled />
+        <input type="hidden" id="LC_free_space_ims" value="$free_space" />
         <br />
         <p>
         $lt{'cms'}:  
@@ -5628,6 +5640,8 @@
         <legend>$lt{'upfi'}</legend>
 	<input type="hidden" name="active" value="aa" />
 	$fileupload
+        <input type="file" name="uploaddoc" class="LC_flUpload" size="40" $disabled />
+        <input type="hidden" id="LC_free_space" value="$free_space" />
 	<br />
 	$lt{'title'}:<br />
 	<input type="text" size="60" name="comment" $disabled />
@@ -6022,6 +6036,8 @@
         <legend>$lt{'upfi'}</legend>
 	<input type="hidden" name="active" value="ee" />	
 	$fileupload
+        <input type="file" name="uploaddoc" id="uploaddocsupp" class="LC_flUpload LC_uploaddoc" size="40" $disabled />
+        <input type="hidden" id="LC_free_space_supp" value="$free_space" />
 	<br />
 	<br />
 	<span class="LC_nobreak">
@@ -6034,6 +6050,7 @@
 	$pathitem
 	<input type="hidden" name="cmd" value="upload_supplemental" />
         <input type='submit' value="$lt{'upld'}" />
+        </fieldset>
         </form>
 SUPDOCFORM
 




More information about the LON-CAPA-cvs mailing list