--- loncom/interface/lonfeedback.pm	2005/04/07 06:56:23	1.157
+++ loncom/interface/lonfeedback.pm	2005/04/11 15:33:46	1.162
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.157 2005/04/07 06:56:23 albertel Exp $
+# $Id: lonfeedback.pm,v 1.162 2005/04/11 15:33:46 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2686,28 +2686,15 @@ END
 
 sub process_attachments {
     my ($currnewattach,$currdelold,$keepold) = @_;
-    if (exists($env{'form.currnewattach'})) {
-        if (ref($env{'form.currnewattach'}) eq 'ARRAY') {
-            @{$currnewattach} = @{$env{'form.currnewattach'}};
-        } else {
-            $$currnewattach[0] = $env{'form.currnewattach'};
-        }
-    }
-    if (exists($env{'form.deloldattach'})) {
-        if (ref($env{'form.deloldattach'}) eq 'ARRAY') {
-            @{$currdelold} = @{$env{'form.deloldattach'}};
-        } else {
-            $$currdelold[0] = $env{'form.deloldattach'};
-        }
-    }
+
+    @{$currnewattach}=
+	&Apache::loncommon::get_env_multiple('form.currnewattach');
+    @{$currdelold}=
+	&Apache::loncommon::get_env_multiple('form.deloldattach');
     if (exists($env{'form.delnewattach'})) {
-        my @currdelnew = ();
+        my @currdelnew =
+	    &Apache::loncommon::get_env_multiple('form.delnewattach');
         my @currnew = ();
-        if (ref($env{'form.delnewattach'}) eq 'ARRAY') {
-            @currdelnew = @{$env{'form.delnewattach'}};
-        } else {
-            $currdelnew[0] = $env{'form.delnewattach'};
-        }
         foreach my $newone (@{$currnewattach}) {
             my $delflag = 0;
             foreach (@currdelnew) {
@@ -2722,13 +2709,7 @@ sub process_attachments {
         }
         @{$currnewattach} = @currnew;
     }
-    if (exists($env{'form.keepold'})) {
-        if (ref($env{'form.keepold'}) eq 'ARRAY') {
-            @{$keepold} = @{$env{'form.keepold'}};
-        } else {
-            $$keepold[0] = $env{'form.keepold'};
-        }
-    }
+    @{$keepold} = &Apache::loncommon::get_env_multiple('form.keepold');
 }
 
 sub generate_attachments_button {
@@ -2885,12 +2866,7 @@ sub has_discussion {
     my @allres=$navmap->retrieveResources();
     foreach my $resource (@allres) {
         if ($resource->hasDiscussion()) {
-            my $ressymb;
-            if ($resource->symb() =~ m-(___adm/\w+/\w+)/(\d+)/bulletinboard$-) {
-                $ressymb = 'bulletin___'.$2.$1.'/'.$2.'/bulletinboard';
-            } else {
-                $ressymb = $resource->symb();
-            }
+            my $ressymb = $resource->wrap_symb();
             push @{$resourcesref}, $ressymb;
         }
     }
@@ -3049,14 +3025,8 @@ END
           'twnp' => 'There are currently no resources or bulletin boards with unread discussion postings.'
       );       
       foreach (@resources) {
-# backward compatibility (bulletin boards used to be 'wrapped')
           my $ressymb=$_;
 	  &Apache::lonenc::check_decrypt(\$ressymb);
-          if ($ressymb =~ m/bulletin___\d+___/) {
-              unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
-                  $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper/|;
-              }
-          }
           my $lastkey = $ressymb.'_lastread';
           $discinfo{$lastkey} = $env{'form.navtime'};
       }
@@ -3277,9 +3247,7 @@ ENDREDIR
 	  unless ($symb) { $goahead=0; }
       }
       # backward compatibility (bulletin boards used to be 'wrapped')
-      if ($feedurl=~m|^/adm/wrapper/adm/.*/bulletinboard$|) {
-	  $feedurl=~s|^/adm/wrapper||;
-      }
+      &dewrapper(\$feedurl);
       if (!$goahead) {
           # Ambiguous Problem Resource
 	  $r->internal_redirect('/adm/ambiguous');