Diff for /loncom/interface/loncommon.pm between versions 1.850 and 1.905

version 1.850, 2009/07/06 15:29:31 version 1.905, 2009/10/30 04:44:56
Line 482  ENDAUTHORBRW Line 482  ENDAUTHORBRW
 }  }
   
 sub coursebrowser_javascript {  sub coursebrowser_javascript {
     my ($domainfilter,$sec_element,$formname)=@_;      my ($domainfilter,$sec_element,$formname,$role_element)=@_;
     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 Community - for which you wish to add/modify a user role.');
    my $output = '      my $id_functions = &javascript_index_functions();
       my $output = '
 <script type="text/javascript" language="JavaScript">  <script type="text/javascript" language="JavaScript">
 // <![CDATA[  // <![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) {
         var url = '/adm/pickcourse?';          var url = '/adm/pickcourse?';
         var domainfilter = '';  
         var formid = getFormIdByName(formname);          var formid = getFormIdByName(formname);
         if (formid > -1) {          var domainfilter = getDomainFromSelectbox(formname,udom);
             var domid = getIndexByName(formid,udom);  
             if (domid > -1) {  
                 if (document.forms[formid].elements[domid].type == 'select-one') {  
                     domainfilter=document.forms[formid].elements[domid].options[document.forms[formid].elements[domid].selectedIndex].value;  
                 }  
                 if (document.forms[formid].elements[domid].type == 'hidden') {  
                     domainfilter=document.forms[formid].elements[domid].value;  
                 }  
             }  
         }  
         if (domainfilter != null) {          if (domainfilter != null) {
            if (domainfilter != '') {             if (domainfilter != '') {
                url += 'domainfilter='+domainfilter+'&';                 url += 'domainfilter='+domainfilter+'&';
Line 529  sub coursebrowser_javascript { Line 520  sub coursebrowser_javascript {
                 }                  }
             }                   }     
         }          }
           if (formname == 'ccrs') {
               var ownername = document.forms[formid].ccuname.value;
               var ownerdom =  document.forms[formid].ccdomain.options[document.forms[formid].ccdomain.selectedIndex].value;
               url += '&cloner='+ownername+':'+ownerdom;
           }
         if (multflag !=null && multflag != '') {          if (multflag !=null && multflag != '') {
             url += '&multiple='+multflag;              url += '&multiple='+multflag;
         }          }
         if (crstype == 'Course/Group') {          if (crstype == 'Course/Community') {
             if (formname == 'cu') {              if (formname == 'cu') {
                 crstype = document.cu.crstype.options[document.cu.crstype.selectedIndex].value;                   crstype = document.cu.crstype.options[document.cu.crstype.selectedIndex].value; 
                 if (crstype == "") {                  if (crstype == "") {
Line 550  sub coursebrowser_javascript { Line 546  sub coursebrowser_javascript {
         stdeditbrowser = open(url,title,options,'1');          stdeditbrowser = open(url,title,options,'1');
         stdeditbrowser.focus();          stdeditbrowser.focus();
     }      }
   $id_functions
   ENDSTDBRW
       if (($sec_element ne '') || ($role_element ne '')) {
           $output .= &setsec_javascript($sec_element,$formname,$role_element);
       }
       $output .= '
   // ]]>
   </script>';
       return $output;
   }
   
     function getFormIdByName(formname) {  sub javascript_index_functions {
         for (var i=0;i<document.forms.length;i++) {      return <<"ENDJS";
             if (document.forms[i].name == formname) {  
                 return i;  function getFormIdByName(formname) {
             }      for (var i=0;i<document.forms.length;i++) {
           if (document.forms[i].name == formname) {
               return i;
         }          }
         return -1;   
     }      }
       return -1;
   }
   
     function getIndexByName(formid,item) {  function getIndexByName(formid,item) {
         for (var i=0;i<document.forms[formid].elements.length;i++) {      for (var i=0;i<document.forms[formid].elements.length;i++) {
             if (document.forms[formid].elements[i].name == item) {          if (document.forms[formid].elements[i].name == item) {
                 return i;              return i;
           }
       }
       return -1;
   }
   
   function getDomainFromSelectbox(formname,udom) {
       var userdom;
       var formid = getFormIdByName(formname);
       if (formid > -1) {
           var domid = getIndexByName(formid,udom);
           if (domid > -1) {
               if (document.forms[formid].elements[domid].type == 'select-one') {
                   userdom=document.forms[formid].elements[domid].options[document.forms[formid].elements[domid].selectedIndex].value;
               }
               if (document.forms[formid].elements[domid].type == 'hidden') {
                   userdom=document.forms[formid].elements[domid].value;
             }              }
         }          }
         return -1;  
     }      }
 ENDSTDBRW      return userdom;
     if ($sec_element ne '') {  }
         $output .= &setsec_javascript($sec_element,$formname);  
   ENDJS
   
   }
   
   sub userbrowser_javascript {
       my $id_functions = &javascript_index_functions();
       return <<"ENDUSERBRW";
   
   function openuserbrowser(formname,uname,udom,ulast,ufirst,uemail,hideudom,crsdom,caller) {
       var url = '/adm/pickuser?';
       var userdom = getDomainFromSelectbox(formname,udom);
       if (userdom != null) {
          if (userdom != '') {
              url += 'srchdom='+userdom+'&';
          }
     }      }
     $output .= '      url += 'form=' + formname + '&unameelement='+uname+
 // ]]>                                  '&udomelement='+udom+
 </script>';                                  '&ulastelement='+ulast+
     return $output;                                  '&ufirstelement='+ufirst+
                                   '&uemailelement='+uemail+
                                   '&hideudomelement='+hideudom+
                                   '&coursedom='+crsdom;
       if ((caller != null) && (caller != undefined)) {
           url += '&caller='+caller;
       }
       var title = 'User_Browser';
       var options = 'scrollbars=1,resizable=1,menubar=0';
       options += ',width=700,height=600';
       var stdeditbrowser = open(url,title,options,'1');
       stdeditbrowser.focus();
   }
   
   function fix_domain (formname,udom,origdom,uname) {
       var formid = getFormIdByName(formname);
       if (formid > -1) {
           var unameid = getIndexByName(formid,uname);
           var domid = getIndexByName(formid,udom);
           var hidedomid = getIndexByName(formid,origdom);
           if (hidedomid > -1) {
               var fixeddom = document.forms[formid].elements[hidedomid].value;
               var unameval = document.forms[formid].elements[unameid].value;
               if ((fixeddom != '') && (fixeddom != undefined) && (fixeddom != null) && (unameval != '') && (unameval != undefined) && (unameval != null)) {
                   if (domid > -1) {
                       var slct = document.forms[formid].elements[domid];
                       if (slct.type == 'select-one') {
                           var i;
                           for (i=0;i<slct.length;i++) {
                               if (slct.options[i].value==fixeddom) { slct.selectedIndex=i; }
                           }
                       }
                       if (slct.type == 'hidden') {
                           slct.value = fixeddom;
                       }
                   }
               }
           }
       }
       return;
   }
   
   $id_functions
   ENDUSERBRW
 }  }
   
 sub setsec_javascript {  sub setsec_javascript {
     my ($sec_element,$formname) = @_;      my ($sec_element,$formname,$role_element) = @_;
       my (@courserolenames,@communityrolenames,$rolestr,$courserolestr,
           $communityrolestr);
       if ($role_element ne '') {
           my @allroles = ('st','ta','ep','in','ad');
           foreach my $crstype ('Course','Community') {
               if ($crstype eq 'Community') {
                   foreach my $role (@allroles) {
                       push(@communityrolenames,&Apache::lonnet::plaintext($role,$crstype));
                   }
                   push(@communityrolenames,&Apache::lonnet::plaintext('co'));
               } else {
                   foreach my $role (@allroles) {
                       push(@courserolenames,&Apache::lonnet::plaintext($role,$crstype));
                   }
                   push(@courserolenames,&Apache::lonnet::plaintext('cc'));
               }
           }
           $rolestr = '"'.join('","',@allroles).'"';
           $courserolestr = '"'.join('","',@courserolenames).'"';
           $communityrolestr = '"'.join('","',@communityrolenames).'"';
       }
     my $setsections = qq|      my $setsections = qq|
 function setSect(sectionlist) {  function setSect(sectionlist) {
     var sectionsArray = new Array();      var sectionsArray = new Array();
Line 613  function setSect(sectionlist) { Line 716  function setSect(sectionlist) {
         }          }
     }      }
 }  }
   
   function setRole(crstype) {
   |;
       if ($role_element eq '') {
           $setsections .= '    return;
   }
   ';
       } else {
           $setsections .= qq|
       var elementLength = document.$formname.$role_element.length;
       var allroles = Array($rolestr);
       var courserolenames = Array($courserolestr);
       var communityrolenames = Array($communityrolestr);
       if (elementLength != undefined) {
           if (document.$formname.$role_element.options[5].value == 'cc') {
               if (crstype == 'Course') {
                   return;
               } else {
                   allroles[5] = 'co';
                   for (var i=0; i<6; i++) {
                       document.$formname.$role_element.options[i].value = allroles[i];
                       document.$formname.$role_element.options[i].text = communityrolenames[i];
                   }
               }
           } else {
               if (crstype == 'Community') {
                   return;
               } else {
                   allroles[5] = 'cc';
                   for (var i=0; i<6; i++) {
                       document.$formname.$role_element.options[i].value = allroles[i];
                       document.$formname.$role_element.options[i].text = courserolenames[i];
                   }
               }
           }
       }
       return;
   }
 |;  |;
       }
     return $setsections;      return $setsections;
 }  }
   
   
 sub selectcourse_link {  sub selectcourse_link {
    my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;     my ($form,$unameele,$udomele,$desc,$extra_element,$multflag,$selecttype)=@_;
      my $linktext = &mt('Select Course');
      if ($selecttype eq 'Community') {
          $linktext = &mt('Select Community'); 
      }
    return '<span class="LC_nobreak">'     return '<span class="LC_nobreak">'
          ."<a href='"           ."<a href='"
          .'javascript:opencrsbrowser("'.$form.'","'.$unameele           .'javascript:opencrsbrowser("'.$form.'","'.$unameele
          .'","'.$udomele.'","'.$desc.'","'.$extra_element           .'","'.$udomele.'","'.$desc.'","'.$extra_element
          .'","'.$multflag.'","'.$selecttype.'");'           .'","'.$multflag.'","'.$selecttype.'");'
          ."'>".&mt('Select Course').'</a>'           ."'>".$linktext.'</a>'
          .'</span>';           .'</span>';
 }  }
   
Line 635  sub selectauthor_link { Line 780  sub selectauthor_link {
           &mt('Select Author').'</a>';            &mt('Select Author').'</a>';
 }  }
   
   sub selectuser_link {
       my ($form,$unameelem,$domelem,$lastelem,$firstelem,$emailelem,$hdomelem,
           $coursedom,$linktext,$caller) = @_;
       return '<a href="javascript:openuserbrowser('."'$form','$unameelem','$domelem',".
              "'$lastelem','$firstelem','$emailelem','$hdomelem','$coursedom','$caller'".
              ');">'.$linktext.'</a>';
   }
   
 sub check_uncheck_jscript {  sub check_uncheck_jscript {
     my $jscript = <<"ENDSCRT";      my $jscript = <<"ENDSCRT";
 function checkAll(field) {  function checkAll(field) {
Line 1111  sub help_menu_js { Line 1264  sub help_menu_js {
   
     my $template .= <<"ENDTEMPLATE";      my $template .= <<"ENDTEMPLATE";
 <script type="text/javascript">  <script type="text/javascript">
 // <!-- BEGIN LON-CAPA Internal  
 // <![CDATA[  // <![CDATA[
   // <!-- BEGIN LON-CAPA Internal
 var banner_link = '';  var banner_link = '';
 function helpMenu(target) {  function helpMenu(target) {
     var caller = this;      var caller = this;
Line 1137  function writeHelp(caller) { Line 1290  function writeHelp(caller) {
     caller.document.close()      caller.document.close()
     caller.focus()      caller.focus()
 }  }
 // ]]>  
 // END LON-CAPA Internal -->  // END LON-CAPA Internal -->
   // ]]>
 </script>  </script>
 ENDTEMPLATE  ENDTEMPLATE
     return $template;      return $template;
Line 1787  sub select_level_form { Line 1940  sub select_level_form {
   
 =pod  =pod
   
 =item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$autosubmit)  =item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange)
   
 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 1798  selected"); Line 1951  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.    The optional $onchange argumnet specifies what should occur if the domain selector is changed, e.g., 'this.form.submit()' if the form is to be automatically submitted.  
   
 =cut  =cut
   
 #-------------------------------------------  #-------------------------------------------
 sub select_dom_form {  sub select_dom_form {
     my ($defdom,$name,$includeempty,$showdomdesc,$autosubmit) = @_;      my ($defdom,$name,$includeempty,$showdomdesc,$onchange) = @_;
     my $onchange;      if ($onchange) {
     if ($autosubmit) {          $onchange = ' onchange="'.$onchange.'"';
         $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); }
Line 2862  sub messagewrapper { Line 3014  sub messagewrapper {
 sub noteswrapper {  sub noteswrapper {
     my ($link,$un,$do)=@_;      my ($link,$un,$do)=@_;
     return       return 
 "<a href='/adm/email?recordftf=retrieve&recname=$un&recdom=$do'>$link</a>";  "<a href='/adm/email?recordftf=retrieve&amp;recname=$un&amp;recdom=$do'>$link</a>";
 }  }
   
 # ------------------------------------------------------------- Aboutme Wrapper  # ------------------------------------------------------------- Aboutme Wrapper
Line 2872  sub aboutmewrapper { Line 3024  sub aboutmewrapper {
     if (!defined($username)  && !defined($domain)) {      if (!defined($username)  && !defined($domain)) {
         return;          return;
     }      }
     return '<a href="/adm/'.$domain.'/'.$username.'/aboutme"'.      return '<a href="/adm/'.$domain.'/'.$username.'/aboutme?forcestudent=1"'.
  ($target?' target="$target"':'').' title="'.&mt("View this user's personal information page").'">'.$link.'</a>';   ($target?' target="$target"':'').' title="'.&mt("View this user's personal information page").'">'.$link.'</a>';
 }  }
   
Line 2886  sub syllabuswrapper { Line 3038  sub syllabuswrapper {
 # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
   
 sub track_student_link {  sub track_student_link {
     my ($linktext,$sname,$sdom,$target,$start) = @_;      my ($linktext,$sname,$sdom,$target,$start,$only_body) = @_;
     my $link ="/adm/trackstudent?";      my $link ="/adm/trackstudent?";
     my $title = 'View recent activity';      my $title = 'View recent activity';
     if (defined($sname) && $sname !~ /^\s*$/ &&      if (defined($sname) && $sname !~ /^\s*$/ &&
Line 2900  sub track_student_link { Line 3052  sub track_student_link {
         $target = '';          $target = '';
     }      }
     if ($start) { $link.='&amp;start='.$start; }      if ($start) { $link.='&amp;start='.$start; }
       if ($only_body) { $link .= '&amp;only_body=1'; }
     $title = &mt($title);      $title = &mt($title);
     $linktext = &mt($linktext);      $linktext = &mt($linktext);
     return qq{<a href="$link" title="$title" $target>$linktext</a>}.      return qq{<a href="$link" title="$title" $target>$linktext</a>}.
Line 3766  sub blockcheck { Line 3919  sub blockcheck {
                  ($env{'request.role'} !~ m{^st\./\Q$cdom\E/\Q$cnum\E}));                   ($env{'request.role'} !~ m{^st\./\Q$cdom\E/\Q$cnum\E}));
         next if ($no_userblock);          next if ($no_userblock);
   
         # Retrieve blocking times and identity of blocker for course          # Retrieve blocking times and identity of locker for course
         # of specified user, unless user has 'evb' privilege.          # of specified user, unless user has 'evb' privilege.
                   
         my ($start,$end)=&get_blocks($setters,$activity,$cdom,$cnum);          my ($start,$end)=&get_blocks($setters,$activity,$cdom,$cnum);
Line 3831  sub parse_block_record { Line 3984  sub parse_block_record {
     return ($setuname,$setudom,$title,$blocks);      return ($setuname,$setudom,$title,$blocks);
 }  }
   
 sub build_block_table {  
     my ($startblock,$endblock,$setters) = @_;  
     my %lt = &Apache::lonlocal::texthash(  
         'cacb' => 'Currently active communication blocks',  
         'cour' => 'Course',  
         'dura' => 'Duration',  
         'blse' => 'Block set by'  
     );  
     my $output;  
     $output = '<br />'.$lt{'cacb'}.':<br />';  
     $output .= &start_data_table();  
     $output .= '  
 <tr>  
  <th>'.$lt{'cour'}.'</th>  
  <th>'.$lt{'dura'}.'</th>  
  <th>'.$lt{'blse'}.'</th>  
 </tr>  
 ';  
     foreach my $course (keys(%{$setters})) {  
         my %courseinfo=&Apache::lonnet::coursedescription($course);  
         for (my $i=0; $i<@{$$setters{$course}{staff}}; $i++) {  
             my ($uname,$udom) = @{$$setters{$course}{staff}[$i]};  
             my $fullname = &plainname($uname,$udom);  
             if (defined($env{'user.name'}) && defined($env{'user.domain'})  
                 && $env{'user.name'} ne 'public'   
                 && $env{'user.domain'} ne 'public') {  
                 $fullname = &aboutmewrapper($fullname,$uname,$udom);  
             }  
             my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]};  
             $openblock = &Apache::lonlocal::locallocaltime($openblock);  
             $closeblock= &Apache::lonlocal::locallocaltime($closeblock);  
             $output .= &Apache::loncommon::start_data_table_row().  
                        '<td>'.$courseinfo{'description'}.'</td>'.  
                        '<td>'.$openblock.' to '.$closeblock.'</td>'.  
                        '<td>'.$fullname.'</td>'.  
                         &Apache::loncommon::end_data_table_row();  
         }  
     }  
     $output .= &end_data_table();  
 }  
   
 sub blocking_status {  sub blocking_status {
     my ($activity,$uname,$udom) = @_;    my ($activity,$uname,$udom) = @_;
     my %setters;    my %setters;
     my ($blocked,$output,$ownitem,$is_course);  
     my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom);    # check for active blocking
     if ($startblock && $endblock) {    my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom);
         $blocked = 1;  
         if (wantarray) {    my $blocked = $startblock && $endblock ? 1 : 0;
             my $category;  
             if ($activity eq 'boards') {    # caller just wants to know whether a block is active
                 $category = 'Discussion posts in this course';    if (!wantarray) { return $blocked; }
             } elsif ($activity eq 'blogs') {  
                 $category = 'Blogs';    # build a link to a popup window containing the details
             } elsif ($activity eq 'port') {    my $querystring  = "?activity=$activity";
                 if (defined($uname) && defined($udom)) {    # $uname and $udom decide whose portfolio the user is trying to look at
                     if ($uname eq $env{'user.name'} &&       $querystring .= "&amp;udom=$udom"      if $udom;
                         $udom eq $env{'user.domain'}) {       $querystring .= "&amp;uname=$uname"    if $uname;
                         $ownitem = 1;  
                     }    my $output .= <<'END_MYBLOCK';
                 }      function openWindow(url, wdwName, w, h, toolbar,scrollbar) {
                 $is_course = &Apache::lonnet::is_course($udom,$uname);          var options = "width=" + w + ",height=" + h + ",";
                 if ($ownitem) {           options += "resizable=yes,scrollbars="+scrollbar+",status=no,";
                     $category = 'Your portfolio files';            options += "menubar=no,toolbar="+toolbar+",location=no,directories=no";
                 } elsif ($is_course) {          var newWin = window.open(url, wdwName, options);
                     my $coursedesc;          newWin.focus();
                     foreach my $course (keys(%setters)) {      }
                         my %courseinfo =  END_MYBLOCK
                              &Apache::lonnet::coursedescription($course);  
                         $coursedesc = $courseinfo{'description'};    $output = Apache::lonhtmlcommon::scripttag($output);
                     }    
                     $category = "Group portfolio in the course '$coursedesc'";    my $popupUrl = "/adm/blockingstatus/$querystring";
                 } else {    my $text = mt('Communication Blocked');
                     $category = 'Portfolio files belonging to ';  
                     if ($env{'user.name'} eq 'public' &&     $output .= <<"END_BLOCK";
                         $env{'user.domain'} eq 'public') {  <div class='LC_comblock'>
                         $category .= &plainname($uname,$udom);    <a onclick='openWindow("$popupUrl","Blocking Table",600,300,"no","no");return false;' href='/adm/blockingstatus/$querystring'
                     } else {    title='$text'>
                         $category .= &aboutmewrapper(&plainname($uname,$udom),$uname,$udom);      <img class='LC_noBorder LC_middle' title='$text' src='/res/adm/pages/comblock.png' alt='$text'/></a>
                     }    <a onclick='openWindow("$popupUrl","Blocking Table",600,300,"no","no");return false;' href='/adm/blockingstatus/$querystring' 
                 }    title='$text'>$text</a>
             } elsif ($activity eq 'groups') {  </div>
                 $category = 'Groups in this course';  
             }  END_BLOCK
             my $showstart = &Apache::lonlocal::locallocaltime($startblock);  
             my $showend = &Apache::lonlocal::locallocaltime($endblock);    return ($blocked, $output);
             $output = '<br />'.&mt('[_1] will be inaccessible between [_2] and [_3] because communication is being blocked.',$category,$showstart,$showend).'<br />';  
             if (!($activity eq 'port' && !($ownitem) && !($is_course))) {   
                 $output .= &build_block_table($startblock,$endblock,\%setters);  
             }  
         }  
     }  
     if (wantarray) {  
         return ($blocked,$output);  
     } else {  
         return $blocked;  
     }  
 }  }
   
 ###############################################  ###############################################
Line 4005  sub determinedomain { Line 4106  sub determinedomain {
     my $domain=shift;      my $domain=shift;
     if (! $domain) {      if (! $domain) {
         # Determine domain if we have not been given one          # Determine domain if we have not been given one
         $domain = $Apache::lonnet::perlvar{'lonDefDomain'};          $domain = &Apache::lonnet::default_login_domain();
         if ($env{'user.domain'}) { $domain=$env{'user.domain'}; }          if ($env{'user.domain'}) { $domain=$env{'user.domain'}; }
         if ($env{'request.role.domain'}) {           if ($env{'request.role.domain'}) { 
             $domain=$env{'request.role.domain'};               $domain=$env{'request.role.domain'}; 
Line 4355  sub bodytag { Line 4456  sub bodytag {
         if ($env{'request.role'} !~ /^cr/) {          if ($env{'request.role'} !~ /^cr/) {
             $role = &Apache::lonnet::plaintext($role,&course_type());              $role = &Apache::lonnet::plaintext($role,&course_type());
         }          }
           if ($env{'request.course.sec'}) {
               $role .= ('&nbsp;'x2).'-&nbsp;'.&mt('section:').'&nbsp;'.$env{'request.course.sec'};
           }   
  $realm = $env{'course.'.$env{'request.course.id'}.'.description'};   $realm = $env{'course.'.$env{'request.course.id'}.'.description'};
     } else {      } else {
         $role = &Apache::lonnet::plaintext($role);          $role = &Apache::lonnet::plaintext($role);
Line 4394  sub bodytag { Line 4498  sub bodytag {
         $dc_info = '('.$dc_info.')';          $dc_info = '('.$dc_info.')';
     }      }
   
       $role = '<span class="LC_nobreak">('.$role.')</span>' if $role;
       &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
   
     if ($env{'environment.remote'} eq 'off') {      if ($env{'environment.remote'} eq 'off') {
         # No Remote          # No Remote
  if ($env{'request.state'} eq 'construct') {          if ($no_nav_bar) { return $bodytag; } 
     $forcereg=1;  
  }  
   
 #    if ($env{'request.state'} eq 'construct') {          if ($env{'request.state'} eq 'construct') { $forcereg=1; }
 #        $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls  
 #    }  
   
         my $titletable = '<table id="LC_title_bar">'  
                         ."<tr><td> $titleinfo $dc_info</td>"  
                         .'</tr></table>';  
   
  if ($no_nav_bar) {          #    if ($env{'request.state'} eq 'construct') {
     $bodytag .= $titletable;          #        $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
  } else {          #    }
         $bodytag .= qq|<div id="LC_nav_bar">$name ($role)<br />  
             <em>$realm</em> $dc_info</div>|;          $bodytag .= qq|<div id="LC_nav_bar">$name $role<br />
     if ($env{'request.state'} eq 'construct') {              <em>$realm</em> $dc_info</div>| unless $env{'form.inhibitmenu'};
                 $bodytag .= &Apache::lonmenu::menubuttons($forcereg,$forcereg,  
   $titletable);          if (   $env{'form.inhibitmenu'} eq 'yes' 
             } else {              || $ENV{'REQUEST_URI'} eq '/adm/logout'
                 $bodytag .= &Apache::lonmenu::menubuttons($forcereg,$forcereg).              || $env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {
     $titletable;  
             }              return $bodytag;
         }          }
   
           $bodytag .= Apache::lonhtmlcommon::scripttag(
               Apache::lonmenu::utilityfunctions(), 'start');
   
           $bodytag .= Apache::lonmenu::primary_menu();
   
           #don't show menus for public users
           if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){
               $bodytag .= Apache::lonmenu::secondary_menu();
               $bodytag .= Apache::lonmenu::serverform();
               $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); 
               $bodytag .= Apache::lonmenu::innerregister($forcereg) if $forcereg;
           }else{
               # this is to seperate menu from content when there's no secondary
               # menu. Especially needed for public accessible ressources.
               $bodytag .= '<hr style="clear:both" />';
               $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); 
           }
   
           #SD testing
           #$bodytag .= Apache::lonmenu::menubuttons($forcereg);
         return $bodytag;          return $bodytag;
     }      }
   
Line 4436  sub bodytag { Line 4556  sub bodytag {
   
     # Explicit link to get inline menu      # Explicit link to get inline menu
     my $menu= ($no_inline_link?''      my $menu= ($no_inline_link?''
        :'<br /><a href="/adm/remote?action=collapse">'.&mt('Switch to Inline Menu Mode').'</a>');         :'<a href="/adm/remote?action=collapse" target="_top">'.&mt('Switch to Inline Menu Mode').'</a>');
       $bodytag .= qq|<div id="LC_nav_bar">$name $role
               <em>$realm</em> $dc_info </div>
               <ol class="LC_primary_menu LC_right">
                   <li>$menu</li>
               </ol>| unless $env{'form.inhibitmenu'};
     #      #
     return(<<ENDBODY);      return(<<ENDBODY);
 $bodytag  $bodytag
Line 4605  a:focus { Line 4730  a:focus {
   background: yellow     background: yellow 
 }  }
   
 hr {  
   clear: both;  
   color: $tabbg;  
   background-color: $tabbg;  
   height: 3px;  
   border: none;  
 }  
   
 form, .inline {   form, .inline { 
    display: inline;      display: inline; 
 }  }
Line 4822  table#LC_mainmenu td.LC_mainmenu_column Line 4939  table#LC_mainmenu td.LC_mainmenu_column
  clear:both;   clear:both;
  background: $sidebg;   background: $sidebg;
  border-bottom: 1px solid $lg_border_color;   border-bottom: 1px solid $lg_border_color;
  line-height: 32px;    line-height: 2.5em; 
    /* SD working here
    height: 2.5em;
    overflow: hidden; */
  margin: 0;   margin: 0;
  padding: 0;   padding: 0;
 }  }
   
 /* Preliminary fix to hide breadcrumbs inside remote control window */  /* Preliminary fix to hide breadcrumbs inside remote control window */
 #LC_remote #LC_breadcrumbs {  #LC_remote #LC_breadcrumbs {
     display:none;      display:none;
Line 4877  td.LC_menubuttons_text { Line 4998  td.LC_menubuttons_text {
   font-weight: bold;    font-weight: bold;
 }  }
   
 .LC_roleslog_note {  
   font-size: small;  
 }  
   
 table.LC_data_table,  table.LC_data_table,
 table.LC_mail_list {  table.LC_mail_list {
   border: 1px solid #000000;    border: 1px solid #000000;
Line 4900  table.LC_nested_outer { Line 5017  table.LC_nested_outer {
   width: 100%;    width: 100%;
 }  }
   
   table.LC_innerpickbox,
 table.LC_nested {  table.LC_nested {
   border: none;    border: none;
   border-collapse: collapse;    border-collapse: collapse;
Line 4910  table.LC_nested { Line 5028  table.LC_nested {
 table.LC_data_table tr th,   table.LC_data_table tr th, 
 table.LC_calendar tr th,   table.LC_calendar tr th, 
 table.LC_mail_list tr th,  table.LC_mail_list tr th,
 table.LC_prior_tries tr th {  table.LC_prior_tries tr th,
   table.LC_innerpickbox tr th {
   font-weight: bold;    font-weight: bold;
   background-color: $data_table_head;    background-color: $data_table_head;
   color:$fontmenu;    color:$fontmenu;
   font-size:90%;    font-size:90%;
 }  }
   
   table.LC_innerpickbox tr th,
   table.LC_innerpickbox tr td {
     vertical-align: top;
   }
   
 table.LC_data_table tr.LC_info_row > td {  table.LC_data_table tr.LC_info_row > td {
   background-color: #CCCCCC;    background-color: #CCCCCC;
   font-weight: bold;    font-weight: bold;
Line 4927  table.LC_data_table tr.LC_odd_row > td, Line 5051  table.LC_data_table tr.LC_odd_row > td,
 table.LC_pick_box tr > td.LC_odd_row {  table.LC_pick_box tr > td.LC_odd_row {
   background-color: $data_table_light;    background-color: $data_table_light;
   padding: 2px;    padding: 2px;
     vertical-align: top;
 }  }
   
 table.LC_data_table tr.LC_even_row > td,  table.LC_data_table tr.LC_even_row > td,
 table.LC_pick_box tr > td.LC_even_row {  table.LC_pick_box tr > td.LC_even_row {
   background-color: $data_table_dark;    background-color: $data_table_dark;
   padding: 2px;    padding: 2px;
     vertical-align: top;
 }  }
   
 table.LC_data_table tr.LC_data_table_highlight td {  table.LC_data_table tr.LC_data_table_highlight td {
Line 4953  table.LC_nested tr.LC_empty_row td { Line 5079  table.LC_nested tr.LC_empty_row td {
   padding: 8px;    padding: 8px;
 }  }
   
   table.LC_caption {
   }
   
 table.LC_nested tr.LC_empty_row td {  table.LC_nested tr.LC_empty_row td {
   padding: 4ex    padding: 4ex
 }  }
Line 5076  table.LC_mail_list tr.LC_mail_other:hove Line 5205  table.LC_mail_list tr.LC_mail_other:hove
   
 table.LC_data_table tr > td.LC_browser_file,  table.LC_data_table tr > td.LC_browser_file,
 table.LC_data_table tr > td.LC_browser_file_published {  table.LC_data_table tr > td.LC_browser_file_published {
   background: #CCFF88;    background: #AAEE77;
 }  }
   
 table.LC_data_table tr > td.LC_browser_file_locked,  table.LC_data_table tr > td.LC_browser_file_locked,
Line 5085  table.LC_data_table tr > td.LC_browser_f Line 5214  table.LC_data_table tr > td.LC_browser_f
 }  }
   
 table.LC_data_table tr > td.LC_browser_file_obsolete {  table.LC_data_table tr > td.LC_browser_file_obsolete {
   background: #AAAAAA;    background: #888888;
 }  }
   
 table.LC_data_table tr > td.LC_browser_file_modified,  table.LC_data_table tr > td.LC_browser_file_modified,
 table.LC_data_table tr > td.LC_browser_file_metamodified {  table.LC_data_table tr > td.LC_browser_file_metamodified {
   background: #FFFF77;    background: #F8F866;
 }  }
   
 table.LC_data_table tr.LC_browser_folder > td {  table.LC_data_table tr.LC_browser_folder > td {
   background: #CCCCFF;    background: #E0E8FF;
 }  }
   
 table.LC_data_table tr > td.LC_roles_is {  table.LC_data_table tr > td.LC_roles_is {
Line 5236  table.LC_pick_box { Line 5365  table.LC_pick_box {
 table.LC_pick_box td.LC_pick_box_title {  table.LC_pick_box td.LC_pick_box_title {
   background: $sidebg;    background: $sidebg;
   font-weight: bold;    font-weight: bold;
   text-align: right;    text-align: left;
   vertical-align: top;    vertical-align: top;
   width: 184px;    width: 184px;
   padding: 8px;    padding: 8px;
 }  }
   
 table.LC_pick_box td.LC_selfenroll_pick_box_title {  
   background: $tabbg;  
   font-weight: bold;  
   text-align: right;  
   width: 350px;  
   padding: 8px;  
 }  
   
 table.LC_pick_box td.LC_pick_box_value {  table.LC_pick_box td.LC_pick_box_value {
   text-align: left;    text-align: left;
   padding: 8px;    padding: 8px;
Line 5282  table.LC_pick_box td.LC_oddrow_value { Line 5403  table.LC_pick_box td.LC_oddrow_value {
   background-color: $data_table_light;    background-color: $data_table_light;
 }  }
   
 table.LC_helpform_receipt {  
   width: 620px;  
   border-collapse: separate;  
   background: white;  
   border: 1px solid black;  
   border-spacing: 1px;  
 }  
   
 table.LC_helpform_receipt td.LC_pick_box_title {  
   background: $tabbg;  
   font-weight: bold;  
   text-align: right;  
   width: 184px;  
   padding: 8px;  
 }  
   
 table.LC_helpform_receipt td.LC_evenrow_value {  
   text-align: left;  
   padding: 8px;  
   background-color: $data_table_light;  
 }  
   
 table.LC_helpform_receipt td.LC_oddrow_value {  
   text-align: left;  
   padding: 8px;  
   background-color: $data_table_light;  
 }  
   
 table.LC_helpform_receipt td.LC_pick_box_separator {  
   padding: 0;  
   height: 1px;  
   background: black;  
 }  
   
 span.LC_helpform_receipt_cat {  span.LC_helpform_receipt_cat {
   font-weight: bold;    font-weight: bold;
 }  }
Line 5408  div.LC_feedback_link { Line 5495  div.LC_feedback_link {
   
 div.LC_feedback_link img {  div.LC_feedback_link img {
   height: 22px;    height: 22px;
     vertical-align:middle;
 }  }
   
 div.LC_feedback_link a{  div.LC_feedback_link a{
   text-decoration: none;    text-decoration: none;
 }  }
   
   div.LC_comblock {
     display:inline; 
     color:$font;
     font-size:90%;
   }
   
   div.LC_feedback_link div.LC_comblock {
     padding-left:5px;
   }
   
   div.LC_feedback_link div.LC_comblock a {
     color:$font;
   }
   
 span.LC_feedback_link {  span.LC_feedback_link {
   //background: $feedback_link_bg;    /* background: $feedback_link_bg; */
   font-size: larger;    font-size: larger;
 }  }
   
 span.LC_message_link {  span.LC_message_link {
   //background: $feedback_link_bg;    /* background: $feedback_link_bg; */
   font-size: larger;    font-size: larger;
   position: absolute;    position: absolute;
   right: 1em;    right: 1em;
Line 5504  table.LC_prior_match tr td { Line 5606  table.LC_prior_match tr td {
   border: 1px solid #000000;    border: 1px solid #000000;
 }  }
   
 td.LC_nobreak,  .LC_nobreak {
 span.LC_nobreak {  
   white-space: nowrap;    white-space: nowrap;
 }  }
   
Line 5529  table.LC_docs_documents td.LC_docs_docum Line 5630  table.LC_docs_documents td.LC_docs_docum
   padding: 4px;    padding: 4px;
 }  }
   
 .LC_docs_entry_move {  div.LC_docs_entry_move {
   border: none;    border: 1px solid #BBBBBB;
   border-collapse: collapse;  
 }  
   
 .LC_docs_entry_move td {  
   border: 2px solid #BBBBBB;  
   background: #DDDDDD;    background: #DDDDDD;
     width: 22px;
     padding: 1px;
     margin: 0;
 }  }
   
 .LC_docs_editor td.LC_docs_entry_commands {  table.LC_data_table tr > td.LC_docs_entry_commands,
   table.LC_data_table tr > td.LC_docs_entry_parameter {
   background: #DDDDDD;    background: #DDDDDD;
   font-size: x-small;    font-size: x-small;
 }  }
   
   .LC_docs_entry_parameter {
     white-space: nowrap;
   }
   
 .LC_docs_copy {  .LC_docs_copy {
   color: #000099;    color: #000099;
 }  }
Line 5565  table.LC_docs_documents td.LC_docs_docum Line 5669  table.LC_docs_documents td.LC_docs_docum
   font-size: x-small;    font-size: x-small;
 }  }
   
 .LC_docs_editor td.LC_docs_entry_title,  
 .LC_docs_editor td.LC_docs_entry_icon {  
   background: #FFFFBB;  
 }  
   
 .LC_docs_editor td.LC_docs_entry_parameter {  
   background: #BBBBFF;  
   font-size: x-small;  
   white-space: nowrap;  
 }  
   
 table.LC_docs_adddocs td,  table.LC_docs_adddocs td,
 table.LC_docs_adddocs th {  table.LC_docs_adddocs th {
   border: 1px solid #BBBBBB;    border: 1px solid #BBBBBB;
Line 5612  table.LC_double_column tr td.LC_right_co Line 5705  table.LC_double_column tr td.LC_right_co
   vertical-align: top;    vertical-align: top;
 }  }
   
 span.LC_role_level {  
   font-weight: bold;  
 }  
   
 div.LC_left_float {  div.LC_left_float {
   float: left;    float: left;
   padding-right: 5%;    padding-right: 5%;
Line 5770  div.LC_createcourse { Line 5859  div.LC_createcourse {
 # --------------------------*/  # --------------------------*/
   
 a:hover,  a:hover,
 ol.LC_smallMenu a:hover,  ol.LC_primary_menu a:hover,
 ol#LC_MenuBreadcrumbs a:hover,  ol#LC_MenuBreadcrumbs a:hover,
 ol#LC_PathBreadcrumbs a:hover,  ol#LC_PathBreadcrumbs a:hover,
 ul#LC_TabMainMenuContent a:hover,  ul#LC_secondary_menu a:hover,
 .LC_FormSectionClearButton input:hover  .LC_FormSectionClearButton input:hover
 ul.LC_TabContent   li:hover a {  ul.LC_TabContent   li:hover a {
  color:#BF2317;   color:#BF2317;
         text-decoration:none;      text-decoration:none;
 }  }
   
 h1 {  h1 {
Line 5842  fieldset > legend { Line 5931  fieldset > legend {
   
 #LC_nav_bar {  #LC_nav_bar {
     float: left;      float: left;
     margin: 0;      margin: 0.2em 0 0 0;
 }  }
   
 #LC_nav_bar em{  #LC_nav_bar em{
Line 5850  fieldset > legend { Line 5939  fieldset > legend {
     font-style: normal;      font-style: normal;
 }  }
   
 ol.LC_smallMenu {  ol.LC_primary_menu {
     float: right;      float: right;
       margin: 0.2em 0 0 0;
 }  }
   
 ol.LC_smallMenu, ol#LC_PathBreadcrumbs {  ol#LC_PathBreadcrumbs {
  margin: 0;   margin: 0;
 }  }
   
 ol.LC_smallMenu li {  ol.LC_primary_menu li {
  display: inline;   display: inline;
  padding: 5px 5px 0 10px;   padding: 5px 5px 0 10px;
  vertical-align: top;   vertical-align: top;
 }  }
   
 ol.LC_smallMenu li img {  ol.LC_primary_menu li img {
  vertical-align: bottom;   vertical-align: bottom;
 }  }
   
 ol.LC_smallMenu a {  ol.LC_primary_menu a {
  font-size: 90%;   font-size: 90%;
  color: RGB(80, 80, 80);   color: RGB(80, 80, 80);
  text-decoration: none;   text-decoration: none;
 }  }
   
 ul#LC_TabMainMenuContent {  ul#LC_secondary_menu {
     clear: both;      clear: both;
     color: $fontmenu;      color: $fontmenu;
     background: $tabbg;      background: $tabbg;
     list-style: none;      list-style: none;
     padding: 0;      padding: 0;
     margin: 0;      margin: 0;
     float:left;  
     width: 100%;      width: 100%;
 }  }
   
 ul#LC_TabMainMenuContent li {  ul#LC_secondary_menu li {
     float: left;  
     font-weight: bold;      font-weight: bold;
     line-height: 1.8em;      line-height: 1.8em;
     padding: 0 0.8em;       padding: 0 0.8em; 
Line 5898  ul#LC_TabMainMenuContent li { Line 5986  ul#LC_TabMainMenuContent li {
 ul.LC_TabContent {  ul.LC_TabContent {
  display:block;   display:block;
  background: $sidebg;   background: $sidebg;
  border-bottom: solid 1px $lg_border_color   border-bottom: solid 1px $lg_border_color;
  list-style:none;   list-style:none;
  margin: -10px -10px 0 -10px;   margin: 0 -10px;
  padding: 0;   padding: 0;
 }  }
   
 ul.LC_TabContentBigger {  
         display:block;  
         list-style:none;  
         padding: 0;  
 }  
   
   
 ul.LC_TabContent li,  ul.LC_TabContent li,
 ul.LC_TabContentBigger li {  ul.LC_TabContentBigger li {
  display: inline;  
  border-right: solid 1px $lg_border_color;  
  float:left;   float:left;
  line-height:140%;  
  white-space:nowrap;  
 }  }
   
 ul#LC_TabMainMenuContent li a {  ul#LC_secondary_menu li a {
     color: $fontmenu;      color: $fontmenu;
  text-decoration: none;   text-decoration: none;
 }  }
Line 5954  ul.LC_TabContent li:hover, ul.LC_TabCont Line 6031  ul.LC_TabContent li:hover, ul.LC_TabCont
  padding-right: 16px;   padding-right: 16px;
 }  }
   
 ul.LC_TabContentBigger li {  
  vertical-align:bottom;  
  border-top:solid 1px $lg_border_color;  
  border-left:solid 1px $lg_border_color;  
  padding:5px 10px 5px 10px;  
  margin-left:2px;  
  background: #d9d9d9;  
 }  
   
 #maincoursedoc {  #maincoursedoc {
  clear:both;   clear:both;
 }  }
   
 ul.LC_TabContentBigger li:hover,   ul.LC_TabContentBigger {
 ul.LC_TabContentBigger li.active {          display:block;
  background: #ffffff;          list-style:none;
           padding: 0;
 }  }
   
 ul.LC_TabContentBigger li,   ul.LC_TabContentBigger li {
           vertical-align:bottom;
           height: 30px;
           font-size:110%;
           font-weight:bold;
           color: #737373;
   }
   
   
 ul.LC_TabContentBigger li a {  ul.LC_TabContentBigger li a {
  font-size:110%;          background:url('/adm/lonIcons/tabbgleft.gif') left bottom no-repeat;
  font-weight:bold;   height: 30px;
    line-height: 30px;
    text-align: center;
    display: block;
    text-decoration: none;
   }
   
   ul.LC_TabContentBigger li:hover a, 
   ul.LC_TabContentBigger li.active a {
    background:url('/adm/lonIcons/tabbgleft.gif') left top no-repeat;
    color:$font;
    text-decoration: underline;
   }
   
   
   ul.LC_TabContentBigger li b {
    background: url('/adm/lonIcons/tabbgright.gif') no-repeat right bottom;
    display: block;
    float: left;
    padding: 0 30px;
   }
   
   ul.LC_TabContentBigger li:hover b,
   ul.LC_TabContentBigger li.active b {
           background:url('/adm/lonIcons/tabbgright.gif') right top no-repeat;
           color:$font;
    border-bottom: 1px solid #FFFFFF;
   }
   
   
   ul.LC_CourseBreadcrumbs {
     background: $sidebg;
     line-height: 32px;
     padding-left: 10px;
     margin: 0 0 10px 0;
     list-style-position: inside;
   
 }  }
   
 ol#LC_MenuBreadcrumbs,   ol#LC_MenuBreadcrumbs, 
 ol#LC_PathBreadcrumbs,   ol#LC_PathBreadcrumbs {
 ul#LC_CourseBreadcrumbs {  
  padding-left: 10px;   padding-left: 10px;
  margin: 0;   margin: 0;
  list-style-position: inside;   list-style-position: inside;
       /* SD working here
       white-space: nowrap; */
 }  }
   
 ol#LC_MenuBreadcrumbs li,   ol#LC_MenuBreadcrumbs li, 
 ol#LC_PathBreadcrumbs li,   ol#LC_PathBreadcrumbs li, 
 ul#LC_CourseBreadcrumbs li {  ul.LC_CourseBreadcrumbs li {
     display: inline;      display: inline;
     white-space: nowrap;      white-space: nowrap;
       /* SD working here
       white-space: normal; */
 }  }
   
 ol#LC_MenuBreadcrumbs li a,  ol#LC_MenuBreadcrumbs li a,
 ul#LC_CourseBreadcrumbs li a {  ul.LC_CourseBreadcrumbs li a {
  text-decoration: none;   text-decoration: none;
  font-size:90%;   font-size:90%;
 }  }
Line 6096  div.LC_columnSection>* { Line 6212  div.LC_columnSection>* {
  overflow:hidden;   overflow:hidden;
 }  }
   
 .clear {  
  clear: both;  
  line-height: 0;  
  font-size: 0;  
  height: 0;  
 }  
   
 .LC_loginpage_container {  .LC_loginpage_container {
  text-align:left;   text-align:left;
  margin : 0 auto;   margin : 0 auto;
Line 6157  table em { Line 6266  table em {
 table.LC_tableBrowseRes,  table.LC_tableBrowseRes,
 table.LC_tableOfContent {  table.LC_tableOfContent {
         border:none;          border:none;
  border-spacing: 1;   border-spacing: 1px;
  padding: 3px;   padding: 3px;
  background-color: #FFFFFF;   background-color: #FFFFFF;
  font-size: 90%;   font-size: 90%;
Line 6474  $args - additional optional args support Line 6583  $args - additional optional args support
              inherit_jsmath -> when creating popup window in a page,               inherit_jsmath -> when creating popup window in a page,
                                     should it have jsmath forced on by the                                      should it have jsmath forced on by the
                                     current page                                      current page
                bread_crumbs ->             Array containing breadcrumbs
                bread_crumbs_components ->  if exists show it as headline else show only the breadcrumbs
   
 =back  =back
   
Line 6679  sub simple_error_page { Line 6790  sub simple_error_page {
  my ($add_class) = @_;   my ($add_class) = @_;
  $row_count[0]++;   $row_count[0]++;
  my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';   my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';
  $css_class = (join(' ',$css_class,$add_class));   $css_class = (join(' ',$css_class,$add_class)) unless ($add_class eq '');
  return  '<tr class="'.$css_class.'">'."\n";;   return  '<tr class="'.$css_class.'">'."\n";;
     }      }
           
     sub continue_data_table_row {      sub continue_data_table_row {
  my ($add_class) = @_;   my ($add_class) = @_;
  my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';   my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row';
  $css_class = (join(' ',$css_class,$add_class));   $css_class = (join(' ',$css_class,$add_class)) unless ($add_class eq '');;
  return  '<tr class="'.$css_class.'">'."\n";;   return  '<tr class="'.$css_class.'">'."\n";;
     }      }
   
Line 6710  sub simple_error_page { Line 6821  sub simple_error_page {
     sub end_data_table_header_row {      sub end_data_table_header_row {
  return '</tr>'."\n";;   return '</tr>'."\n";;
     }      }
   
       sub data_table_caption {
           my $caption = shift;
           return "<caption class=\"LC_caption\">$caption</caption>";
       }
 }  }
   
 =pod  =pod
Line 7482  sub user_picker { Line 7598  sub user_picker {
         #       loncreateuser::print_user_query_page()          #       loncreateuser::print_user_query_page()
         #       has been completed.          #       has been completed.
         next if ($option eq 'alc');          next if ($option eq 'alc');
           next if (($option eq 'crs') && ($env{'form.form'} eq 'requestcrs'));  
         next if ($option eq 'crs' && !$env{'request.course.id'});          next if ($option eq 'crs' && !$env{'request.course.id'});
         if ($curr_selected{'srchin'} eq $option) {          if ($curr_selected{'srchin'} eq $option) {
             $srchinsel .= '               $srchinsel .= ' 
Line 7646  $newuserscript Line 7763  $newuserscript
   
 $new_user_create  $new_user_create
   
 <table>  
  <tr>  
   <td>$lt{'doma'}:</td>  
   <td>$domform</td>  
   </td>  
  </tr>  
  <tr>  
   <td>$lt{'usr'}:</td>  
   <td>$srchbysel  
       $srchtypesel   
       <input type="text" size="15" name="srchterm" value="$srchterm" />  
       $srchinsel   
   </td>  
  </tr>  
 </table>  
 <br />  
 END_BLOCK  END_BLOCK
   
       $output .= &Apache::lonhtmlcommon::start_pick_box().
                  &Apache::lonhtmlcommon::row_title($lt{'doma'}).
                  $domform.
                  &Apache::lonhtmlcommon::row_closure().
                  &Apache::lonhtmlcommon::row_title($lt{'usr'}).
                  $srchbysel.
                  $srchtypesel. 
                  '<input type="text" size="15" name="srchterm" value="'.$srchterm.'" />'.
                  $srchinsel.
                  &Apache::lonhtmlcommon::row_closure(1)
                  &Apache::lonhtmlcommon::end_pick_box().
                  '<br />';
     return $output;      return $output;
 }  }
   
Line 8580  sub csv_print_select_table { Line 8693  sub csv_print_select_table {
  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().'<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.');">');
  $r->print('<option value="none"></option>');   $r->print('<option value="none"></option>');
  foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) {   foreach my $sample (sort({$a <=> $b} keys(%{ $samples->[0] }))) {
Line 9234  sub restore_settings { Line 9347  sub restore_settings {
   
 =item * &build_recipient_list()  =item * &build_recipient_list()
   
 Build recipient lists for four types of e-mail:  Build recipient lists for five types of e-mail:
 (a) Error Reports, (b) Package Updates, (c) lonstatus warnings/errors  (a) Error Reports, (b) Package Updates, (c) lonstatus warnings/errors
 (d) Help requests, generated by  (d) Help requests, (e) Course requests needing approval,  generated by
 lonerrorhandler.pm, CHECKRPMS, loncron, and lonsupportreq.pm respectively.  lonerrorhandler.pm, CHECKRPMS, loncron, lonsupportreq.pm and
   loncoursequeueadmin.pm respectively.
   
 Inputs:  Inputs:
 defmail (scalar - email address of default recipient),   defmail (scalar - email address of default recipient), 
Line 9810  sub check_clone { Line 9924  sub check_clone {
         $clonemsg = &mt('No new course created.').$linefeed.&mt('A new course could not be cloned from the specified original - [_1] - because it is a non-existent course.',$args->{'clonecourse'}.':'.$args->{'clonedomain'});               $clonemsg = &mt('No new course created.').$linefeed.&mt('A new course could not be cloned from the specified original - [_1] - because it is a non-existent course.',$args->{'clonecourse'}.':'.$args->{'clonedomain'});     
     } else {      } else {
  my %clonedesc = &Apache::lonnet::coursedescription($cloneid,{'one_time' => 1});   my %clonedesc = &Apache::lonnet::coursedescription($cloneid,{'one_time' => 1});
  if ($env{'request.role.domain'} eq $args->{'clonedomain'}) {   if (($env{'request.role.domain'} eq $args->{'clonedomain'}) && 
               (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'}))) {
     $can_clone = 1;      $can_clone = 1;
  } else {   } else {
     my %clonehash = &Apache::lonnet::get('environment',['cloners'],      my %clonehash = &Apache::lonnet::get('environment',['cloners'],
Line 9838  sub check_clone { Line 9953  sub check_clone {
 }  }
   
 sub construct_course {  sub construct_course {
     my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname,$context) = @_;      my ($args,$logmsg,$courseid,$crsudom,$crsunum,$udom,$uname,$context,$cnum,$category) = @_;
     my $outcome;      my $outcome;
     my $linefeed =  '<br />'."\n";      my $linefeed =  '<br />'."\n";
     if ($context eq 'auto') {      if ($context eq 'auto') {
Line 9876  sub construct_course { Line 9991  sub construct_course {
                                              $args->{'crscode'},                                               $args->{'crscode'},
                                              $args->{'ccuname'}.':'.                                               $args->{'ccuname'}.':'.
                                              $args->{'ccdomain'},                                               $args->{'ccdomain'},
                                              $args->{'crstype'});                                               $args->{'crstype'},
                                                $cnum,$context,$category);
   
     # Note: The testing routines depend on this being output; see       # Note: The testing routines depend on this being output; see 
     # Utils::Course. This needs to at least be output as a comment      # Utils::Course. This needs to at least be output as a comment
Line 10185  sub group_term { Line 10301  sub group_term {
     my $crstype = &course_type();      my $crstype = &course_type();
     my %names = (      my %names = (
                   'Course' => 'group',                    'Course' => 'group',
                   'Group' => 'team',                    'Community' => 'group',
                 );                  );
     return $names{$crstype};      return $names{$crstype};
 }  }
   
   sub course_types {
       my @types = ('official','unofficial','community');
       my %typename = (
                            official   => 'Official course',
                            unofficial => 'Unofficial course',
                            community  => 'Community',
                      );
       return (\@types,\%typename);
   }
   
 sub icon {  sub icon {
     my ($file)=@_;      my ($file)=@_;
     my $curfext = lc((split(/\./,$file))[-1]);      my $curfext = lc((split(/\./,$file))[-1]);
Line 10378  sub init_user_environment { Line 10504  sub init_user_environment {
                 &Apache::lonnet::usertools_access($username,$domain,$tool,'reload');                  &Apache::lonnet::usertools_access($username,$domain,$tool,'reload');
         }          }
   
         foreach my $crstype ('official','unofficial') {          foreach my $crstype ('official','unofficial','community') {
             $userenv{'canrequest.'.$crstype} =              $userenv{'canrequest.'.$crstype} =
                 &Apache::lonnet::usertools_access($username,$domain,$crstype,                  &Apache::lonnet::usertools_access($username,$domain,$crstype,
                                                   'reload','requestcourses');                                                    'reload','requestcourses');

Removed from v.1.850  
changed lines
  Added in v.1.905


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