--- loncom/interface/loncommon.pm 2007/09/05 00:25:52 1.564.2.9 +++ loncom/interface/loncommon.pm 2007/08/28 15:55:49 1.571 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.564.2.9 2007/09/05 00:25:52 albertel Exp $ +# $Id: loncommon.pm,v 1.571 2007/08/28 15:55:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1084,6 +1084,63 @@ sub changable_area { =pod +=item * resize_textarea_js + +emits the needed javascript to resize a textarea to be as big as possible + +creates a function resize_textrea that takes two IDs first should be +the id of the element to resize, second should be the id of a div that +surrounds everything that comes after the textarea, this routine needs +to be attached to the for the onload and onresize events. + + +=cut + +sub resize_textarea_js { + return <<"RESIZE"; + +RESIZE + +} + +=pod + =back =head1 Excel and CSV file utility routines @@ -3458,6 +3515,9 @@ sub bodytag { if (!$realm) { $realm=' '; } # Set messages my $messages=&domainlogo($domain); +# Port for miniserver + my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'}; + if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; } my $extra_body_attr = &make_attr_string($forcereg,\%design); @@ -3575,7 +3635,7 @@ ENDROLE my $imgsrc = $img; if ($img =~ /^\/adm/) { - $imgsrc = &lonhttpdurl($img); + $imgsrc = 'http://'.$ENV{'HTTP_HOST'}.':'.$lonhttpdPort.$img; } my $upperleft=''.$function.''; @@ -4451,10 +4511,6 @@ span.LC_nobreak { white-space: nowrap; } -span.LC_cusr_emph { - font-style: italic; -} - table.LC_docs_documents { background: #BBBBBB; border-width: 0px; @@ -5576,15 +5632,14 @@ sub user_picker { $srchterm = $srch->{'srchterm'}; } my %lt=&Apache::lonlocal::texthash( - 'usr' => 'Search criteria', 'doma' => 'Domain/institution to search', 'uname' => 'username', 'lastname' => 'last name', 'lastfirst' => 'last name, first name', 'crs' => 'in this course', - 'dom' => 'in selected LON-CAPA domain', + 'dom' => 'in this domain', 'alc' => 'all LON-CAPA', - 'instd' => 'in institutional directory for selected domain', + 'instd' => 'in institutional directory', 'exact' => 'is', 'contains' => 'contains', 'begins' => 'begins with', @@ -5645,12 +5700,7 @@ sub user_picker { my ($newuserscript,$new_user_create); if ($forcenewuser) { - if (ref($srch) eq 'HASH') { - if ($srch->{'srchby'} eq 'uname' && $srch->{'srchtype'} eq 'exact' && $srch->{'srchin'} eq 'dom' && $srch->{'srchdomain'} eq $env{'request.role.domain'}) { - $new_user_create = '

&"').'" onclick="javascript:setSearch(\'1\','.$caller.');" />

'; - } - } - + $new_user_create = '

&"').'" onclick="javascript:setSearch(\'1\','.$caller.');" />

'; $newuserscript = <<"ENDSCRIPT"; function setSearch(createnew,callingForm) { @@ -5757,18 +5807,16 @@ $new_user_create - - - - - - + + + +
$lt{'doma'}:$domform
$lt{'usr'}: $srchbysel $srchtypesel $srchinsel
$lt{'doma'}: $domform

END_BLOCK @@ -5776,6 +5824,8 @@ END_BLOCK return $output; } + + =pod =back @@ -7328,27 +7378,10 @@ sub icon { return &lonhttpdurl($iconname); } -sub lonhttpd_port { - my $lonhttpd_port=$Apache::lonnet::perlvar{'lonhttpdPort'}; - if (!defined($lonhttpd_port)) { $lonhttpd_port='8080'; } - # IE doesn't like a secure page getting images from a non-secure - # port (when logging we haven't parsed the browser type so default - # back to secure - if ((!exists($env{'browser.type'}) || $env{'browser.type'} eq 'explorer') - && $ENV{'SERVER_PORT'} == 443) { - return 443; - } - return $lonhttpd_port; - -} - sub lonhttpdurl { my ($url)=@_; - - my $lonhttpd_port = &lonhttpd_port(); - if ($lonhttpd_port == 443) { - return 'https://'.$ENV{'SERVER_NAME'}.$url; - } + my $lonhttpd_port=$Apache::lonnet::perlvar{'lonhttpdPort'}; + if (!defined($lonhttpd_port)) { $lonhttpd_port='8080'; } return 'http://'.$ENV{'SERVER_NAME'}.':'.$lonhttpd_port.$url; }