--- loncom/interface/loncommon.pm 2009/08/28 22:47:07 1.887 +++ loncom/interface/loncommon.pm 2009/10/04 17:47:21 1.894 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.887 2009/08/28 22:47:07 raeburn Exp $ +# $Id: loncommon.pm,v 1.894 2009/10/04 17:47:21 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -602,7 +602,7 @@ sub userbrowser_javascript { my $id_functions = &javascript_index_functions(); return <<"ENDUSERBRW"; -function openuserbrowser(formname,uname,udom,ulast,ufirst,uemail,hideudom,crsdom) { +function openuserbrowser(formname,uname,udom,ulast,ufirst,uemail,hideudom,crsdom,caller) { var url = '/adm/pickuser?'; var userdom = getDomainFromSelectbox(formname,udom); if (userdom != null) { @@ -617,6 +617,9 @@ function openuserbrowser(formname,uname, '&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'; @@ -624,23 +627,27 @@ function openuserbrowser(formname,uname, stdeditbrowser.focus(); } -function fix_domain (formname,udom,origdom) { +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; - if (domid > -1) { - var slct = document.forms[formid].elements[domid]; - if (slct.type == 'select-one') { - var i; - for (i=0;i -1) { + var slct = document.forms[formid].elements[domid]; + if (slct.type == 'select-one') { + var i; + for (i=0;i'.$linktext.''; } @@ -2957,7 +2964,7 @@ sub aboutmewrapper { if (!defined($username) && !defined($domain)) { return; } - return ''.$link.''; } @@ -3918,23 +3925,24 @@ sub parse_block_record { } sub blocking_status { - my $blocked; my ($activity,$uname,$udom) = @_; my %setters; + + # check for active blocking my ($startblock,$endblock)=&blockcheck(\%setters,$activity,$uname,$udom); - if ($startblock && $endblock) { - $blocked = 1; - } - if(!wantarray) { - return $blocked; - } - my $output; - my $querystring; - $querystring = "?activity=$activity"; - $output .= <<"END_MYBLOCK"; - END_MYBLOCK + + $output = Apache::lonhtmlcommon::scripttag($output); + my $popupUrl = "/adm/blockingstatus/$querystring"; + my $text = mt('Communication Blocked'); + $output .= <<"END_BLOCK";
- Communication Blocked + title='$text'> + $text Communication Blocked + title='$text'>$text
END_BLOCK @@ -4036,7 +4046,7 @@ sub determinedomain { my $domain=shift; if (! $domain) { # 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{'request.role.domain'}) { $domain=$env{'request.role.domain'}; @@ -4430,29 +4440,47 @@ sub bodytag { if ($env{'environment.remote'} eq 'off') { # No Remote - if ($env{'request.state'} eq 'construct') { - $forcereg=1; - } + if ($env{'request.state'} eq 'construct') { + $forcereg=1; + } -# if ($env{'request.state'} eq 'construct') { -# $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls -# } + # if ($env{'request.state'} eq 'construct') { + # $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls + # } my $titletable = '' - ."" - .'
$titleinfo $dc_info
'; + ." $titleinfo $dc_info" + .''; - if ($no_nav_bar) { - $bodytag .= $titletable; - } else { - $bodytag .= qq|
$name $role
- $realm $dc_info
| unless $env{'form.inhibitmenu'}; + if ($no_nav_bar) { + $bodytag .= $titletable; + } else { + $bodytag .= qq|
$name $role
+ $realm $dc_info
| unless $env{'form.inhibitmenu'}; - if ($env{'request.state'} eq 'construct') { - $bodytag .= &Apache::lonmenu::menubuttons($forcereg,$titletable); - } else { - $bodytag .= &Apache::lonmenu::menubuttons($forcereg).$titletable; - } +#SD $titletable is obsolete +#SD if ($env{'request.state'} eq 'construct') { +#SD $bodytag .= &Apache::lonmenu::menubuttons($forcereg,$titletable); +#SD } else { +#SD $bodytag .= &Apache::lonmenu::menubuttons($forcereg).$titletable; +#SD } + if ( $env{'form.inhibitmenu'} eq 'yes' + || $ENV{'REQUEST_URI'} eq '/adm/logout' + || $env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { + + return $bodytag; + } + + $bodytag .= Apache::lonhtmlcommon::scripttag( + Apache::lonmenu::utilityfunctions(), + 'start'); + $bodytag .= Apache::lonmenu::primary_menu(); + $bodytag .= Apache::lonmenu::secondary_menu(); + #SD remove next line + #$bodytag .= Apache::lonmenu::menubuttons($forcereg); + $bodytag .= Apache::lonmenu::serverform(); + $bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); + $bodytag .= Apache::lonmenu::innerregister($forcereg) if $forcereg; } return $bodytag; } @@ -4643,14 +4671,6 @@ a:focus { background: yellow } -hr { - clear: both; - color: $tabbg; - background-color: $tabbg; - height: 3px; - border: none; -} - form, .inline { display: inline; } @@ -4995,6 +5015,9 @@ table.LC_nested tr.LC_empty_row td { padding: 8px; } +table.LC_caption { +} + table.LC_nested tr.LC_empty_row td { padding: 4ex } @@ -6764,6 +6787,11 @@ sub simple_error_page { sub end_data_table_header_row { return ''."\n";; } + + sub data_table_caption { + my $caption = shift; + return "$caption"; + } } =pod