Diff for /loncom/interface/lonhelper.pm between versions 1.58 and 1.59

version 1.58, 2003/10/09 18:24:32 version 1.59, 2003/10/09 19:07:33
Line 1291  sub postprocess { Line 1291  sub postprocess {
     my $chosenValue = $ENV{'form.' . $self->{'variable'} . '.forminput'};      my $chosenValue = $ENV{'form.' . $self->{'variable'} . '.forminput'};
   
     if (!defined($chosenValue) && !$self->{'allowempty'}) {      if (!defined($chosenValue) && !$self->{'allowempty'}) {
         $self->{ERROR_MSG} = "You must choose one or more choices to" .          $self->{ERROR_MSG} = 
             " continue.";      &mt("You must choose one or more choices to continue.");
         return 0;          return 0;
     }      }
   
Line 1595  sub render { Line 1595  sub render {
   
     # Display Hours and Minutes if they are called for      # Display Hours and Minutes if they are called for
     if ($self->{'hoursminutes'}) {      if ($self->{'hoursminutes'}) {
    # This needs parameterization for times.
    my $am = &mt('a.m.');
    my $pm = &mt('p.m.');
         # Build hour          # Build hour
         $result .= "<select name='${var}hour'>\n";          $result .= "<select name='${var}hour'>\n";
         $result .= "<option " . ($date->hour == 0 ? 'selected ':'') .          $result .= "<option " . ($date->hour == 0 ? 'selected ':'') .
             " value='0'>midnight</option>\n";              " value='0'>" . &mt('midnight') . "</option>\n";
         for ($i = 1; $i < 12; $i++) {          for ($i = 1; $i < 12; $i++) {
             if ($date->hour == $i) {              if ($date->hour == $i) {
                 $result .= "<option selected value='$i'>$i a.m.</option>\n";                  $result .= "<option selected value='$i'>$i $am</option>\n";
             } else {              } else {
                 $result .= "<option value='$i'>$i a.m</option>\n";                  $result .= "<option value='$i'>$i $am</option>\n";
             }              }
         }          }
         $result .= "<option " . ($date->hour == 12 ? 'selected ':'') .          $result .= "<option " . ($date->hour == 12 ? 'selected ':'') .
             " value='12'>noon</option>\n";              " value='12'>" . &mt('noon') . "</option>\n";
         for ($i = 13; $i < 24; $i++) {          for ($i = 13; $i < 24; $i++) {
             my $printedHour = $i - 12;              my $printedHour = $i - 12;
             if ($date->hour == $i) {              if ($date->hour == $i) {
                 $result .= "<option selected value='$i'>$printedHour p.m.</option>\n";                  $result .= "<option selected value='$i'>$printedHour $pm</option>\n";
             } else {              } else {
                 $result .= "<option value='$i'>$printedHour p.m.</option>\n";                  $result .= "<option value='$i'>$printedHour $pm</option>\n";
             }              }
         }          }
   
Line 2024  shown. Defaults to false. Line 2027  shown. Defaults to false.
 no strict;  no strict;
 @ISA = ("Apache::lonhelper::element");  @ISA = ("Apache::lonhelper::element");
 use strict;  use strict;
   use Apache::lonlocal;
   
   
 BEGIN {  BEGIN {
Line 2098  sub render { Line 2101  sub render {
     }      }
 </script>  </script>
 SCRIPT  SCRIPT
   
           my $selectAllStudents = &mt('Select All Students'); 
    my $unselectAllStudents = &mt('Unselect All Students');
         $buttons = <<BUTTONS;          $buttons = <<BUTTONS;
 <br />  <br />
 <input type="button" onclick="checkactive()" value="Select Only Current Students" />  <input type="button" onclick="checkactive()" value="Select Only Current Students" />
 <input type="button" onclick="checkall(true, '$var')" value="Select All Students" />  <input type="button" onclick="checkall(true, '$var')" value="$selectAllStudents" />
 <input type="button" onclick="checkall(false, '$var')" value="Unselect All Students" />  <input type="button" onclick="checkall(false, '$var')" value="$unselectAllStudents" />
 <input type="button" onclick="checksec(true)" value="Select for Section/Group">  <input type="button" onclick="checksec(true)" value="Select for Section/Group">
 <input type="text" size="5" name="chksec">&nbsp;  <input type="text" size="5" name="chksec">&nbsp;
 <input type="button" onclick="checksec(false)" value="Unselect for Section/Group">  <input type="button" onclick="checksec(false)" value="Unselect for Section/Group">
Line 2164  BUTTONS Line 2170  BUTTONS
  }   }
     }      }
   
     my $name = $self->{'coursepersonnel'} ? 'Name' : 'Student Name';      my $name = &mt($self->{'coursepersonnel'} ? 'Name' : 'Student Name');
     my $type = 'radio';      my $type = 'radio';
     if ($self->{'multichoice'}) { $type = 'checkbox'; }      if ($self->{'multichoice'}) { $type = 'checkbox'; }
     $result .= "<table cellspacing='2' cellpadding='2' border='0'>\n";      $result .= "<table cellspacing='2' cellpadding='2' border='0'>\n";
     $result .= "<tr><td></td><td align='center'><b>$name</b></td>".      $result .= "<tr><td></td><td align='center'><b>$name</b></td>".
         "<td align='center'><b>Section</b></td>" .           "<td align='center'><b>" . &mt('Section') . "</b></td>" . 
  "<td align='center'><b>Status</b></td>" .    "<td align='center'><b>Status</b></td>" . 
  "<td align='center'><b>Role</b></td>" .   "<td align='center'><b>" . &mt("Role") . "</b></td></tr>";
  "<td align='center'><b>Username:Domain</b></td></tr>";   "<td align='center'><b>Username:Domain</b></td></tr>";
   
     my $checked = 0;      my $checked = 0;
Line 2209  sub postprocess { Line 2215  sub postprocess {
   
     my $result = $ENV{'form.' . $self->{'variable'} . '.forminput'};      my $result = $ENV{'form.' . $self->{'variable'} . '.forminput'};
     if (!$result) {      if (!$result) {
         $self->{ERROR_MSG} = 'You must choose at least one student '.          $self->{ERROR_MSG} = 
             'to continue.';      &mt('You must choose at least one student to continue.');
         return 0;          return 0;
     }      }
   
Line 2276  viewing the files. Line 2282  viewing the files.
 no strict;  no strict;
 @ISA = ("Apache::lonhelper::element");  @ISA = ("Apache::lonhelper::element");
 use strict;  use strict;
   use Apache::lonlocal;
   
 use Apache::lonpubdir; # for getTitleString  use Apache::lonpubdir; # for getTitleString
   
Line 2394  sub render { Line 2401  sub render {
     }      }
 </script>  </script>
 SCRIPT  SCRIPT
           my $selectAllFiles = &mt("Select All Files");
    my $unselectAllFiles = &mt("Unselect All Files");
         $buttons = <<BUTTONS;          $buttons = <<BUTTONS;
 <br /> &nbsp;  <br /> &nbsp;
 <input type="button" onclick="checkall(true, '$var')" value="Select All Files" />  <input type="button" onclick="checkall(true, '$var')" value="$selectAllFiles" />
 <input type="button" onclick="checkall(false, '$var')" value="Unselect All Files" />  <input type="button" onclick="checkall(false, '$var')" value="$unselectAllFiles" />
 BUTTONS  BUTTONS
   
           my $selectAllPublished = &mt("Select All Published");
    my $unselectAllPublished= &mt("UnselectAllPublished");
         if ($helper->{VARS}->{'construction'}) {          if ($helper->{VARS}->{'construction'}) {
             $buttons .= <<BUTTONS;              $buttons .= <<BUTTONS;
 <input type="button" onclick="checkallclass(true, 'Published')" value="Select All Published" />  <input type="button" onclick="checkallclass(true, 'Published')" value="$selectAllPublished" />
 <input type="button" onclick="checkallclass(false, 'Published')" value="Unselect All Published" />  <input type="button" onclick="checkallclass(false, 'Published')" value="$unselectAllPublished" />
 <br /> &nbsp;  <br /> &nbsp;
 BUTTONS  BUTTONS
        }         }
Line 2979  sub render { Line 2990  sub render {
  }   }
   
  if (!@results) {   if (!@results) {
     $result .= '    <li>No changes were made to current settings.</li>';      $result .= '    <li>' . 
    &mt('No changes were made to current settings.') . '</li>';
  }   }
   
  $result .= '</ul>';   $result .= '</ul>';
Line 2990  sub render { Line 3002  sub render {
  if ($ENV{'course.'.$ENV{'request.course.id'}.'.clonedfrom'}) {   if ($ENV{'course.'.$ENV{'request.course.id'}.'.clonedfrom'}) {
     $targetURL = '/adm/parmset?overview=1';      $targetURL = '/adm/parmset?overview=1';
  }   }
    my $previous = HTML::Entities::encode(&mt("<- Previous"), '<>&"');
    my $next = HTML::Entities::encode(&mt("Next ->"), '<>&"');
         $result .= "<center>\n" .          $result .= "<center>\n" .
             "<form action='/adm/roles' method='post' target='loncapaclient'>\n" .              "<form action='/adm/roles' method='post' target='loncapaclient'>\n" .
             "<input type='button' onclick='history.go(-1)' value='&lt;- Previous' />" .              "<input type='button' onclick='history.go(-1)' value='$previous' />" .
             "<input type='hidden' name='orgurl' value='$targetURL' />" .              "<input type='hidden' name='orgurl' value='$targetURL' />" .
             "<input type='hidden' name='selectrole' value='1' />\n" .              "<input type='hidden' name='selectrole' value='1' />\n" .
             "<input type='hidden' name='" . $ENV{'request.role'} .               "<input type='hidden' name='" . $ENV{'request.role'} . 
             "' value='1' />\n<input type='submit' value='Finish Course Initialization' />\n" .              "' value='1' />\n<input type='submit' value='" .
       &mt('Finish Course Initialization') . " />\n" .
             "</form></center>";              "</form></center>";
     }      }
   

Removed from v.1.58  
changed lines
  Added in v.1.59


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>