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

bisitz bisitz at source.lon-capa.org
Mon Jul 15 13:00:19 EDT 2013


bisitz		Mon Jul 15 17:00:19 2013 EDT

  Modified files:              
    /loncom/interface	lonviewclasslist.pm 
  Log:
  - Improved and consistent layout:
      - confirm_success
      - headlines
      - fieldset for settings
  - Exclude HTML from translation phrases
  - XHTML: action attribute in <form> required
  
  
Index: loncom/interface/lonviewclasslist.pm
diff -u loncom/interface/lonviewclasslist.pm:1.14 loncom/interface/lonviewclasslist.pm:1.15
--- loncom/interface/lonviewclasslist.pm:1.14	Mon Dec 31 14:29:08 2012
+++ loncom/interface/lonviewclasslist.pm	Mon Jul 15 17:00:19 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to display the classlist 
 #
-# $Id: lonviewclasslist.pm,v 1.14 2012/12/31 14:29:08 raeburn Exp $
+# $Id: lonviewclasslist.pm,v 1.15 2013/07/15 17:00:19 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -246,7 +246,7 @@
     if ($env{'form.action'} eq 'setenv') {
         $Str .= &process_student_prefs();
     }
-    $Str .= '<h3>'.&mt('Student-viewable course roster').'</h3>';
+    $Str .= '<h2>'.&mt('Student-viewable course roster').'</h2>';
 
     $cid = $env{'request.course.id'};
     $cdom = $env{'course.'.$cid.'.domain'};
@@ -254,16 +254,16 @@
 
     if ($viewsettings->{'limit_to_section'}) {
         if ($env{'request.course.sec'} eq '') {
-            $title = '<h4>'.&mt('Students with no section').'</h4>';
+            $title = '<h3>'.&mt('Students with no section').'</h3>';
             $listtype = 'without a section';
         } else {
-            $title ='<h4>'.&mt('Students in section "[_1]"',
-                               $env{'request.course.sec'}).'</h4>';
+            $title ='<h3>'.&mt('Students in section "[_1]"',
+                               $env{'request.course.sec'}).'</h3>';
             $listtype = 'in the section';
             $secdisplay = " ($env{'request.course.sec'}) ";
         }
     } else {
-        $title .= '<h4>'.&mt('Students in any section').'</h4>';
+        $title .= '<h3>'.&mt('Students in any section').'</h3>';
         $listtype = 'in the course';
     }
 
@@ -410,19 +410,22 @@
         $showoff = ' checked="checked" ';
         $showon = ' ';
     }
-    my $output = '<hr /><h4>'.&mt('Your roster setting').'</h4>';
+    my $output =
+        '<div class="LC_left_float">'
+       .'<fieldset><legend>'.&mt('Your roster setting').'</legend>';
     if ($showinroster) {
         $output .= &mt('You are currently listed in the student-viewable roster.');
     } else {
-        $output .=  &mt('You are currently <b>not</b> listed in the student-viewable roster.');
+        $output .=  &mt('You are currently [_1]not[_2] listed in the student-viewable roster.','<b>','</b>');
     }
     $output .= '<br />'.&mt('Include yourself in the roster?').'  '.
-        '<form name="studentparm" method="post">'.
+        '<form name="studentparm" method="post" action="">'.
         '<span class="LC_nobreak"><label><input type="radio" name="showinroster" value="1"'.$showon.'/>'.&mt('Yes').'</label>  <label>'.
         '<input type="radio" name="showinroster" value="0"'.$showoff.'/>'.&mt('No').
         '</label></span><br /><br />'.
         '<input type="hidden" name="action" value="setenv" />'.
-        '<input type="submit" name="studentsubmit" value="'.&mt('Save').'" /></form><hr />';
+        '<input type="submit" name="studentsubmit" value="'.&mt('Save').'" />'.
+        '</form></fieldset></div><br clear="all" />';
     return $output;
 }
 
@@ -454,16 +457,25 @@
             &Apache::lonnet::appenv(\%changeHash);
             my $result = &Apache::lonnet::put('publicroster',{$student => $showinroster,},$cdom,$cnum);
             if ($result eq 'ok') {
-                $output .= &mt('Display of your name in the student-viewable roster set to <b>[_1]</b>.',$visibility);
+                $output .=
+                    &Apache::lonhtmlcommon::confirm_success(
+                        &mt('Display of your name in the student-viewable roster set to [_1].','<b>'.$visibility.'</b>'));
             } else {
-                $output .= '<span class="LC_error">'.&mt('Error occurred saving display setting.').'</span>';
+                $output .=
+                    &Apache::lonhtmlcommon::confirm_success(
+                        &mt('Error occurred saving display setting.'),1);
             }
         } else {
-            $output .= '<span class="LC_error">'.&mt('Error occurred saving display setting.').'</span>';
+            $output .=
+                &Apache::lonhtmlcommon::confirm_success(
+                    &mt('Error occurred saving display setting.'),1);
         }
     } else {
-        $output .= &mt('Display of your name in the student-viewable roster unchanged (set to <b>[_1]</b>).',$visibility);
+        $output .=
+            &Apache::lonhtmlcommon::confirm_success(
+                &mt('Display of your name in the student-viewable roster unchanged (set to [_1]).','<b>'.$visibility.'</b>'));
     }
+    $output = &Apache::loncommon::confirmwrapper($output);
     return $output;
 }
 




More information about the LON-CAPA-cvs mailing list