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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Fri, 21 Dec 2007 21:02:16 -0000


raeburn		Fri Dec 21 16:02:16 2007 EDT

  Modified files:              
    /loncom/interface	loncreateuser.pm 
  Log:
  - In &course_level_row() rename scalar where output is accumulated $row
  - Add some linefeeds to make the HTML course easier to read
  - return $row 
  
  
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.221 loncom/interface/loncreateuser.pm:1.222
--- loncom/interface/loncreateuser.pm:1.221	Fri Dec 21 15:34:26 2007
+++ loncom/interface/loncreateuser.pm	Fri Dec 21 16:02:10 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.221 2007/12/21 20:34:26 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.222 2007/12/21 21:02:10 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3561,48 +3561,49 @@
 
 sub course_level_row {
     my ($protectedcourse,$role,$area,$domain,$plrole,$sections_count,$lt) = @_;
-    my $table = &Apache::loncommon::start_data_table_row().
-                ' <td><input type="checkbox" name="act_'.
-                $protectedcourse.'_'.$role.'" /></td>'."\n".
-                ' <td>'.$plrole.'</td>'."\n".
-                '<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n";
+    my $row = &Apache::loncommon::start_data_table_row().
+              ' <td><input type="checkbox" name="act_'.
+              $protectedcourse.'_'.$role.'" /></td>'."\n".
+              ' <td>'.$plrole.'</td>'."\n".
+              ' <td>'.$area.'<br />Domain: '.$domain.'</td>'."\n";
     if ($role eq 'cc') {
-        $table .= '<td>&nbsp</td>';
+        $row .= '<td>&nbsp;</td>';
     } elsif ($env{'request.course.sec'} ne '') {
-        $table .= ' <td><input type="hidden" value="'.
-                  $env{'request.course.sec'}.'" '.
-                  'name="sec_'.$protectedcourse.'_'.$role.'" />'.
-                  $env{'request.course.sec'}.'</td>';
+        $row .= ' <td><input type="hidden" value="'.
+                $env{'request.course.sec'}.'" '.
+                'name="sec_'.$protectedcourse.'_'.$role.'" />'.
+                $env{'request.course.sec'}.'</td>';
     } else {
         if (ref($sections_count) eq 'HASH') {
             my $currsec = 
                 &Apache::lonuserutils::course_sections($sections_count,
                                                        $protectedcourse.'_'.$role);
-            $table .= '<td><table class="LC_createuser">'.
-                      '<tr class="LC_section_row">
-                        <td valign="top">'.$lt->{'exs'}.'<br />'.
-                        $currsec.'</td>
-                        <td>&nbsp;&nbsp;</td>
-                        <td valign="top">&nbsp;'.$lt->{'new'}.'<br />'.
+            $row .= '<td><table class="LC_createuser">'."\n".
+                    '<tr class="LC_section_row">'."\n".
+                    ' <td valign="top">'.$lt->{'exs'}.'<br />'.
+                       $currsec.'</td>'."\n".
+                     ' <td>&nbsp;&nbsp;</td>'."\n".
+                     ' <td valign="top">&nbsp;'.$lt->{'new'}.'<br />'.
                      '<input type="text" name="newsec_'.$protectedcourse.'_'.$role.
                      '" value="" />'.
                      '<input type="hidden" '.
                      'name="sec_'.$protectedcourse.'_'.$role.'" /></td>'."\n".
-                     '</tr></table></td>';
+                     '</tr></table></td>'."\n";
         } else {
-            $table .= '<td><input type="text" size="10" '.
-                      'name="sec_'.$protectedcourse.'_'.$role.'" /></td>';
+            $row .= '<td><input type="text" size="10" '.
+                      'name="sec_'.$protectedcourse.'_'.$role.'" /></td>'."\n";
         }
     }
-    $table .= <<ENDTIMEENTRY;
-<td><input type="hidden" name="start_$protectedcourse\_$role" value='' />
+    $row .= <<ENDTIMEENTRY;
+<td><input type="hidden" name="start_$protectedcourse\_$role" value="" />
 <a href=
 "javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$role.value,'start_$protectedcourse\_$role','cu.pres','dateset')">$lt->{'ssd'}</a></td>
-<td><input type="hidden" name="end_$protectedcourse\_$role" value='' />
+<td><input type="hidden" name="end_$protectedcourse\_$role" value="" />
 <a href=
 "javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$role.value,'end_$protectedcourse\_$role','cu.pres','dateset')">$lt->{'sed'}</a></td>
 ENDTIMEENTRY
-    $table.= &Apache::loncommon::end_data_table_row();
+    $row .= &Apache::loncommon::end_data_table_row();
+    return $row;
 }
 
 sub course_level_dc {