version 1.567, 2007/08/23 22:21:15
|
version 1.574, 2007/08/30 20:24:15
|
Line 721 sub help_open_topic {
|
Line 721 sub help_open_topic {
|
|
|
my $template = ""; |
my $template = ""; |
my $link; |
my $link; |
|
|
$topic=~s/\W/\_/g; |
$topic=~s/\W/\_/g; |
|
|
if (!$stayOnPage) |
if (!$stayOnPage) { |
{ |
|
$link = "javascript:void(open('/adm/help/${filename}.hlp', 'Help_for_$topic', 'menubar=0,toolbar=1,scrollbars=1,width=$width,height=$height,resizable=yes'))"; |
$link = "javascript:void(open('/adm/help/${filename}.hlp', 'Help_for_$topic', 'menubar=0,toolbar=1,scrollbars=1,width=$width,height=$height,resizable=yes'))"; |
} |
} else { |
else |
|
{ |
|
$link = "/adm/help/${filename}.hlp"; |
$link = "/adm/help/${filename}.hlp"; |
} |
} |
|
|
# Add the text |
# Add the text |
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'><a target=\"_top\" href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>"; |
"<td bgcolor='#5555FF'><a target=\"_top\" href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>"; |
} |
} |
|
|
# Add the graphic |
# Add the graphic |
Line 805 sub help_open_menu {
|
Line 801 sub help_open_menu {
|
my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text) |
my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text) |
= @_; |
= @_; |
$stayOnPage = 0 if (not defined $stayOnPage); |
$stayOnPage = 0 if (not defined $stayOnPage); |
# formerly only used pop-up help (stayOnPage = 0) |
# only use pop-up help (stayOnPage == 0) |
# if environment.remote is on (using remote control UI) |
# if environment.remote is on (using remote control UI) |
# if ($env{'browser.interface'} eq 'textual' || |
if ($env{'browser.interface'} eq 'textual' || |
# $env{'environment.remote'} eq 'off' ) { |
$env{'environment.remote'} eq 'off' ) { |
# $stayOnPage=1; |
|
#} |
|
# Now making pop-up help the default even with remote control |
|
if ($env{'browser.interface'} eq 'textual') { |
|
$stayOnPage=1; |
$stayOnPage=1; |
} |
} |
my $output; |
my $output; |
Line 834 sub help_open_menu {
|
Line 826 sub help_open_menu {
|
|
|
sub top_nav_help { |
sub top_nav_help { |
my ($text) = @_; |
my ($text) = @_; |
|
|
$text = &mt($text); |
$text = &mt($text); |
|
my $stay_on_page = |
my $stayOnPage = |
|
($env{'browser.interface'} eq 'textual' || |
($env{'browser.interface'} eq 'textual' || |
$env{'environment.remote'} eq 'off' ); |
$env{'environment.remote'} eq 'off' ); |
my $link= ($stayOnPage) ? "javascript:helpMenu('display')" |
my $link = ($stay_on_page) ? "javascript:helpMenu('display')" |
: "javascript:helpMenu('open')"; |
: "javascript:helpMenu('open')"; |
my $banner_link = &update_help_link(undef,undef,undef,undef,$stayOnPage); |
my $banner_link = &update_help_link(undef,undef,undef,undef,$stay_on_page); |
|
|
my $title = &mt('Get help'); |
my $title = &mt('Get help'); |
|
|
Line 5609 sub get_secgrprole_info {
|
Line 5599 sub get_secgrprole_info {
|
} |
} |
|
|
sub user_picker { |
sub user_picker { |
my ($dom,$srch,$forcenewuser) = @_; |
my ($dom,$srch,$forcenewuser,$caller) = @_; |
my $currdom = $dom; |
my $currdom = $dom; |
my %curr_selected = ( |
my %curr_selected = ( |
srchin => 'dom', |
srchin => 'dom', |
Line 5632 sub user_picker {
|
Line 5622 sub user_picker {
|
$srchterm = $srch->{'srchterm'}; |
$srchterm = $srch->{'srchterm'}; |
} |
} |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
|
'usr' => 'Search criteria', |
'doma' => 'Domain/institution to search', |
'doma' => 'Domain/institution to search', |
'uname' => 'username', |
'uname' => 'username', |
'lastname' => 'last name', |
'lastname' => 'last name', |
'lastfirst' => 'last name, first name', |
'lastfirst' => 'last name, first name', |
'crs' => 'in this course', |
'crs' => 'in this course', |
'dom' => 'in this domain', |
'dom' => 'in selected domain', |
'alc' => 'all LON-CAPA', |
'alc' => 'all LON-CAPA', |
'instd' => 'in institutional directory', |
'instd' => 'in institutional directory for selected domain', |
'exact' => 'is', |
'exact' => 'is', |
'contains' => 'contains', |
'contains' => 'contains', |
|
'begins' => 'begins with', |
|
'youm' => "You must include some text to search for.", |
|
'thte' => "The text you are searching for must contain at least two characters when using a 'begins' type search.", |
|
'thet' => "The text you are searching for must contain at least three characters when using a 'contains' type search.", |
|
'yomc' => "You must choose a domain when using an institutional directory search.", |
|
'ymcd' => "You must choose a domain when using a domain search.", |
|
'whus' => "When using searching by last,first you must include a comma as separator between last name and first name.", |
|
'whse' => "When searching by last,first you must include at least one character in the first name.", |
|
'thfo' => "The following need to be corrected before the search can be run:", |
); |
); |
my $domform = &select_dom_form($currdom,'srchdomain',1,1); |
my $domform = &select_dom_form($currdom,'srchdomain',1,1); |
my $srchinsel = ' <select name="srchin">'; |
my $srchinsel = ' <select name="srchin">'; |
Line 5677 sub user_picker {
|
Line 5677 sub user_picker {
|
$srchbysel .= "\n </select>\n"; |
$srchbysel .= "\n </select>\n"; |
|
|
my $srchtypesel = ' <select name="srchtype">'; |
my $srchtypesel = ' <select name="srchtype">'; |
foreach my $option ('exact','contains') { |
foreach my $option ('exact','begins','contains') { |
if ($curr_selected{'srchtype'} eq $option) { |
if ($curr_selected{'srchtype'} eq $option) { |
$srchtypesel .= ' |
$srchtypesel .= ' |
<option value="'.$option.'" selected="selected">'.$lt{$option}.'</option>'; |
<option value="'.$option.'" selected="selected">'.$lt{$option}.'</option>'; |
Line 5691 sub user_picker {
|
Line 5691 sub user_picker {
|
my ($newuserscript,$new_user_create); |
my ($newuserscript,$new_user_create); |
|
|
if ($forcenewuser) { |
if ($forcenewuser) { |
$new_user_create = '<p> <input type="submit" name="forcenew" value="'.&HTML::Entities::encode(&mt('Make new user "[_1]"',$srchterm),'<>&"').'" onclick="javascript:setSearch(\'1\');" /> </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>'; |
$newuserscript = <<"ENDSCRIPT"; |
$newuserscript = <<"ENDSCRIPT"; |
|
|
function setSearch(createnew) { |
function setSearch(createnew,callingForm) { |
if (createnew == 1) { |
if (createnew == 1) { |
for (var i=0; i<document.crtuser.srchby.length; i++) { |
for (var i=0; i<callingForm.srchby.length; i++) { |
if (document.crtuser.srchby.options[i].value == 'uname') { |
if (callingForm.srchby.options[i].value == 'uname') { |
document.crtuser.srchby.selectedIndex = i; |
callingForm.srchby.selectedIndex = i; |
} |
} |
} |
} |
for (var i=0; i<document.crtuser.srchin.length; i++) { |
for (var i=0; i<callingForm.srchin.length; i++) { |
if ( document.crtuser.srchin.options[i].value == 'dom') { |
if ( callingForm.srchin.options[i].value == 'dom') { |
document.crtuser.srchin.selectedIndex = i; |
callingForm.srchin.selectedIndex = i; |
} |
} |
} |
} |
for (var i=0; i<document.crtuser.srchtype.length; i++) { |
for (var i=0; i<callingForm.srchtype.length; i++) { |
if (document.crtuser.srchtype.options[i].value == 'exact') { |
if (callingForm.srchtype.options[i].value == 'exact') { |
document.crtuser.srchtype.selectedIndex = i; |
callingForm.srchtype.selectedIndex = i; |
} |
} |
} |
} |
for (var i=0; i<document.crtuser.srchdomain.length; i++) { |
for (var i=0; i<callingForm.srchdomain.length; i++) { |
if (document.crtuser.srchdomain.options[i].value == '$env{'request.role.domain'}') { |
if (callingForm.srchdomain.options[i].value == '$env{'request.role.domain'}') { |
document.crtuser.srchdomain.selectedIndex = i; |
callingForm.srchdomain.selectedIndex = i; |
} |
} |
} |
} |
} |
} |
Line 5724 ENDSCRIPT
|
Line 5724 ENDSCRIPT
|
|
|
my $output = <<"END_BLOCK"; |
my $output = <<"END_BLOCK"; |
<script type="text/javascript"> |
<script type="text/javascript"> |
function validateEntry() { |
function validateEntry(callingForm) { |
|
|
var checkok = 1; |
var checkok = 1; |
var srchin; |
var srchin; |
for (var i=0; i<document.crtuser.srchin.length; i++) { |
for (var i=0; i<callingForm.srchin.length; i++) { |
if ( document.crtuser.srchin[i].checked ) { |
if ( callingForm.srchin[i].checked ) { |
srchin = document.crtuser.srchin[i].value; |
srchin = callingForm.srchin[i].value; |
} |
} |
} |
} |
|
|
var srchtype = document.crtuser.srchtype.options[document.crtuser.srchtype.selectedIndex].value; |
var srchtype = callingForm.srchtype.options[callingForm.srchtype.selectedIndex].value; |
var srchby = document.crtuser.srchby.options[document.crtuser.srchby.selectedIndex].value; |
var srchby = callingForm.srchby.options[callingForm.srchby.selectedIndex].value; |
var srchdomain = document.crtuser.srchdomain.options[document.crtuser.srchdomain.selectedIndex].value; |
var srchdomain = callingForm.srchdomain.options[callingForm.srchdomain.selectedIndex].value; |
var srchterm = document.crtuser.srchterm.value; |
var srchterm = callingForm.srchterm.value; |
var srchin = document.crtuser.srchin.options[document.crtuser.srchin.selectedIndex].value; |
var srchin = callingForm.srchin.options[callingForm.srchin.selectedIndex].value; |
var msg = ""; |
var msg = ""; |
|
|
if (srchterm == "") { |
if (srchterm == "") { |
checkok = 0; |
checkok = 0; |
msg += "You must include some text to search for.\\n"; |
msg += "$lt{'youm'}\\n"; |
|
} |
|
|
|
if (srchtype== 'begins') { |
|
if (srchterm.length < 2) { |
|
checkok = 0; |
|
msg += "$lt{'thte'}\\n"; |
|
} |
} |
} |
|
|
if (srchtype== 'contains') { |
if (srchtype== 'contains') { |
if (srchterm.length < 3) { |
if (srchterm.length < 3) { |
checkok = 0; |
checkok = 0; |
msg += "The text you are searching for must contain at least three characters when using a 'contains' type search.\\n"; |
msg += "$lt{'thet'}\\n"; |
} |
} |
} |
} |
if (srchin == 'instd') { |
if (srchin == 'instd') { |
if (srchdomain == '') { |
if (srchdomain == '') { |
checkok = 0; |
checkok = 0; |
msg += "You must choose a domain when using an institutional directory search.\\n"; |
msg += "$lt{'yomc'}\\n"; |
} |
} |
} |
} |
if (srchin == 'dom') { |
if (srchin == 'dom') { |
if (srchdomain == '') { |
if (srchdomain == '') { |
checkok = 0; |
checkok = 0; |
msg += "You must choose a domain when using a domain search.\\n"; |
msg += "$lt{'ymcd'}\\n"; |
} |
} |
} |
} |
if (srchby == 'lastfirst') { |
if (srchby == 'lastfirst') { |
if (srchterm.indexOf(",") == -1) { |
if (srchterm.indexOf(",") == -1) { |
checkok = 0; |
checkok = 0; |
msg += "When using searching by last,first you must include a comma as separator between last name and first name.\\n"; |
msg += "$lt{'whus'}\\n"; |
} |
} |
if (srchterm.indexOf(",") == srchterm.length -1) { |
if (srchterm.indexOf(",") == srchterm.length -1) { |
checkok = 0; |
checkok = 0; |
msg += "When searching by last,first you must include at least one character in the first name.\\n"; |
msg += "$lt{'whse'}\\n"; |
} |
} |
} |
} |
if (checkok == 0) { |
if (checkok == 0) { |
alert("The following need to be corrected before the search can be run:\\n"+msg); |
alert("$lt{'thfo'}\\n"+msg); |
return; |
return; |
} |
} |
if (checkok == 1) { |
if (checkok == 1) { |
document.crtuser.submit(); |
callingForm.submit(); |
} |
} |
} |
} |
|
|
Line 5791 $new_user_create
|
Line 5798 $new_user_create
|
|
|
<table> |
<table> |
<tr> |
<tr> |
|
<td>$lt{'doma'}:</td> |
|
<td>$domform</td> |
|
</td> |
|
</tr> |
|
<tr> |
|
<td>$lt{'usr'}:</td> |
<td>$srchbysel |
<td>$srchbysel |
$srchtypesel |
$srchtypesel |
<input type="text" size="15" name="srchterm" value="$srchterm" /> |
<input type="text" size="15" name="srchterm" value="$srchterm" /> |
$srchinsel |
$srchinsel |
</td> |
</td> |
</tr> |
</tr> |
<tr> |
|
<td>$lt{'doma'}: $domform</td> |
|
</td> |
|
</tr> |
|
</table> |
</table> |
<br /> |
<br /> |
END_BLOCK |
END_BLOCK |
Line 6982 sub check_clone {
|
Line 6991 sub check_clone {
|
$args->{'crstype'}); |
$args->{'crstype'}); |
} 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->{'form.clonedomain'}) { |
if ($env{'request.role.domain'} eq $args->{'clonedomain'}) { |
$can_clone = 1; |
$can_clone = 1; |
} else { |
} else { |
my %clonehash = &Apache::lonnet::get('environment',['cloners'], |
my %clonehash = &Apache::lonnet::get('environment',['cloners'], |
Line 7366 sub lonhttpdurl {
|
Line 7375 sub lonhttpdurl {
|
my ($url)=@_; |
my ($url)=@_; |
my $lonhttpd_port=$Apache::lonnet::perlvar{'lonhttpdPort'}; |
my $lonhttpd_port=$Apache::lonnet::perlvar{'lonhttpdPort'}; |
if (!defined($lonhttpd_port)) { $lonhttpd_port='8080'; } |
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 'https://'.$ENV{'SERVER_NAME'}.$url; |
|
} |
return 'http://'.$ENV{'SERVER_NAME'}.':'.$lonhttpd_port.$url; |
return 'http://'.$ENV{'SERVER_NAME'}.':'.$lonhttpd_port.$url; |
} |
} |
|
|