Diff for /loncom/interface/loncommon.pm between versions 1.692.4.4 and 1.721

version 1.692.4.4, 2009/08/14 03:48:49 version 1.721, 2008/12/17 12:48:20
Line 271  BEGIN { Line 271  BEGIN {
         }          }
     }      }
     &Apache::lonnet::logthis(      &Apache::lonnet::logthis(
               "<font color=yellow>INFO: Read file types</font>");               "<span style='color:yellow;'>INFO: Read file types</span>");
     $readit=1;      $readit=1;
     }  # end of unless($readit)       }  # end of unless($readit) 
           
Line 406  sub studentbrowser_javascript { Line 406  sub studentbrowser_javascript {
          || ($env{'request.role'}=~/^(au|dc|su)/)           || ($env{'request.role'}=~/^(au|dc|su)/)
           ) { return ''; }              ) { return ''; }  
    return (<<'ENDSTDBRW');     return (<<'ENDSTDBRW');
 <script type="text/javascript" language="Javascript">  <script type="text/javascript" language="Javascript" >
 // <![CDATA[  
     var stdeditbrowser;      var stdeditbrowser;
     function openstdbrowser(formname,uname,udom,roleflag,ignorefilter,courseadvonly) {      function openstdbrowser(formname,uname,udom,roleflag,ignorefilter) {
         var url = '/adm/pickstudent?';          var url = '/adm/pickstudent?';
         var filter;          var filter;
  if (!ignorefilter) {   if (!ignorefilter) {
Line 423  sub studentbrowser_javascript { Line 422  sub studentbrowser_javascript {
         url += 'form=' + formname + '&unameelement='+uname+          url += 'form=' + formname + '&unameelement='+uname+
                                     '&udomelement='+udom;                                      '&udomelement='+udom;
  if (roleflag) { url+="&roles=1"; }   if (roleflag) { url+="&roles=1"; }
         if (courseadvonly) { url+="&courseadvonly=1"; }  
         var title = 'Student_Browser';          var title = 'Student_Browser';
         var options = 'scrollbars=1,resizable=1,menubar=0';          var options = 'scrollbars=1,resizable=1,menubar=0';
         options += ',width=700,height=600';          options += ',width=700,height=600';
         stdeditbrowser = open(url,title,options,'1');          stdeditbrowser = open(url,title,options,'1');
         stdeditbrowser.focus();          stdeditbrowser.focus();
     }      }
 // ]]>  
 </script>  </script>
 ENDSTDBRW  ENDSTDBRW
 }  }
   
 sub selectstudent_link {  sub selectstudent_link {
    my ($form,$unameele,$udomele,$courseadvonly)=@_;     my ($form,$unameele,$udomele)=@_;
    my $callargs = "'".$form."','".$unameele."','".$udomele."'";  
    if ($env{'request.course.id'}) {       if ($env{'request.course.id'}) {  
        if (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})         if (!&Apache::lonnet::allowed('srm',$env{'request.course.id'})
    && !&Apache::lonnet::allowed('srm',$env{'request.course.id'}.     && !&Apache::lonnet::allowed('srm',$env{'request.course.id'}.
  '/'.$env{'request.course.sec'})) {   '/'.$env{'request.course.sec'})) {
    return '';     return '';
        }         }
        if ($courseadvonly)  {         return "<a href='".'javascript:openstdbrowser("'.$form.'","'.$unameele.
            $callargs .= ",'',1,1";          '","'.$udomele.'");'."'>".&mt('Select User')."</a>";
        }  
        return '<span class="LC_nobreak">'.  
               '<a href="javascript:openstdbrowser('.$callargs.');">'.  
               &mt('Select User').'</a></span>';  
    }     }
    if ($env{'request.role'}=~/^(au|dc|su)/) {     if ($env{'request.role'}=~/^(au|dc|su)/) {
        $callargs .= ",1";         return "<a href='".'javascript:openstdbrowser("'.$form.'","'.$unameele.
        return '<span class="LC_nobreak">'.          '","'.$udomele.'",1);'."'>".&mt('Select User')."</a>";
               '<a href="javascript:openstdbrowser('.$callargs.');">'.  
               &mt('Select User').'</a></span>';  
    }     }
    return '';     return '';
 }  }
