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

raeburn raeburn@source.lon-capa.org
Fri, 30 Oct 2009 19:50:24 -0000


raeburn		Fri Oct 30 19:50:24 2009 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - &generate_edit_table() 
    - eliminate unused arg, and setting of unused variable.
      In rev 1.382 onwards, second arg ($varcd) is no longer used in the routine.
    - check $orderhash_ref really is a ref to a HASH.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.405 loncom/interface/londocs.pm:1.406
--- loncom/interface/londocs.pm:1.405	Tue Oct 27 09:19:52 2009
+++ loncom/interface/londocs.pm	Fri Oct 30 19:50:24 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.405 2009/10/27 09:19:52 bisitz Exp $
+# $Id: londocs.pm,v 1.406 2009/10/30 19:50:24 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3275,7 +3275,6 @@
 		'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
                 );
 my $tid='1';
-my $varcd = 'Main Course Documents';
  $hadchanges=0;
         my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
        if ($error) {
@@ -3286,7 +3285,7 @@
        }
 
        &changewarning($r,'');
-$r->print(&generate_edit_table($tid,$varcd,\%orderhash));
+$r->print(&generate_edit_table($tid,\%orderhash));
 
 $r->print('</div>');
 	}
@@ -3395,8 +3394,7 @@
             $r->print('<p><span class="LC_error">'.$error.'</span></p>');
         }
         my $tid='2';
-        my $varscd = 'Supplemental Course Documents';
-        $r->print(&generate_edit_table($tid,$varscd,\%suporderhash));
+        $r->print(&generate_edit_table($tid,\%suporderhash));
     } else {
         my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
         if ($error) {
@@ -3461,7 +3459,8 @@
 
 
 sub generate_edit_table {
-    my ($tid,$varcd,$orderhash_ref) = @_;
+    my ($tid,$orderhash_ref) = @_;
+    return unless(ref($orderhash_ref) eq 'HASH');
     my %orderhash = %{$orderhash_ref};
     my $form;
     my $activetab;