Line 463  sub selectstudent_link { Line 453  sub selectstudent_link {
 sub authorbrowser_javascript {  sub authorbrowser_javascript {
     return <<"ENDAUTHORBRW";      return <<"ENDAUTHORBRW";
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  
 var stdeditbrowser;  var stdeditbrowser;
   
 function openauthorbrowser(formname,udom) {  function openauthorbrowser(formname,udom) {
Line 475  function openauthorbrowser(formname,udom Line 464  function openauthorbrowser(formname,udom
     stdeditbrowser = open(url,title,options,'1');      stdeditbrowser = open(url,title,options,'1');
     stdeditbrowser.focus();      stdeditbrowser.focus();
 }  }
 // ]]>  
 </script>  </script>
 ENDAUTHORBRW  ENDAUTHORBRW
 }  }
Line 484  sub coursebrowser_javascript { Line 473  sub coursebrowser_javascript {
     my ($domainfilter,$sec_element,$formname)=@_;      my ($domainfilter,$sec_element,$formname)=@_;
     my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role');      my $crs_or_grp_alert = &mt('Please select the type of LON-CAPA entity - Course or Group - for which you wish to add/modify a user role');
    my $output = '     my $output = '
 <script type="text/javascript" language="JavaScript">  <script type="text/javascript">
 // <![CDATA[  
     var stdeditbrowser;'."\n";      var stdeditbrowser;'."\n";
    $output .= <<"ENDSTDBRW";     $output .= <<"ENDSTDBRW";
     function opencrsbrowser(formname,uname,udom,desc,extra_element,multflag,crstype) {      function opencrsbrowser(formname,uname,udom,desc,extra_element,multflag,crstype) {
Line 568  ENDSTDBRW Line 556  ENDSTDBRW
         $output .= &setsec_javascript($sec_element,$formname);          $output .= &setsec_javascript($sec_element,$formname);
     }      }
     $output .= '      $output .= '
 // ]]>  
 </script>';  </script>';
     return $output;      return $output;
 }  }
Line 615  function setSect(sectionlist) { Line 602  function setSect(sectionlist) {
   
 sub selectcourse_link {  sub selectcourse_link {
    my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;     my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;
    return '<span class="LC_nobreak">'     return "<a href='".'javascript:opencrsbrowser("'.$form.'","'.$unameele.
          ."<a href='"          '","'.$udomele.'","'.$desc.'","'.$extra_element.'","'.$multflag.'","'.$selecttype.'");'."'>".&mt('Select Course')."</a>";
          .'javascript:opencrsbrowser("'.$form.'","'.$unameele  
          .'","'.$udomele.'","'.$desc.'","'.$extra_element  
          .'","'.$multflag.'","'.$selecttype.'");'  
          ."'>".&mt('Select Course').'</a>'  
          .'</span>';  
 }  }
   
 sub selectauthor_link {  sub selectauthor_link {
Line 728  sub select_datelocale { Line 710  sub select_datelocale {
     return $output;      return $output;
 }  }
   
 sub select_language {  
     my ($name,$selected,$includeempty) = @_;  
     my %langchoices;  
     if ($includeempty) {  
         %langchoices = ('' => 'No language preference');  
     }  
     foreach my $id (&languageids()) {  
         my $code = &supportedlanguagecode($id);  
         if ($code) {  
             $langchoices{$code} = &plainlanguagedescription($id);  
         }  
     }  
     return &select_form($selected,$name,%langchoices);  
 }  
   
 =pod  =pod
   
 =item * &linked_select_forms(...)  =item * &linked_select_forms(...)
Line 829  sub linked_select_forms { Line 796  sub linked_select_forms {
     my $first = "document.$formname.$firstselectname";      my $first = "document.$formname.$firstselectname";
     # output the javascript to do the changing      # output the javascript to do the changing
     my $result = '';      my $result = '';
     $result.='<script type="text/javascript" language="JavaScript">'."\n";      $result.="<script type=\"text/javascript\">\n";
     $result.="// <![CDATA[\n";  
     $result.="var select2data = new Object();\n";      $result.="var select2data = new Object();\n";
     $" = '","';      $" = '","';
     my $debug = '';      my $debug = '';
Line 876  function select1_changed() { Line 842  function select1_changed() {
         }          }
     }      }
 }  }
 // ]]>  
 </script>  </script>
 END  END
     # output the initial values for the selection lists      # output the initial values for the selection lists
Line 961  sub help_open_topic { Line 926  sub help_open_topic {
     if ($text ne "") {      if ($text ne "") {
  $template .=    $template .= 
             "<table bgcolor='#3333AA' cellspacing='1' cellpadding='1' border='0'><tr>".              "<table bgcolor='#3333AA' cellspacing='1' cellpadding='1' border='0'><tr>".
             "<td bgcolor='#5555FF'><span class=\"LC_nobreak\"><a target=\"_top\" href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>";              "<td bgcolor='#5555FF'><a target=\"_top\" href=\"$link\"><span style=\"color:#FFFFFF;font-size:10pt;\">$text</span></a>";
     }      }
   
     # Add the graphic      # Add the graphic
     my $title = &mt('Online Help');      my $title = &mt('Online Help');
     my $helpicon=&lonhttpdurl("/adm/help/help.png");      my $helpicon=&lonhttpdurl("/adm/help/help.png");
     $template .= '<a target="_top" href="'.$link.'" title="'.$title.'">'.      $template .= <<"ENDTEMPLATE";
                  '<img src="'.$helpicon.'" border="0" alt="'.&mt('Help: [_1]',$topic).   <a target="_top" href="$link" title="$title"><img src="$helpicon" border="0" alt="(Help: $topic)" /></a>
                  '" title="'.$title.'" /></a>';  ENDTEMPLATE
     if ($text ne '') {      if ($text ne '') { $template.='</td></tr></table>' };
         $template.='</span></td></tr></table>';  
     }  
     return $template;      return $template;
   
 }  }
Line 980  sub help_open_topic { Line 943  sub help_open_topic {
 # This is a quicky function for Latex cheatsheet editing, since it   # This is a quicky function for Latex cheatsheet editing, since it 
 # appears in at least four places  # appears in at least four places
 sub helpLatexCheatsheet {  sub helpLatexCheatsheet {
     my ($topic,$text,$not_author) = @_;      my $other = shift;
     my $out;  
     my $addOther = '';      my $addOther = '';
     if ($topic) {      if ($other) {
  $addOther = &Apache::loncommon::help_open_topic($topic,$text,   $addOther = Apache::loncommon::help_open_topic($other, shift,
        undef, undef, 600) .         undef, undef, 600) .
    '</td><td>';     '</td><td>';
     }      }
     $out = '<table><tr><td>'.      return '<table><tr><td>'.
            $addOther .   $addOther .
            &Apache::loncommon::help_open_topic("Greek_Symbols",&mt('Greek Symbols'),   &Apache::loncommon::help_open_topic("Greek_Symbols",&mt('Greek Symbols'),
                                                undef,undef,600).      undef,undef,600)
            '</td><td>'.   .'</td><td>'.
            &Apache::loncommon::help_open_topic("Other_Symbols",&mt('Other Symbols'),   &Apache::loncommon::help_open_topic("Other_Symbols",&mt('Other Symbols'),
                                                undef,undef,600).      undef,undef,600)
            '</td>';   .'</td><td>'.
     unless ($not_author) {   &Apache::loncommon::help_open_topic("Authoring_Output_Tags",&mt('Output Tags'),
         $out .= '<td>'.                                      undef,undef,600)
                 &Apache::loncommon::help_open_topic("Authoring_Output_Tags",&mt('Output Tags'),   .'</td></tr></table>';
                                                     undef,undef,600).  
                 '</td>';  
     }  
     $out .= '</tr></table>';  
     return $out;  
 }  }
   
 sub general_help {  sub general_help {
Line 1030  sub update_help_link { Line 987  sub update_help_link {
     my $banner_link = "/adm/helpmenu?page=banner&amp;topic=$topic&amp;component_help=$component_help&amp;faq=$faq&amp;bug=$bug&amp;origurl=$origurl&amp;stamp=$timestamp&amp;stayonpage=$stayOnPage";      my $banner_link = "/adm/helpmenu?page=banner&amp;topic=$topic&amp;component_help=$component_help&amp;faq=$faq&amp;bug=$bug&amp;origurl=$origurl&amp;stamp=$timestamp&amp;stayonpage=$stayOnPage";
     my $output .= <<"ENDOUTPUT";      my $output .= <<"ENDOUTPUT";
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  
 banner_link = '$banner_link';  banner_link = '$banner_link';
 // ]]>  
 </script>  </script>
 ENDOUTPUT  ENDOUTPUT
     return $output;      return $output;
Line 1173  sub help_open_bug { Line 1128  sub help_open_bug {
     {      {
  $template .=    $template .= 
   "<table bgcolor='#AA3333' cellspacing='1' cellpadding='1' border='0'><tr>".    "<table bgcolor='#AA3333' cellspacing='1' cellpadding='1' border='0'><tr>".
   "<td bgcolor='#FF5555'><a target=\"_top\" href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>";    "<td bgcolor='#FF5555'><a target=\"_top\" href=\"$link\"><span style=\"color:#FFFFFF;font-size:10pt;\">$text</span></a>";
     }      }
   
     # Add the graphic      # Add the graphic
Line 1218  sub help_open_faq { Line 1173  sub help_open_faq {
     {      {
  $template .=    $template .= 
   "<table bgcolor='#337733' cellspacing='1' cellpadding='1' border='0'><tr>".    "<table bgcolor='#337733' cellspacing='1' cellpadding='1' border='0'><tr>".
   "<td bgcolor='#448844'><a target=\"_top\" href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>";    "<td bgcolor='#448844'><a target=\"_top\" href=\"$link\"><span style=\"color:#FFFFFF; font-size:10pt;\">$text</span></a>";
     }      }
   
     # Add the graphic      # Add the graphic
Line 1404  sub resize_textarea_js { Line 1359  sub resize_textarea_js {
     my $geometry = &viewport_geometry_js();      my $geometry = &viewport_geometry_js();
     return <<"RESIZE";      return <<"RESIZE";
     <script type="text/javascript">      <script type="text/javascript">
 // <![CDATA[  
 $geometry  $geometry
   
 function getX(element) {  function getX(element) {
Line 1443  function resize_textarea(textarea_id,bot Line 1397  function resize_textarea(textarea_id,bot
     }      }
     textarea.style.height=new_height+'px';      textarea.style.height=new_height+'px';
 }  }
 // ]]>  
 </script>  </script>
 RESIZE  RESIZE
   
Line 1676  sub multiple_select_form { Line 1629  sub multiple_select_form {
             $size = scalar(keys(%$hash));              $size = scalar(keys(%$hash));
         }          }
     }      }
     $output.="\n".'<select name="'.$name.'" size="'.$size.'" multiple="multiple">';      $output.="\n<select name='$name' size='$size' multiple='1'>";
     my @order;      my @order;
     if (ref($order) eq 'ARRAY')  {      if (ref($order) eq 'ARRAY')  {
         @order = @{$order};          @order = @{$order};
Line 1787  sub select_level_form { Line 1740  sub select_level_form {
   
 =pod  =pod
   
 =item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$autosubmit)  =item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc)
   
 Returns a string containing a <select name='$name' size='1'> form to   Returns a string containing a <select name='$name' size='1'> form to 
 allow a user to select the domain to preform an operation in.    allow a user to select the domain to preform an operation in.  
Line 1796  See loncreateuser.pm for an example invo Line 1749  See loncreateuser.pm for an example invo
 If the $includeempty flag is set, it also includes an empty choice ("no domain  If the $includeempty flag is set, it also includes an empty choice ("no domain
 selected");  selected");
   
 If the $showdomdesc flag is set, the domain name is followed by the domain description.  If the $showdomdesc flag is set, the domain name is followed by the domain description. 
   
 If the $autosubmit flag is set, the form containing the domain selector will be auto-submitted by an onchange action.  
   
 =cut  =cut
   
 #-------------------------------------------  #-------------------------------------------
 sub select_dom_form {  sub select_dom_form {
     my ($defdom,$name,$includeempty,$showdomdesc,$autosubmit) = @_;      my ($defdom,$name,$includeempty,$showdomdesc) = @_;
     my $onchange;  
     if ($autosubmit) {  
         $onchange = ' onchange="this.form.submit()"';  
     }  
     my @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains());      my @domains = sort {lc($a) cmp lc($b)} (&Apache::lonnet::all_domains());
     if ($includeempty) { @domains=('',@domains); }      if ($includeempty) { @domains=('',@domains); }
     my $selectdomain = "<select name=\"$name\" size=\"1\"$onchange>\n";      my $selectdomain = "<select name=\"$name\" size=\"1\">\n";
     foreach my $dom (@domains) {      foreach my $dom (@domains) {
         $selectdomain.="<option value=\"$dom\" ".          $selectdomain.="<option value=\"$dom\" ".
             ($dom eq $defdom ? 'selected="selected" ' : '').'>'.$dom;              ($dom eq $defdom ? 'selected="selected" ' : '').'>'.$dom;
Line 1867  sub home_server_form_item { Line 1814  sub home_server_form_item {
     if ($numlib > 1) {      if ($numlib > 1) {
         $result .= '<select name="'.$name.'" />'."\n";          $result .= '<select name="'.$name.'" />'."\n";
         if ($default) {          if ($default) {
             $result .= '<option value="default" selected="selected">'.&mt('default').              $result .= '<option value="default" selected>'.&mt('default').
                        '</option>'."\n";                         '</option>'."\n";
         }          }
         foreach my $hostid (sort(keys(%servers))) {          foreach my $hostid (sort(keys(%servers))) {
Line 2162  sub authform_kerberos { Line 2109  sub authform_kerberos {
         $autharg,$jscall);          $autharg,$jscall);
     my ($authnum,%can_assign) =  &get_assignable_auth($in{'domain'});      my ($authnum,%can_assign) =  &get_assignable_auth($in{'domain'});
     if ($in{'kerb_def_auth'} eq 'krb5') {      if ($in{'kerb_def_auth'} eq 'krb5') {
        $check5 = ' checked="checked"';         $check5 = ' checked="on"';
     } else {      } else {
        $check4 = ' checked="checked"';         $check4 = ' checked="on"';
     }      }
     $krbarg = $in{'kerb_def_dom'};      $krbarg = $in{'kerb_def_dom'};
     if (defined($in{'curr_authtype'})) {      if (defined($in{'curr_authtype'})) {
         if ($in{'curr_authtype'} eq 'krb') {          if ($in{'curr_authtype'} eq 'krb') {
             $krbcheck = ' checked="checked"';              $krbcheck = ' checked="on"';
             if (defined($in{'mode'})) {              if (defined($in{'mode'})) {
                 if ($in{'mode'} eq 'modifyuser') {                  if ($in{'mode'} eq 'modifyuser') {
                     $krbcheck = '';                      $krbcheck = '';
Line 2177  sub authform_kerberos { Line 2124  sub authform_kerberos {
             }              }
             if (defined($in{'curr_kerb_ver'})) {              if (defined($in{'curr_kerb_ver'})) {
                 if ($in{'curr_krb_ver'} eq '5') {                  if ($in{'curr_krb_ver'} eq '5') {
                     $check5 = ' checked="checked"';                      $check5 = ' checked="on"';
                     $check4 = '';                      $check4 = '';
                 } else {                  } else {
                     $check4 = ' checked="checked"';                      $check4 = ' checked="on"';
                     $check5 = '';                      $check5 = '';
                 }                  }
             }              }
Line 2201  sub authform_kerberos { Line 2148  sub authform_kerberos {
         }          }
     } else {      } else {
         if ($authnum == 1) {          if ($authnum == 1) {
             $authtype = '<input type="hidden" name="login" value="krb" />';              $authtype = '<input type="hidden" name="login" value="krb">';
         }          }
     }      }
     if (!$can_assign{'krb4'} && !$can_assign{'krb5'}) {      if (!$can_assign{'krb4'} && !$can_assign{'krb5'}) {
Line 2210  sub authform_kerberos { Line 2157  sub authform_kerberos {
         if (defined($in{'mode'})) {          if (defined($in{'mode'})) {
             if ($in{'mode'} eq 'modifycourse') {              if ($in{'mode'} eq 'modifycourse') {
                 if ($authnum == 1) {                  if ($authnum == 1) {
                     $authtype = '<input type="hidden" name="login" value="krb" />';                      $authtype = '<input type="hidden" name="login" value="krb">';
                 }                  }
             }              }
         }          }
Line 2271  sub authform_internal{ Line 2218  sub authform_internal{
     if (defined($in{'curr_authtype'})) {      if (defined($in{'curr_authtype'})) {
         if ($in{'curr_authtype'} eq 'int') {          if ($in{'curr_authtype'} eq 'int') {
             if ($can_assign{'int'}) {              if ($can_assign{'int'}) {
                 $intcheck = 'checked="checked" ';                  $intcheck = 'checked="on" ';
                 if (defined($in{'mode'})) {                  if (defined($in{'mode'})) {
                     if ($in{'mode'} eq 'modifyuser') {                      if ($in{'mode'} eq 'modifyuser') {
                         $intcheck = '';                          $intcheck = '';
Line 2287  sub authform_internal{ Line 2234  sub authform_internal{
         }          }
     } else {      } else {
         if ($authnum == 1) {          if ($authnum == 1) {
             $authtype = '<input type="hidden" name="login" value="int" />';              $authtype = '<input type="hidden" name="login" value="int">';
         }          }
     }      }
     if (!$can_assign{'int'}) {      if (!$can_assign{'int'}) {
Line 2296  sub authform_internal{ Line 2243  sub authform_internal{
         if (defined($in{'mode'})) {          if (defined($in{'mode'})) {
             if ($in{'mode'} eq 'modifycourse') {              if ($in{'mode'} eq 'modifycourse') {
                 if ($authnum == 1) {                  if ($authnum == 1) {
                     $authtype = '<input type="hidden" name="login" value="int" />';                      $authtype = '<input type="hidden" name="login" value="int">';
                 }                  }
             }              }
         }          }
Line 2311  sub authform_internal{ Line 2258  sub authform_internal{
     $result = &mt      $result = &mt
         ('[_1] Internally authenticated (with initial password [_2])',          ('[_1] Internally authenticated (with initial password [_2])',
          '<label>'.$authtype,'</label>'.$autharg);           '<label>'.$authtype,'</label>'.$autharg);
     $result.="<label><input type=\"checkbox\" name=\"visible\" onclick='if (this.checked) { this.form.intarg.type=\"text\" } else { this.form.intarg.type=\"password\" }' />".&mt('Visible input').'</label>';      $result.="<label><input type=\"checkbox\" name=\"visible\" onClick='if (this.checked) { this.form.intarg.type=\"text\" } else { this.form.intarg.type=\"password\" }' />".&mt('Visible input').'</label>';
     return $result;      return $result;
 }  }
   
Line 2326  sub authform_local{ Line 2273  sub authform_local{
     if (defined($in{'curr_authtype'})) {      if (defined($in{'curr_authtype'})) {
         if ($in{'curr_authtype'} eq 'loc') {          if ($in{'curr_authtype'} eq 'loc') {
             if ($can_assign{'loc'}) {              if ($can_assign{'loc'}) {
                 $loccheck = 'checked="checked" ';                  $loccheck = 'checked="on" ';
                 if (defined($in{'mode'})) {                  if (defined($in{'mode'})) {
                     if ($in{'mode'} eq 'modifyuser') {                      if ($in{'mode'} eq 'modifyuser') {
                         $loccheck = '';                          $loccheck = '';
Line 2342  sub authform_local{ Line 2289  sub authform_local{
         }          }
     } else {      } else {
         if ($authnum == 1) {          if ($authnum == 1) {
             $authtype = '<input type="hidden" name="login" value="loc" />';              $authtype = '<input type="hidden" name="login" value="loc">';
         }          }
     }      }
     if (!$can_assign{'loc'}) {      if (!$can_assign{'loc'}) {
Line 2351  sub authform_local{ Line 2298  sub authform_local{
         if (defined($in{'mode'})) {          if (defined($in{'mode'})) {
             if ($in{'mode'} eq 'modifycourse') {              if ($in{'mode'} eq 'modifycourse') {
                 if ($authnum == 1) {                  if ($authnum == 1) {
                     $authtype = '<input type="hidden" name="login" value="loc" />';                      $authtype = '<input type="hidden" name="login" value="loc">';
                 }                  }
             }              }
         }          }
Line 2380  sub authform_filesystem{ Line 2327  sub authform_filesystem{
     if (defined($in{'curr_authtype'})) {      if (defined($in{'curr_authtype'})) {
         if ($in{'curr_authtype'} eq 'fsys') {          if ($in{'curr_authtype'} eq 'fsys') {
             if ($can_assign{'fsys'}) {              if ($can_assign{'fsys'}) {
                 $fsyscheck = 'checked="checked" ';                  $fsyscheck = 'checked="on" ';
                 if (defined($in{'mode'})) {                  if (defined($in{'mode'})) {
                     if ($in{'mode'} eq 'modifyuser') {                      if ($in{'mode'} eq 'modifyuser') {
                         $fsyscheck = '';                          $fsyscheck = '';
Line 2393  sub authform_filesystem{ Line 2340  sub authform_filesystem{
         }          }
     } else {      } else {
         if ($authnum == 1) {          if ($authnum == 1) {
             $authtype = '<input type="hidden" name="login" value="fsys" />';              $authtype = '<input type="hidden" name="login" value="fsys">';
         }          }
     }      }
     if (!$can_assign{'fsys'}) {      if (!$can_assign{'fsys'}) {
Line 2402  sub authform_filesystem{ Line 2349  sub authform_filesystem{
         if (defined($in{'mode'})) {          if (defined($in{'mode'})) {
             if ($in{'mode'} eq 'modifycourse') {              if ($in{'mode'} eq 'modifycourse') {
                 if ($authnum == 1) {                  if ($authnum == 1) {
                     $authtype = '<input type="hidden" name="login" value="fsys" />';                      $authtype = '<input type="hidden" name="login" value="fsys">';
                 }                  }
             }              }
         }          }
Line 2770  sub flush_email_cache { Line 2717  sub flush_email_cache {
     &Apache::lonnet::devalidate_cache_new('emailscache',$id);      &Apache::lonnet::devalidate_cache_new('emailscache',$id);
 }  }
   
 # -------------------------------------------------------------------- getlangs  
   
 =pod  
   
 =item * &getlangs($uname,$udom)  
   
 Gets a user's language preference and returns it as a hash with key:  
 language.  
   
 =cut  
   
   
 sub getlangs {  
     my ($uname,$udom) = @_;  
     if (!$udom)  { $udom =$env{'user.domain'}; }  
     if (!$uname) { $uname=$env{'user.name'};   }  
     my $id=$uname.':'.$udom;  
     my ($langs,$cached)=&Apache::lonnet::is_cached_new('userlangs',$id);  
     if ($cached) {  
         return %{$langs};  
     } else {  
         my %loadlangs=&Apache::lonnet::get('environment',['languages'],  
                                            $udom,$uname);  
         &Apache::lonnet::do_cache_new('userlangs',$id,\%loadlangs);  
         return %loadlangs;  
     }  
 }  
   
 sub flush_langs_cache {  
     my ($uname,$udom)=@_;  
     if (!$udom)  { $udom =$env{'user.domain'}; }  
     if (!$uname) { $uname=$env{'user.name'};   }  
     return if ($udom eq 'public' && $uname eq 'public');  
     my $id=$uname.':'.$udom;  
     &Apache::lonnet::devalidate_cache_new('userlangs',$id);  
 }  
   
 # ------------------------------------------------------------------ Screenname  # ------------------------------------------------------------------ Screenname
   
 =pod  =pod
Line 2825  sub screenname { Line 2735  sub screenname {
     return $names{'screenname'};      return $names{'screenname'};
 }  }
   
 # ------------------------------------------------------------- Confirm Wrapper  
 =pod  
   
 =item confirmwrapper  
   
 Wrap messages about completion of operation in box  
   
 =cut  
   
 sub confirmwrapper {  
     my ($message)=@_;  
     if ($message) {  
         return "\n".'<div class="LC_confirm_box">'."\n"  
                .$message."\n"  
                .'</div>'."\n";  
     } else {  
         return $message;  
     }  
 }  
   
 # ------------------------------------------------------------- Message Wrapper  # ------------------------------------------------------------- Message Wrapper
   
Line 2870  sub aboutmewrapper { Line 2761  sub aboutmewrapper {
         return;          return;
     }      }
     return '<a href="/adm/'.$domain.'/'.$username.'/aboutme"'.      return '<a href="/adm/'.$domain.'/'.$username.'/aboutme"'.
  ($target?' target="$target"':'').' title="'.&mt("View this user's personal information page").'">'.$link.'</a>';   ($target?' target="$target"':'').' title="'.&mt("View this user's personal page").'">'.$link.'</a>';
 }  }
   
 # ------------------------------------------------------------ Syllabus Wrapper  # ------------------------------------------------------------ Syllabus Wrapper
   
   
 sub syllabuswrapper {  sub syllabuswrapper {
     my ($linktext,$coursedir,$domain,$fontcolor)=@_;      my ($linktext,$coursedir,$domain)=@_;
     if ($fontcolor) {   
         $linktext='<font color="'.$fontcolor.'">'.$linktext.'</font>';   
     }  
     return qq{<a href="/public/$domain/$coursedir/syllabus">$linktext</a>};      return qq{<a href="/public/$domain/$coursedir/syllabus">$linktext</a>};
 }  }
   
Line 2905  sub track_student_link { Line 2793  sub track_student_link {
  &help_open_topic('View_recent_activity');   &help_open_topic('View_recent_activity');
 }  }
   
 sub slot_reservations_link {  
     my ($linktext,$sname,$sdom,$target) = @_;  
     my $link ="/adm/slotrequest?command=showresv&amp;origin=aboutme";  
     my $title = 'View slot reservation history';  
     if (defined($sname) && $sname !~ /^\s*$/ &&  
         defined($sdom)  && $sdom  !~ /^\s*$/) {  
         $link .= "&amp;uname=$sname&amp;udom=$sdom";  
         $title .= ' of this student';  
     }  
     if (defined($target) && $target !~ /^\s*$/) {  
         $target = qq{target="$target"};  
     } else {  
         $target = '';  
     }  
     $title = &mt($title);  
     $linktext = &mt($linktext);  
     return qq{<a href="$link" title="$title" $target>$linktext</a>};  
 # FIXME uncomment when help item created: &help_open_topic('Slot_Reservation_History');  
   
 }  
   
 # ===================================================== Display a student photo  # ===================================================== Display a student photo
   
   
Line 3163  sub languages { Line 3030  sub languages {
     return $preferred_possibilities[0];      return $preferred_possibilities[0];
 }  }
   
 sub user_lang {  
     my ($touname,$toudom,$fromcid) = @_;  
     my @userlangs;  
     if (($fromcid ne '') && ($env{'course.'.$fromcid.'.languages'} ne '')) {  
         @userlangs=(@userlangs,split(/\s*(\,|\;|\:)\s*/,  
                     $env{'course.'.$fromcid.'.languages'}));  
     } else {  
         my %langhash = &getlangs($touname,$toudom);  
         if ($langhash{'languages'} ne '') {  
             @userlangs = split(/\s*(\,|\;|\:)\s*/,$langhash{'languages'});  
         } else {  
             my %domdefs = &Apache::lonnet::get_domain_defaults($toudom);  
             if ($domdefs{'lang_def'} ne '') {  
                 @userlangs = ($domdefs{'lang_def'});  
             }  
         }  
     }  
     my @languages=&Apache::lonlocal::get_genlanguages(@userlangs);  
     my $user_lh = Apache::localize->get_handle(@languages);  
     return $user_lh;  
 }  
   
 ###############################################################  ###############################################################
 ##               Student Answer Attempts                     ##  ##               Student Answer Attempts                     ##
 ###############################################################  ###############################################################
Line 3323  sub relative_to_absolute { Line 3168  sub relative_to_absolute {
     }      }
     $thisdir=~s-/[^/]*$--;      $thisdir=~s-/[^/]*$--;
     foreach my $link (@rlinks) {      foreach my $link (@rlinks) {
  unless (($link=~/^https?\:\/\//i) ||   unless (($link=~/^http:\/\//i) ||
  ($link=~/^\//) ||   ($link=~/^\//) ||
  ($link=~/^javascript:/i) ||   ($link=~/^javascript:/i) ||
  ($link=~/^mailto:/i) ||   ($link=~/^mailto:/i) ||
Line 3900  sub blocking_status { Line 3745  sub blocking_status {
                              &Apache::lonnet::coursedescription($course);                               &Apache::lonnet::coursedescription($course);
                         $coursedesc = $courseinfo{'description'};                          $coursedesc = $courseinfo{'description'};
                     }                      }
                     $category = "Group portfolio files in the course '$coursedesc'";                      $category = "Group files in the course '$coursedesc'";
                 } else {                  } else {
                     $category = 'Portfolio files belonging to ';                      $category = 'Portfolio files belonging to ';
                     if ($env{'user.name'} eq 'public' &&                       if ($env{'user.name'} eq 'public' && 
Line 4034  sub get_domainconf { Line 3879  sub get_domainconf {
                 foreach my $key (keys(%{$domconfig{'login'}})) {                  foreach my $key (keys(%{$domconfig{'login'}})) {
                     if (ref($domconfig{'login'}{$key}) eq 'HASH') {                      if (ref($domconfig{'login'}{$key}) eq 'HASH') {
                         foreach my $img (keys(%{$domconfig{'login'}{$key}})) {                          foreach my $img (keys(%{$domconfig{'login'}{$key}})) {
                             $designhash{$udom.'.login.'.$key.'_'.$img} =                              $designhash{$udom.'.login.'.$key.'_'.$img} = 
                                 $domconfig{'login'}{$key}{$img};                                  $domconfig{'login'}{$key}{$img};
                         }                          }
                     } else {                      } else {
Line 4261  sub bodytag { Line 4106  sub bodytag {
     my $font =   &designparm($function.'.font',$domain);      my $font =   &designparm($function.'.font',$domain);
     my $pgbg   = $bgcolor || &designparm($function.'.pgbg',$domain);      my $pgbg   = $bgcolor || &designparm($function.'.pgbg',$domain);
   
     my %design = ( 'style'   => 'margin-top: 0',      my %design = ( 'style'   => 'margin-top: 0px',
    'bgcolor' => $pgbg,     'bgcolor' => $pgbg,
    'text'    => $font,     'text'    => $font,
                    'alink'   => &designparm($function.'.alink',$domain),                     'alink'   => &designparm($function.'.alink',$domain),
Line 4372  ENDROLE Line 4217  ENDROLE
  .'<b>'.&mt('Construction Space').'</b>:&nbsp;'   .'<b>'.&mt('Construction Space').'</b>:&nbsp;'
  .'<form name="dirs" method="post" action="'.$formaction   .'<form name="dirs" method="post" action="'.$formaction
  .'" target="_top"><tt><b>'   .'" target="_top"><tt><b>'
  .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."<font size=\"+1\">$lastitem</font></b></tt><br />"   .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."<span class=\"LC_fontsize_big\">$lastitem</span></b></tt><br />"
  .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')   .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')
  .'</form>'   .'</form>'
  .&Apache::lonmenu::constspaceform();   .&Apache::lonmenu::constspaceform();
Line 4546  sub standard_css { Line 4391  sub standard_css {
     my $vlink  = &designparm($function.'.vlink', $domain);      my $vlink  = &designparm($function.'.vlink', $domain);
     my $link   = &designparm($function.'.link',  $domain);      my $link   = &designparm($function.'.link',  $domain);
   
       my $loginbg = &designparm('login.sidebg',$domain);
       my $bgcol = &designparm('login.bgcol',$domain);
       my $textcol = &designparm('login.textcol',$domain);
   
     my $sans                 = 'Verdana,Arial,Helvetica,sans-serif';      my $sans                 = 'Verdana,Arial,Helvetica,sans-serif';
     my $mono                 = 'monospace';      my $mono                 = 'monospace';
     my $data_table_head      = $tabbg;      my $data_table_head      = $tabbg;
Line 4563  sub standard_css { Line 4412  sub standard_css {
     my $mail_other_hover     = '#669999';      my $mail_other_hover     = '#669999';
     my $table_header         = '#DDDDDD';      my $table_header         = '#DDDDDD';
     my $feedback_link_bg     = '#BBBBBB';      my $feedback_link_bg     = '#BBBBBB';
     my $lg_border_color      = '#C8C8C8';      my $lg_border_color     = '#C8C8C8';
   
     my $border = ($env{'browser.type'} eq 'explorer' ||      my $border = ($env{'browser.type'} eq 'explorer' ||
   $env{'browser.type'} eq 'safari'     ) ? '0 2px 0 2px'    $env{'browser.type'} eq 'safari'     ) ? '0px 2px 0px 2px'
                                                  : '0 3px 0 4px';                                                   : '0px 3px 0px 4px';
   
   
     return <<END;      return <<END;
 h1, h2, h3, th { font-family: $sans }  body{
        font-family: $sans;
        line-height:130%;
        font-size:0.83em;
        color:$font;
     }
   a:link, a:visited { font-size:100%; }
   
 a:focus { color: red; background: yellow }   a:focus { color: red; background: yellow } 
 table.thinborder,  table.thinborder,
   
 table.thinborder tr th {  table.thinborder tr th {
   border-style: solid;    border-style: solid;
   border-width: 1px;    border-width: 1px;
     border-color: $lg_border_color;
   background: $tabbg;    background: $tabbg;
 }  }
 table.thinborder tr td {  table.thinborder tr td {
   border-style: solid;    border-style: solid;
   border-width: 1px    border-width: 1px;
     border-color: $lg_border_color;
 }  }
   
 form, .inline { display: inline; }  form, .inline { display: inline; }
 .center { text-align: center; }  
   .LC_center { text-align: center; }
   .LC_left { text-align:left; }
   .LC_right {text-align:right;}
   .LC_middle {vertical-align:middle;}
   .LC_top {vertical-align:top;}
   .LC_bottom {vertical-align:bottom;}
   
   /* just for tests */
   .LC_300Box { width:300px; }
   .LC_200Box {width:200px; }
   .LC_500Box {width:500px; }
   .LC_600Box {width:600px; }
   /* end */
   
 .LC_filename {font-family: $mono; white-space:pre;}  .LC_filename {font-family: $mono; white-space:pre;}
 .LC_error {  .LC_error {
   color: red;    color: red;
Line 4594  form, .inline { display: inline; } Line 4465  form, .inline { display: inline; }
 }  }
 .LC_warning,  .LC_warning,
 .LC_diff_removed {  .LC_diff_removed {
   color: red;    
 }  }
   
 .LC_info,  .LC_info,
Line 4602  form, .inline { display: inline; } Line 4473  form, .inline { display: inline; }
 .LC_diff_added {  .LC_diff_added {
   color: green;    color: green;
 }  }
   .LC_unknown {
 div.LC_confirm_box {    color: yellow;
   background-color: #FAFAFA;  
   border: 1px solid $lg_border_color;  
   margin-right: 0;  
   padding: 5px;  
 }  
   
 div.LC_confirm_box .LC_error img,  
 div.LC_confirm_box .LC_success img {  
   vertical-align: middle;  
 }  }
   
 .LC_icon {  .LC_icon {
   border: none;    border: 0px;
 }  }
 .LC_indexer_icon {  .LC_indexer_icon {
   border: 0;    border: 0px;
   height: 22px;    height: 22px;
 }  }
 .LC_docs_spacer {  .LC_docs_spacer {
   width: 25px;    width: 25px;
   height: 1px;    height: 1px;
   border: none;    border: 0px;
 }  }
   
 .LC_internal_info {  .LC_internal_info {
   color: #999999;    color: #999;
 }  }
   
 table.LC_pastsubmission {  table.LC_pastsubmission {
Line 4642  table#LC_top_nav, table#LC_menubuttons,t Line 4504  table#LC_top_nav, table#LC_menubuttons,t
   background: $pgbg;    background: $pgbg;
   border: 2px;    border: 2px;
   border-collapse: separate;    border-collapse: separate;
   padding: 0;    padding: 0px;
 }  }
   
 table#LC_title_bar, table.LC_breadcrumbs,   table#LC_title_bar, table.LC_breadcrumbs, 
Line 4655  table#LC_title_bar.LC_with_remote { Line 4517  table#LC_title_bar.LC_with_remote {
   background: $pgbg;    background: $pgbg;
   font-family: $sans;    font-family: $sans;
   border-collapse: collapse;    border-collapse: collapse;
   padding: 0;    padding: 0px;
 }  }
   
 table.LC_docs_path {  table.LC_docs_path {
   width: 100%;    width: 100%;
   border: 0;    border: 0;
   background: $pgbg;    background: $pgbg;
   font-family: $sans;    font-family: $sans;
   border-collapse: collapse;    border-collapse: collapse;
   padding: 0;    padding: 0px;
 }  }
   
 table#LC_title_bar td {  table#LC_title_bar td {
Line 4685  span.LC_title_bar_title { Line 4546  span.LC_title_bar_title {
 table#LC_title_bar td.LC_title_bar_domain_logo {  table#LC_title_bar td.LC_title_bar_domain_logo {
   background: $sidebg;    background: $sidebg;
   text-align: right;    text-align: right;
   padding: 0;    padding: 0px;
 }  }
 table#LC_title_bar td.LC_title_bar_role_logo {  table#LC_title_bar td.LC_title_bar_role_logo {
   background: $sidebg;    background: $sidebg;
   padding: 0;    padding: 0px;
 }  }
   
 table#LC_menubuttons_mainmenu {  table#LC_menubuttons img{
   width: 100%;    border: 0px;
   border: 0;  
   border-spacing: 1px;  
   padding: 0 1px;  
   margin: 0;  
   border-collapse: separate;  
 }  
 table#LC_menubuttons img, table#LC_menubuttons_mainmenu img {  
   border: none;  
 }  }
 table#LC_top_nav td {  table#LC_top_nav td {
   background: $tabbg;    background: $tabbg;
   border: none;    border: 0px;
   font-size: small;    font-size: small;
     vertical-align:top;
     padding:2px 5px 2px 5px;
 }  }
 table#LC_top_nav td a, div#LC_top_nav a {  table#LC_top_nav td a, div#LC_top_nav a {
   color: $font;    color: $font;
Line 4719  table#LC_top_nav td.LC_top_nav_logo { Line 4574  table#LC_top_nav td.LC_top_nav_logo {
   width: 31px;    width: 31px;
 }  }
 table#LC_top_nav td.LC_top_nav_logo img {  table#LC_top_nav td.LC_top_nav_logo img {
   border: none;    border: 0px;
   vertical-align: bottom;    vertical-align: bottom;
 }  }
 table#LC_top_nav td.LC_top_nav_exit,  table#LC_top_nav td.LC_top_nav_exit,
Line 4751  table#LC_mainmenu td.LC_mainmenu_column Line 4606  table#LC_mainmenu td.LC_mainmenu_column
     vertical-align: top;      vertical-align: top;
 }  }
   
   .LC_fontsize_small
   {
    font-size: 70%;
   }
   
   .LC_fontsize_medium
   {
    font-size: 85%;
   }
   
   .LC_fontsize_large
   {
    font-size: 120%;
   }
   
   .LC_fontcolor_red
   {
    color: #FF0000;
   }
   
 .LC_menubuttons_inline_text {  .LC_menubuttons_inline_text {
   color: $font;    color: $font;
   font-family: $sans;    font-family: $sans;
   font-size: smaller;    font-size: 90%;
     padding-left:3px;
 }  }
   
 .LC_menubuttons_link {  .LC_menubuttons_link {
Line 4770  table#LC_mainmenu td.LC_mainmenu_column Line 4646  table#LC_mainmenu td.LC_mainmenu_column
 }  }
   
 td.LC_menubuttons_text {  td.LC_menubuttons_text {
   width: 90%;    color: $font;
   color: $font;  
   font-family: $sans;  
 }  }
   
 td.LC_menubuttons_img {  
 }  
   
 .LC_current_location {  .LC_current_location {
   font-family: $sans;    font-family: $sans;
Line 4788  td.LC_menubuttons_img { Line 4661  td.LC_menubuttons_img {
   font-weight: bold;    font-weight: bold;
 }  }
   
   
 .LC_dropadd_labeltext {  .LC_dropadd_labeltext {
   font-family: $sans;    font-family: $sans;
   text-align: right;    text-align: right;
Line 4799  td.LC_menubuttons_img { Line 4673  td.LC_menubuttons_img {
 }  }
   
 .LC_roleslog_note {  .LC_roleslog_note {
   font-size: smaller;    font-size: small;
 }  }
   
 .LC_mail_functions {  .LC_mail_functions {
Line 4807  td.LC_menubuttons_img { Line 4681  td.LC_menubuttons_img {
 }  }
   
 table.LC_aboutme_port {  table.LC_aboutme_port {
   border: none;    border: 0px;
   border-collapse: collapse;    border-collapse: collapse;
   border-spacing: 0;    border-spacing: 0px;
 }  }
 table.LC_data_table, table.LC_mail_list {  table.LC_data_table, table.LC_mail_list {
   border: 1px solid #000000;    border: 1px solid #000000;
Line 4823  table.LC_data_table, table.LC_mail_list Line 4697  table.LC_data_table, table.LC_mail_list
 table.LC_nested_outer {  table.LC_nested_outer {
   border: 1px solid #000000;    border: 1px solid #000000;
   border-collapse: collapse;    border-collapse: collapse;
   border-spacing: 0;    border-spacing: 0px;
   width: 100%;    width: 100%;
 }  }
 table.LC_nested {  table.LC_nested {
   border: none;    border: 0px;
   border-collapse: collapse;    border-collapse: collapse;
   border-spacing: 0;    border-spacing: 0px;
   width: 100%;    width: 100%;
 }  }
 table.LC_data_table tr th, table.LC_calendar tr th, table.LC_mail_list tr th,  table.LC_data_table tr th, table.LC_calendar tr th, table.LC_mail_list tr th,
 table.LC_prior_tries tr th {  table.LC_prior_tries tr th {
   font-weight: bold;    font-weight: bold;
   background-color: $data_table_head;    background-color: $data_table_head;
   font-size: smaller;    font-size:90%;
 }  }
 table.LC_data_table tr.LC_info_row > td {  table.LC_data_table tr.LC_info_row > td {
   background-color: #CCCCCC;    background-color: #CCC;
   font-weight: bold;    font-weight: bold;
   text-align: left;    text-align: left;
 }  }
Line 4876  table.LC_nested tr.LC_empty_row td { Line 4750  table.LC_nested tr.LC_empty_row td {
 table.LC_nested_outer tr th {  table.LC_nested_outer tr th {
   font-weight: bold;    font-weight: bold;
   background-color: $data_table_head;    background-color: $data_table_head;
   font-size: smaller;    font-size: small;
   border-bottom: 1px solid #000000;    border-bottom: 1px solid #000000;
 }  }
 table.LC_nested_outer tr td.LC_subheader {  table.LC_nested_outer tr td.LC_subheader {
Line 4887  table.LC_nested_outer tr td.LC_subheader Line 4761  table.LC_nested_outer tr td.LC_subheader
   text-align: right;    text-align: right;
 }  }
 table.LC_nested tr.LC_info_row td {  table.LC_nested tr.LC_info_row td {
   background-color: #CCCCCC;    background-color: #CCC;
   font-weight: bold;    font-weight: bold;
   font-size: small;    font-size: small;
   text-align: center;    text-align: center;
Line 4897  table.LC_nested_outer tr th.LC_left_item Line 4771  table.LC_nested_outer tr th.LC_left_item
   text-align: left;    text-align: left;
 }  }
 table.LC_nested td {  table.LC_nested td {
   background-color: #FFFFFF;    background-color: #FFF;
   font-size: small;    font-size: small;
 }  }
 table.LC_nested_outer tr th.LC_right_item,  table.LC_nested_outer tr th.LC_right_item,
Line 4908  table.LC_nested tr td.LC_right_item { Line 4782  table.LC_nested tr td.LC_right_item {
 }  }
   
 table.LC_nested tr.LC_odd_row td {  table.LC_nested tr.LC_odd_row td {
   background-color: #EEEEEE;    background-color: #EEE;
 }  }
   
 table.LC_createuser {  table.LC_createuser {
 }  }
   
 table.LC_createuser tr.LC_section_row td {  table.LC_createuser tr.LC_section_row td {
   font-size: smaller;    font-size: small;
 }  }
   
 table.LC_createuser tr.LC_info_row td  {  table.LC_createuser tr.LC_info_row td  {
   background-color: #CCCCCC;    background-color: #CCC;
   font-weight: bold;    font-weight: bold;
   text-align: center;    text-align: center;
 }  }
Line 4971  table.LC_mail_list tr.LC_mail_even { Line 4845  table.LC_mail_list tr.LC_mail_even {
 table.LC_mail_list tr.LC_mail_odd {  table.LC_mail_list tr.LC_mail_odd {
 }  }
   
   table.LC_data_table tr > td.LC_browser_file,
 table#LC_portfolio_actions {  table.LC_data_table tr > td.LC_browser_file_published {
   width: auto;  
   background: $pgbg;  
   border: none;  
   border-spacing: 2px 2px;  
   padding: 0;  
   margin: 0;  
   border-collapse: separate;  
 }  
 table#LC_portfolio_actions td.LC_label {  
   background: $tabbg;  
   text-align: right;  
 }  
 table#LC_portfolio_actions td.LC_value {  
   background: $tabbg;  
 }  
   
 table#LC_cstr_controls {  
   width: 100%;  
   border-collapse: collapse;  
 }  
 table#LC_cstr_controls tr td {  
   border: 4px solid $pgbg;  
   padding: 4px;  
   text-align: center;  
   background: $tabbg;  
 }  
 table#LC_cstr_controls tr th {  
   border: 4px solid $pgbg;  
   background: $table_header;  
   text-align: center;  
   font-family: $sans;  
   font-size: smaller;  
 }  
   
 table#LC_browser {  
    
 }  
 table#LC_browser tr th {  
   background: $table_header;  
 }  
 table#LC_browser tr td {  
   padding: 2px;  
 }  
 table#LC_browser tr.LC_browser_file,  
 table#LC_browser tr.LC_browser_file_published {  
   background: #CCFF88;    background: #CCFF88;
 }  }
 table#LC_browser tr.LC_browser_file_locked,  table.LC_data_table tr > td.LC_browser_file_locked,
 table#LC_browser tr.LC_browser_file_unpublished {  table.LC_data_table tr > td.LC_browser_file_unpublished {
   background: #FFAA99;    background: #FFAA99;
 }  }
 table#LC_browser tr.LC_browser_file_obsolete {  table.LC_data_table tr > td.LC_browser_file_obsolete {
   background: #AAAAAA;    background: #AAAAAA;
 }  }
 table#LC_browser tr.LC_browser_file_modified,  table.LC_data_table tr > td.LC_browser_file_modified,
 table#LC_browser tr.LC_browser_file_metamodified {  table.LC_data_table tr > td.LC_browser_file_metamodified {
   background: #FFFF77;    background: #FFFF77;
 }  }
 table#LC_browser tr.LC_browser_folder {  table.LC_data_table tr.LC_browser_folder > td {
   background: #CCCCFF;    background: #CCCCFF;
 }  }
   
Line 5055  table.LC_data_table tr > td.LC_roles_sel Line 4884  table.LC_data_table tr > td.LC_roles_sel
 }  }
   
 span.LC_current_location {  span.LC_current_location {
   font-size: x-large;    font-size:larger;
   background: $pgbg;    background: $pgbg;
 }  }
   
Line 5099  table.LC_parm_overview_restrictions th { Line 4928  table.LC_parm_overview_restrictions th {
   border-color: $pgbg;    border-color: $pgbg;
 }  }
 table#LC_helpmenu {  table#LC_helpmenu {
   border: none;    border: 0px;
   height: 55px;    height: 55px;
   border-spacing: 0;    border-spacing: 0px;
 }  }
   
 table#LC_helpmenu fieldset legend {  table#LC_helpmenu fieldset legend {
Line 5112  table#LC_helpmenu_links { Line 4941  table#LC_helpmenu_links {
   width: 100%;    width: 100%;
   border: 1px solid black;    border: 1px solid black;
   background: $pgbg;    background: $pgbg;
   padding: 0;    padding: 0px;
   border-spacing: 1px;    border-spacing: 1px;
 }  }
 table#LC_helpmenu_links tr td {  table#LC_helpmenu_links tr td {
Line 5154  table.LC_pick_box td.LC_pick_box_title { Line 4983  table.LC_pick_box td.LC_pick_box_title {
   background: $tabbg;    background: $tabbg;
   font-weight: bold;    font-weight: bold;
   text-align: right;    text-align: right;
   vertical-align: top;  
   width: 184px;    width: 184px;
   padding: 8px;    padding: 8px;
 }  }
Line 5175  table.LC_pick_box td.LC_pick_box_select Line 5003  table.LC_pick_box td.LC_pick_box_select
   padding: 8px;    padding: 8px;
 }  }
 table.LC_pick_box td.LC_pick_box_separator {  table.LC_pick_box td.LC_pick_box_separator {
   padding: 0;    padding: 0px;
   height: 1px;    height: 1px;
   background: black;    background: black;
 }  }
Line 5217  table.LC_helpform_receipt td.LC_oddrow_v Line 5045  table.LC_helpform_receipt td.LC_oddrow_v
   background-color: $data_table_light;    background-color: $data_table_light;
 }  }
 table.LC_helpform_receipt td.LC_pick_box_separator {  table.LC_helpform_receipt td.LC_pick_box_separator {
   padding: 0;    padding: 0px;
   height: 1px;    height: 1px;
   background: black;    background: black;
 }  }
Line 5250  table.LC_group_priv_box td.LC_groups_fun Line 5078  table.LC_group_priv_box td.LC_groups_fun
 }  }
 table.LC_group_priv td {  table.LC_group_priv td {
   text-align: left;    text-align: left;
   padding: 0;    padding: 0px;
 }  }
   
 table.LC_notify_front_page {  table.LC_notify_front_page {
Line 5271  table.LC_notify_front_page td { Line 5099  table.LC_notify_front_page td {
   background: $tabbg;    background: $tabbg;
   vertical-align: middle;    vertical-align: middle;
   margin: 2ex 0ex 2ex 0ex;    margin: 2ex 0ex 2ex 0ex;
   padding: 3px;  
 }  }
 .LC_topic_bar span {  .LC_topic_bar span {
   vertical-align: middle;    vertical-align: middle;
Line 5388  span.LC_cusr_subheading { Line 5215  span.LC_cusr_subheading {
   
 table.LC_docs_documents {  table.LC_docs_documents {
   background: #BBBBBB;    background: #BBBBBB;
   border-width: 0;    border-width: 0px;
   border-collapse: collapse;    border-collapse: collapse;
 }  }
   
Line 5405  table.LC_docs_documents td.LC_docs_docum Line 5232  table.LC_docs_documents td.LC_docs_docum
 }  }
   
 .LC_docs_entry_move {  .LC_docs_entry_move {
   border: none;    border: 0px;
   border-collapse: collapse;    border-collapse: collapse;
 }  }
   
Line 5461  table.LC_sty_end { Line 5288  table.LC_sty_end {
 }  }
   
 table.LC_double_column {  table.LC_double_column {
   border-width: 0;    border-width: 0px;
   border-collapse: collapse;    border-collapse: collapse;
   width: 100%;    width: 100%;
   padding: 2px;    padding: 2px;
Line 5501  div.LC_clear_float_footer { Line 5328  div.LC_clear_float_footer {
 }  }
   
   
 div.LC_grade_select_mode {  
   font-family: $sans;  
 }  
 div.LC_grade_select_mode div div {  
   margin: 5px;  
 }  
 div.LC_grade_select_mode_selector {  
   margin: 5px;  
   float: left;  
 }  
 div.LC_grade_select_mode_selector_header {  
   font: bold medium $sans;  
 }  
 div.LC_grade_select_mode_type {  
   clear: left;  
 }  
   
 div.LC_grade_show_user {  div.LC_grade_show_user {
   margin-top: 20px;    margin-top: 20px;
   border: 1px solid black;    border: 1px solid black;
Line 5525  div.LC_grade_show_user { Line 5335  div.LC_grade_show_user {
 div.LC_grade_user_name {  div.LC_grade_user_name {
   background: #DDDDEE;    background: #DDDDEE;
   border-bottom: 1px solid black;    border-bottom: 1px solid black;
   font: bold large $sans;    font-weight: bold;
     font-size: large;
 }  }
 div.LC_grade_show_user_odd_row div.LC_grade_user_name {  div.LC_grade_show_user_odd_row div.LC_grade_user_name {
   background: #DDEEDD;    background: #DDEEDD;
Line 5544  div.LC_grade_show_problem_header, Line 5355  div.LC_grade_show_problem_header,
 div.LC_grade_submissions_header,  div.LC_grade_submissions_header,
 div.LC_grade_message_center_header,  div.LC_grade_message_center_header,
 div.LC_grade_assign_header {  div.LC_grade_assign_header {
   font: bold large $sans;    font-weight: bold;
     font-size: large;
 }  }
 div.LC_grade_show_problem_problem,  div.LC_grade_show_problem_problem,
 div.LC_grade_submissions_body,  div.LC_grade_submissions_body,
Line 5555  div.LC_grade_assign_body { Line 5367  div.LC_grade_assign_body {
   background: #FFFFFF;    background: #FFFFFF;
 }  }
 span.LC_grade_check_note {  span.LC_grade_check_note {
   font: normal medium $sans;    font-weight: normal;
     font-size: medium;
   display: inline;    display: inline;
   position: absolute;    position: absolute;
   right: 1em;    right: 1em;
Line 5565  table.LC_scantron_action { Line 5378  table.LC_scantron_action {
   width: 100%;    width: 100%;
 }  }
 table.LC_scantron_action tr th {  table.LC_scantron_action tr th {
   font: normal bold $sans;    font-weight:bold;
     font-style:normal;
 }  }
   .LC_edit_problem_header, 
 div.LC_edit_problem_header,   
 div.LC_edit_problem_footer {  div.LC_edit_problem_footer {
   font: normal medium $sans;    font-weight: normal;
     font-size:  medium;
   margin: 2px;    margin: 2px;
 }  }
 div.LC_edit_problem_header,  div.LC_edit_problem_header,
Line 5587  div.LC_edit_problem_header_edit_row { Line 5401  div.LC_edit_problem_header_edit_row {
   margin-bottom: 5px;    margin-bottom: 5px;
 }  }
 div.LC_edit_problem_header_title {  div.LC_edit_problem_header_title {
   font: larger bold $sans;    font-weight: bold;
     font-size: larger;
   background: $tabbg;    background: $tabbg;
   padding: 3px;    padding: 3px;
 }  }
 table.LC_edit_problem_header_title {  table.LC_edit_problem_header_title {
   font: larger bold $sans;    font-size: larger;
     font-weight:  bold;
   width: 100%;    width: 100%;
   border-color: $pgbg;    border-color: $pgbg;
   border-style: solid;    border-style: solid;
Line 5600  table.LC_edit_problem_header_title { Line 5416  table.LC_edit_problem_header_title {
   
   background: $tabbg;    background: $tabbg;
   border-collapse: collapse;    border-collapse: collapse;
   padding: 0;    padding: 0px
 }  }
   
 div.LC_edit_problem_discards {  div.LC_edit_problem_discards {
Line 5616  hr.LC_edit_problem_divide { Line 5432  hr.LC_edit_problem_divide {
   color: $tabbg;    color: $tabbg;
   background-color: $tabbg;    background-color: $tabbg;
   height: 3px;    height: 3px;
   border: none;    border: 0px;
 }  }
 img.stift{  img.stift{
   border-width:0;    border-width:0;
Line 5640  table#LC_mainmenu td.LC_mainmenu_col_fie Line 5456  table#LC_mainmenu td.LC_mainmenu_col_fie
   font-size: small;    font-size: small;
   font-weight: bold;    font-weight: bold;
 }  }
 fieldset#LC_mainmenu_fieldset {  
   margin:0 10px 10px 0;  
   
 }  
   
 div.LC_createcourse {  div.LC_createcourse {
     margin: 10px 10px 10px 10px;      margin: 10px 10px 10px 10px;
 }  }
   
   /* ---- Remove when done ----
   # The following styles is part of the redesign of LON-CAPA and are
   # subject to change during this project.
   # Don't rely on their current functionality as they might be 
   # changed or removed.
   # --------------------------*/
   
   a:hover,
   ol.LC_smallMenu a:hover,
   ol#LC_MenuBreadcrumbs a:hover,
   ol#LC_PathBreadcrumbs a:hover,
   ul#LC_TabMainMenuContent a:hover,
   .LC_FormSectionClearButton input:hover
   ul.LC_TabContent   li:hover a{
    color:#BF2317;
           text-decoration:none;
   }
   
   h1 { 
    padding:5px 10px 5px 20px;
    line-height:130%;
   }
   
   h2,h3,h4,h5,h6
   {
    margin:5px 0px 5px 0px;
    padding:0px;
    line-height:130%;
   }
   .LC_hcell{
           padding:3px 15px 3px 15px;
           margin:0px;
    background-color:$tabbg;
    border-bottom:solid 1px $lg_border_color;       
   }
   .LC_noBorder {
           border:0px;
   }
   /*
   .LC_bgLightGrey { background:URL(images/TabMenuBG.png) repeat-x left top; }
   .LC_bgLightGreyYellow {background-color:#EFECE0;}
   */
   
   
   /* Main Header with discription of Person, Course, etc. */
   .LC_HeadRight {
    text-align: right;
    float: right;
    margin: 0px;
    padding: 0px;
           right:0;
           position:absolute;
           overflow:hidden;
   }
   
   p, .LC_ContentBox {
    padding: 10px;
   
   }
   .LC_FormSectionClearButton input {
          
           border:0px;
           cursor:pointer;
           text-decoration:underline;
   }
   
   
   dl,ul,div,fieldset {
    margin: 10px 10px 10px 0px;
    overflow:hidden;
   }
   ol.LC_smallMenu, ol#LC_PathBreadcrumbs {
    margin: 0px;
   }
   
   ol.LC_smallMenu li {
    display: inline;
    padding: 5px 5px 0px 10px;
    vertical-align: top;
   }
   
   ol.LC_smallMenu li img {
    vertical-align: bottom;
   }
   
   ol.LC_smallMenu a {
    font-size: 90%;
    color: RGB(80, 80, 80);
    text-decoration: none;
   }
   
   ol#LC_TabMainMenuContent {
    display:block;
    list-style:none;
    margin: 0px 0px 10px 0px;
    padding: 0px;
   }
   
   ol#LC_TabMainMenuContent li {
    display: inline;
    vertical-align: bottom;
    border-bottom: solid 1px RGB(175, 175, 175);
    border-right: solid 1px RGB(175, 175, 175);
    padding: 5px 10px 5px 10px;
    margin-right:3px;
    line-height: 140%;
    font-weight: bold;
    white-space:nowrap;
    background: RGB(211, 206, 205) URL(home/httpd/html/adm/lonIcons/lightGreyBG.png) repeat-x left top;
   }
   
   ol#LC_TabMainMenuContent li a{
    color: RGB(47, 47, 47);
    text-decoration: none;
   }
   ul.LC_TabContent {
    margin:0px;
    padding:0px;
    display:block;
    list-style:none;
    min-height:1.5em;
   }
   ul.LC_TabContent li{
    display:inline;
    vertical-align:top;
    border-bottom:solid 1px $lg_border_color;
    border-right:solid 1px $lg_border_color;
    padding:5px 10px 5px 10px;
    margin-right:2px;
    background:RGB(211,206,205) url(home/httpd/html/adm/lonIcons/lightGreyBG.png) repeat-x left top;
   }
   ul.LC_TabContent li a, ul.LC_TabContent li{
    color:rgb(47,47,47);
    text-decoration:none;
    font-size:95%;
    font-weight:bold;
    white-space:nowrap;
   }
   .LC_hideThis
   {
    display:none;
    visibility:hidden;
   }
   
   ol#LC_MenuBreadcrumbs, ol#LC_PathBreadcrumbs {
    border-top: solid 1px RGB(255, 255, 255);
    height: 20px;
    line-height: 20px;
    vertical-align: bottom;
    margin: 0px 0px 30px 0px;
    padding-left: 10px;
    list-style-position: inside;
    background: RGB(211, 206, 205) URL(home/httpd/html/adm/lonIcons/lightGreyBG.png) repeat-x left top;
   }
   
   ol#LC_MenuBreadcrumbs li, ol#LC_PathBreadcrumbs li {
    background: url(home/httpd/html/adm/lonIcons/pfeil_white.png) no-repeat left center;
    display: inline;
    padding: 0px 0px 0px 10px;
    vertical-align: bottom;
    overflow:hidden;
   }
   
   ol#LC_MenuBreadcrumbs li a {
    text-decoration: none;
    font-size:90%;
   }
   ol#LC_PathBreadcrumbs li a{
    text-decoration:none;
    font-size:100%;
    font-weight:bold;
   }
   .LC_ContentBoxSpecial
   {
    border: solid 1px $lg_border_color;
   }
   .LC_PopUp
   {
    padding:10px;
    border-left:solid 1px $lg_border_color;
     border-top:solid 1px $lg_border_color;
    border-bottom:outset 1px $lg_border_color;
    border-right:outset 1px $lg_border_color;
    display:none;
    position:absolute;
    right:0;
    background-color:white;
    z-index:5;
   }
   
   dl.LC_ListStyleClean dt {
    padding-right: 5px;
    display: table-header-group;
   }
   
   dl.LC_ListStyleClean dd {
    display: table-row;
   }
   
   .LC_ListStyleClean,
   .LC_ListStyleSimple,
   .LC_ListStyleNormal,
   .LC_ListStyleNormal_Border,
   .LC_ListStyleSpecial
    {
    /*display:block; */
    list-style-position: inside;
    list-style-type: none;
    overflow: hidden;
    padding: 0px;
   }
   
   .LC_ListStyleSimple li,
   .LC_ListStyleSimple dd,
   .LC_ListStyleNormal li,
   .LC_ListStyleNormal dd,
   .LC_ListStyleSpecial li,
   .LC_ListStyleSpecial dd
    {
    margin: 0px;
    padding: 5px 5px 5px 10px;
    clear: both;
   }
   
   .LC_ListStyleClean li,
   .LC_ListStyleClean dd {
    padding-top: 0px;
    padding-bottom: 0px;
   }
   
   .LC_ListStyleSimple dd,
   .LC_ListStyleSimple li{
    border-bottom: solid 1px $lg_border_color;
   }
   
   .LC_ListStyleSpecial li,
   .LC_ListStyleSpecial dd {
    list-style-type: none;
    background-color: RGB(220, 220, 220);
    margin-bottom: 4px;
   }
   
   table.LC_SimpleTable {
    margin:5px;
    border:solid 1px $lg_border_color;
    }
   
   table.LC_SimpleTable tr {
    padding:0px;
    border:solid 1px $lg_border_color;
   }
   table.LC_SimpleTable thead{
    background:rgb(220,220,220);
   }
   
   div.LC_columnSection {
    display: block;
    clear: both;
    overflow: hidden;
    margin:0px;
   }
   
   div.LC_columnSection>* {
    float: left;
    margin: 10px 20px 10px 0px;
    overflow:hidden;
   }
   div.LC_columnSection > .LC_ContentBox,
   div.LC_columnSection > .LC_ContentBoxSpecial
    {
    width: 400px;
   }
   
   .ContentBoxSpecialTemplate
   {
           border: solid 1px $lg_border_color;
   }
   .ContentBoxTemplate {
           padding:10px;
   }
   
   div.LC_columnSection > .ContentBoxTemplate,
   div.LC_columnSection > .ContentBoxSpecialTemplate
           {
           width: 600px;
   
   }
   
   .clear{
    clear: both;
    line-height: 0px;
    font-size: 0px;
    height: 0px;
   }
   
   .LC_loginpage_container {
    text-align:left;
    margin : 0 auto;
    width:65%;
    padding: 10px;
    height: auto;
    background-color:#FFFFFF;
    border:1px solid #CCCCCC;
   }
   
   
   .LC_loginpage_loginContainer {
    float:left;
    width: 182px;
    border:1px solid #CCCCCC;
    background-color:$loginbg;
   }
   
   .LC_loginpage_loginContainer h2{
    margin-top:0;
    display:block;
    background:$bgcol;
    color:$textcol;
    padding-left:5px;
   }
   .LC_loginpage_loginInfo {
    margin-left:20px;
    float:left;
    width:30%;
    border:1px solid #CCCCCC;
    padding:10px;
   }
   
   .LC_loginpage_loginDomain {
    margin-right:20px;
    width:20%;
    float:left;
    padding:10px;
   }
   
   .LC_loginpage_space {
    clear:both;
    margin-bottom:20px;
    border-bottom: 1px solid #CCCCCC;
   }
   
   .LC_loginpage_fieldset{
    border: 1px solid #CCCCCC;
    margin: 0 auto;
   }
   
   .LC_loginpage_legend{
    padding: 2px;
    margin: 0px;
    font-size:14px;
    font-weight:bold;
   }
   
   
 END  END
 }  }
   
Line 5912  sub start_page { Line 6078  sub start_page {
     }      }
   
     if ($args->{'js_ready'}) {      if ($args->{'js_ready'}) {
  $result = &js_ready($result);   $result = &js_ready($result);
     }      }
     if ($args->{'html_encode'}) {      if ($args->{'html_encode'}) {
  $result = &html_encode($result);   $result = &html_encode($result);
     }      }
     #Breadcrumbs  
     if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) {      if (exists($args->{'bread_crumbs'})) {
         &Apache::lonhtmlcommon::clear_breadcrumbs();          &Apache::lonhtmlcommon::clear_breadcrumbs();
         #if any br links exists, add them to the breadcrumbs          if (ref($args->{'bread_crumbs'}) eq 'ARRAY') {         
         if (exists($args->{'bread_crumbs'}) and ref($args->{'bread_crumbs'}) eq 'ARRAY') {  
             foreach my $crumb (@{$args->{'bread_crumbs'}}){              foreach my $crumb (@{$args->{'bread_crumbs'}}){
                 &Apache::lonhtmlcommon::add_breadcrumb($crumb);                  &Apache::lonhtmlcommon::add_breadcrumb($crumb);
             }              }
         }          }
           $result .= &Apache::lonhtmlcommon::breadcrumbs();
         #if bread_crumbs_component exists show it as headline else show only the breadcrumbs  
         if (exists($args->{'bread_crumbs_component'})){  
             $result .= &Apache::lonhtmlcommon::breadcrumbs($args->{'bread_crumbs_component'});  
         } else {  
             $result .= &Apache::lonhtmlcommon::breadcrumbs();  
         }  
     }      }
   
     return $result;      return $result;
 }  }
   
   
 =pod  =pod
   
 =item * &head()  =item * &head()
Line 6079  sub simple_error_page { Line 6240  sub simple_error_page {
     }      }
   
     sub start_data_table_empty_row {      sub start_data_table_empty_row {
  $row_count[0]++;  # $row_count[0]++;
  return  '<tr class="LC_empty_row" >'."\n";;   return  '<tr class="LC_empty_row" >'."\n";;
     }      }
   
Line 6178  sub get_users_function { Line 6339  sub get_users_function {
   
 =pod  =pod
   
 =item * &show_course()  
   
 Used by lonmenu.pm and lonroles.pm to determine whether to use the word  
 'Courses' or 'Roles' in inline navigation and on screen displaying user's roles.  
 Inputs:  
 None  
   
 Outputs:  
 Scalar: 1 if 'Course' to be used, 0 otherwise.  
   
 =cut  
   
 ###############################################  
 sub show_course {  
     my $course = !$env{'user.adv'};  
     if (!$env{'user.adv'}) {  
         foreach my $env (keys(%env)) {  
             next if ($env !~ m/^user\.priv\./);  
             if ($env !~ m/^user\.priv\.(?:st|cm)/) {  
                 $course = 0;  
                 last;  
             }  
         }  
     }  
     return $course;  
 }  
   
 ###############################################  
   
 =pod  
   
 =item * &check_user_status()  =item * &check_user_status()
   
 Determines current status of supplied role for a  Determines current status of supplied role for a
Line 6724  sub default_quota { Line 6854  sub default_quota {
                                             ['quotas'],$udom);                                              ['quotas'],$udom);
     if (ref($quotahash{'quotas'}) eq 'HASH') {      if (ref($quotahash{'quotas'}) eq 'HASH') {
         if ($inststatus ne '') {          if ($inststatus ne '') {
             my @statuses = map { &unescape($_); } split(/:/,$inststatus);              my @statuses = split(/:/,$inststatus);
             foreach my $item (@statuses) {              foreach my $item (@statuses) {
                 if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') {                  if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') {
                     if ($quotahash{'quotas'}{'defaultquota'}{$item} ne '') {                      if ($quotahash{'quotas'}{'defaultquota'}{$item} ne '') {
Line 6903  sub user_picker { Line 7033  sub user_picker {
                 if ($cancreate) {                  if ($cancreate) {
                     $new_user_create = '<p> <input type="submit" name="forcenew" value="'.&HTML::Entities::encode(&mt('Make new user "[_1]"',$srchterm),'<>&"').'" onclick="javascript:setSearch(\'1\','.$caller.');" /> </p>';                      $new_user_create = '<p> <input type="submit" name="forcenew" value="'.&HTML::Entities::encode(&mt('Make new user "[_1]"',$srchterm),'<>&"').'" onclick="javascript:setSearch(\'1\','.$caller.');" /> </p>';
                 } else {                  } else {
                     my $helplink = 'javascript:helpMenu('."'display'".')';                      my $helplink = ' href="javascript:helpMenu('."'display'".')"';
                     my %usertypetext = (                      my %usertypetext = (
                         official   => 'institutional',                          official   => 'institutional',
                         unofficial => 'non-institutional',                          unofficial => 'non-institutional',
                     );                      );
                     $new_user_create = '<p class="LC_warning">'.                      $new_user_create = '<br /><span class="LC_warning">'.&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.").' '.&mt('Contact the <a[_1]>helpdesk</a> for assistance.',$helplink).'</span><br /><br />';
                                        &mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.").' '.  
                                        &mt('Please contact the [_1]helpdesk[_2] for assistance.','<a href="'.$helplink.'">','</a>').'</p><br />';  
                 }                  }
             }              }
         }          }
Line 6947  ENDSCRIPT Line 7075  ENDSCRIPT
   
     my $output = <<"END_BLOCK";      my $output = <<"END_BLOCK";
 <script type="text/javascript">  <script type="text/javascript">
 // <![CDATA[  
 function validateEntry(callingForm) {  function validateEntry(callingForm) {
   
     var checkok = 1;      var checkok = 1;
Line 7016  function validateEntry(callingForm) { Line 7143  function validateEntry(callingForm) {
   
 $newuserscript  $newuserscript
   
 // ]]>  
 </script>  </script>
   
 $new_user_create  $new_user_create
Line 7194  sub personal_data_fieldtitles { Line 7320  sub personal_data_fieldtitles {
                         middlename => 'Middle Name',                          middlename => 'Middle Name',
                         generation => 'Generation',                          generation => 'Generation',
                         gen => 'Generation',                          gen => 'Generation',
                         inststatus => 'Affiliation',  
                    );                     );
     return %fieldtitles;      return %fieldtitles;
 }  }
Line 7264  sub get_institutional_codes { Line 7389  sub get_institutional_codes {
   
 =pod  =pod
   
 =head1 Slot Helpers  
   
 =over 4  
   
 =item * sorted_slots()  
   
 Sorts an array of slot names in order of slot start time (earliest first).  
   
 Inputs:  
   
 =over 4  
   
 slotsarr  - Reference to array of unsorted slot names.  
   
 slots     - Reference to hash of hash, where outer hash keys are slot names.  
   
 =back  
   
 Returns:  
   
 =over 4  
   
 sorted   - An array of slot names sorted by the start time of the slot.  
   
 =back  
   
 =back  
   
 =cut  
   
   
 sub sorted_slots {  
     my ($slotsarr,$slots) = @_;  
     my @sorted;  
     if ((ref($slotsarr) eq 'ARRAY') && (ref($slots) eq 'HASH')) {  
         @sorted =  
             sort {  
                      if (ref($slots->{$a}) && ref($slots->{$b})) {  
                          return $slots->{$a}{'starttime'} <=> $slots->{$b}{'starttime'}  
                      }  
                      if (ref($slots->{$a})) { return -1;}  
                      if (ref($slots->{$b})) { return 1;}  
                      return 0;  
                  } @{$slotsarr};  
     }  
     return @sorted;  
 }  
   
 =pod  
   
 =back  =back
   
 =head1 HTTP Helpers  =head1 HTTP Helpers
Line 7605  sub upload_embedded { Line 7680  sub upload_embedded {
                                    '&nbsp;<a href="'.$url.'">'.                                     '&nbsp;<a href="'.$url.'">'.
                                    $orig_uploaded_filename.'</a><br />';                                     $orig_uploaded_filename.'</a><br />';
                     } else {                      } else {
                         $output .= '<font size="+2">'.                          $output .= '<span class=\"LC_fontsize_large\">'.
                                    &mt('View embedded file: [_1]','<a href="'.$url.'">'.                                     &mt('View embedded file: [_1]','<a href="'.$url.'">'.
                                    $orig_uploaded_filename.'</a>').'</font><br />';                                     $orig_uploaded_filename.'</a>').'</span><br />';
                     }                      }
                 }                  }
                 close($fh);                  close($fh);
Line 7866  sub upfile_select_html { Line 7941  sub upfile_select_html {
 #                 xml   => &mt('HTML/XML'),  #                 xml   => &mt('HTML/XML'),
                  );                   );
     my $Str = '<input type="file" name="upfile" size="50" />'.      my $Str = '<input type="file" name="upfile" size="50" />'.
         '<br />'.&mt('Type').': <select name="upfiletype">';          '<br />Type: <select name="upfiletype">';
     foreach my $type (sort(keys(%Types))) {      foreach my $type (sort(keys(%Types))) {
         $Str .= '<option value="'.$type.'" >'.$Types{$type}."</option>\n";          $Str .= '<option value="'.$type.'" >'.$Types{$type}."</option>\n";
     }      }
Line 7954  sub csv_print_select_table { Line 8029  sub csv_print_select_table {
               &end_data_table_header_row()."\n");                &end_data_table_header_row()."\n");
     foreach my $array_ref (@$d) {      foreach my $array_ref (@$d) {
  my ($value,$display,$defaultcol)=@{ $array_ref };   my ($value,$display,$defaultcol)=@{ $array_ref };
  $r->print(&start_data_table_row().'<td>'.$display.'</td>');   $r->print(&start_data_table_row().'<tr><td>'.$display.'</td>');
   
  $r->print('<td><select name=f'.$i.   $r->print('<td><select name=f'.$i.
   ' onchange="javascript:flip(this.form,'.$i.');">');    ' onchange="javascript:flip(this.form,'.$i.');">');
Line 8610  sub restore_settings { Line 8685  sub restore_settings {
   
 =item * &build_recipient_list()  =item * &build_recipient_list()
   
 Build recipient lists for four types of e-mail:  Build recipient lists for three types of e-mail:
 (a) Error Reports, (b) Package Updates, (c) lonstatus warnings/errors  (a) Error Reports, (b) Package Updates, (c) Help requests, generated by
 (d) Help requests, generated by  lonerrorhandler.pm, CHECKRPMS and lonsupportreq.pm respectively.
 lonerrorhandler.pm, CHECKRPMS, loncron, and lonsupportreq.pm respectively.  
   
 Inputs:  Inputs:
 defmail (scalar - email address of default recipient),   defmail (scalar - email address of default recipient), 
Line 8637  sub build_recipient_list { Line 8711  sub build_recipient_list {
     my %domconfig =      my %domconfig =
          &Apache::lonnet::get_dom('configuration',['contacts'],$defdom);           &Apache::lonnet::get_dom('configuration',['contacts'],$defdom);
     if (ref($domconfig{'contacts'}) eq 'HASH') {      if (ref($domconfig{'contacts'}) eq 'HASH') {
         if (exists($domconfig{'contacts'}{$mailing})) {          if (ref($domconfig{'contacts'}{$mailing}) eq 'HASH') {
             if (ref($domconfig{'contacts'}{$mailing}) eq 'HASH') {              my @contacts = ('adminemail','supportemail');
                 my @contacts = ('adminemail','supportemail');              foreach my $item (@contacts) {
                 foreach my $item (@contacts) {                  if ($domconfig{'contacts'}{$mailing}{$item}) {
                     if ($domconfig{'contacts'}{$mailing}{$item}) {                      my $addr = $domconfig{'contacts'}{$item}; 
                         my $addr = $domconfig{'contacts'}{$item};                      if (!grep(/^\Q$addr\E$/,@recipients)) {
                         if (!grep(/^\Q$addr\E$/,@recipients)) {                          push(@recipients,$addr);
                             push(@recipients,$addr);  
                         }  
                     }                      }
                     $otheremails = $domconfig{'contacts'}{$mailing}{'others'};  
                 }                  }
                   $otheremails = $domconfig{'contacts'}{$mailing}{'others'};
             }              }
         } elsif ($origmail ne '') {  
             push(@recipients,$origmail);  
         }          }
     } elsif ($origmail ne '') {      } elsif ($origmail ne '') {
         push(@recipients,$origmail);          push(@recipients,$origmail);
Line 9295  sub construct_course { Line 9365  sub construct_course {
                    'policy.email',                     'policy.email',
                    'comment.email',                     'comment.email',
                    'pch.users.denied',                     'pch.users.denied',
                    'plc.users.denied',                     'plc.users.denied'],
                    'hidefromcat',  
                    'categories'],  
                    $$crsudom,$$crsunum);                     $$crsudom,$$crsunum);
     }      }
   
Line 9625  sub escape_url { Line 9693  sub escape_url {
     return join('/',@urlslices).'/'.$lastitem;      return join('/',@urlslices).'/'.$lastitem;
 }  }
   
 sub compare_arrays {  
     my ($arrayref1,$arrayref2) = @_;  
     my (@difference,%count);  
     @difference = ();  
     %count = ();  
     if ((ref($arrayref1) eq 'ARRAY') && (ref($arrayref2) eq 'ARRAY')) {  
         foreach my $element (@{$arrayref1}, @{$arrayref2}) { $count{$element}++; }  
         foreach my $element (keys(%count)) {  
             if ($count{$element} == 1) {  
                 push(@difference,$element);  
             }  
         }  
     }  
     return @difference;  
 }  
   
 # -------------------------------------------------------- Initliaze user login  # -------------------------------------------------------- Initliaze user login
 sub init_user_environment {  sub init_user_environment {
     my ($r, $username, $domain, $authhost, $form, $args) = @_;      my ($r, $username, $domain, $authhost, $form, $args) = @_;
Line 9771  sub init_user_environment { Line 9823  sub init_user_environment {
     }      }
  }   }
   
         foreach my $tool ('aboutme','blog','portfolio') {  
             $userenv{'availabletools.'.$tool} =  
                 &Apache::lonnet::usertools_access($username,$domain,$tool,'reload');  
         }  
   
         foreach my $crstype ('official','unofficial') {  
             $userenv{'canrequest.'.$crstype} =  
                 &Apache::lonnet::usertools_access($username,$domain,$crstype,  
                                                   'reload','requestcourses');  
         }  
   
  $env{'user.environment'} = "$lonids/$cookie.id";   $env{'user.environment'} = "$lonids/$cookie.id";
   
  if (tie(my %disk_env,'GDBM_File',"$lonids/$cookie.id",   if (tie(my %disk_env,'GDBM_File',"$lonids/$cookie.id",
Line 9794  sub init_user_environment { Line 9835  sub init_user_environment {
     }      }
     untie(%disk_env);      untie(%disk_env);
  } else {   } else {
     &Apache::lonnet::logthis("<font color=\"blue\">WARNING: ".      &Apache::lonnet::logthis("<span style=\"color:blue;\">WARNING: ".
    'Could not create environment storage in lonauth: '.$!.'</font>');     'Could not create environment storage in lonauth: '.$!.'</span>');
     return 'error: '.$!;      return 'error: '.$!;
  }   }
     }      }
Line 9820  sub _add_to_env { Line 9861  sub _add_to_env {
 # --- Get the symbolic name of a problem and the url  # --- Get the symbolic name of a problem and the url
 sub get_symb {  sub get_symb {
     my ($request,$silent) = @_;      my ($request,$silent) = @_;
     (my $url=$env{'form.url'}) =~ s-^https?\://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;      (my $url=$env{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
     my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url)));      my $symb=($env{'form.symb'} ne '' ? $env{'form.symb'} : (&Apache::lonnet::symbread($url)));
     if ($symb eq '') {      if ($symb eq '') {
         if (!$silent) {          if (!$silent) {
Line 9847  sub get_annotation { Line 9888  sub get_annotation {
 }  }
   
 sub clean_symb {  sub clean_symb {
     my ($symb,$delete_enc) = @_;      my ($symb) = @_;
   
     &Apache::lonenc::check_decrypt(\$symb);      &Apache::lonenc::check_decrypt(\$symb);
     my $enc = $env{'request.enc'};      my $enc = $env{'request.enc'};
     if ($delete_enc) {      delete($env{'request.enc'});
         delete($env{'request.enc'});  
     }  
   
     return ($symb,$enc);      return ($symb,$enc);
 }  }

Removed from v.1.692.4.4  
changed lines
  Added in v.1.721


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