version 1.189, 2004/04/21 20:46:58
|
version 1.198, 2004/07/12 17:02:07
|
Line 74 my $readit;
|
Line 74 my $readit;
|
my %language; |
my %language; |
my %supported_language; |
my %supported_language; |
my %cprtag; |
my %cprtag; |
|
my %scprtag; |
my %fe; my %fd; |
my %fe; my %fd; |
my %category_extensions; |
my %category_extensions; |
|
|
Line 131 BEGIN {
|
Line 132 BEGIN {
|
close($fh); |
close($fh); |
} |
} |
} |
} |
|
# ------------------------------------------------------------------ source copyrights |
|
{ |
|
my $sourcecopyrightfile = $Apache::lonnet::perlvar{'lonIncludes'}. |
|
'/source_copyright.tab'; |
|
if ( open (my $fh,"<$sourcecopyrightfile") ) { |
|
while (<$fh>) { |
|
next if /^\#/; |
|
chomp; |
|
my ($key,$val)=(split(/\s+/,$_,2)); |
|
$scprtag{$key}=$val; |
|
} |
|
close($fh); |
|
} |
|
} |
|
|
# -------------------------------------------------------------- domain designs |
# -------------------------------------------------------------- domain designs |
|
|
Line 622 sub helpLatexCheatsheet {
|
Line 637 sub helpLatexCheatsheet {
|
.'</td></tr></table>'; |
.'</td></tr></table>'; |
} |
} |
|
|
|
sub help_open_menu { |
|
my ($color,$topic,$component_help,$function,$faq,$bug,$stayOnPage,$width,$height,$text) = @_; |
|
$text = "" if (not defined $text); |
|
$stayOnPage = 0 if (not defined $stayOnPage); |
|
if ($ENV{'browser.interface'} eq 'textual' || |
|
$ENV{'environment.remote'} eq 'off' ) { |
|
$stayOnPage=1; |
|
} |
|
$width = 620 if (not defined $width); |
|
$height = 600 if (not defined $height); |
|
my $link=''; |
|
my $title = &mt('Choose your help'); |
|
my $origurl = $ENV{'REQUEST_URI'}; |
|
my $timestamp = time; |
|
foreach (\$color,\$function,\$topic,\$component_help,\$faq,\$bug,\$origurl) { |
|
$$_ = &Apache::lonnet::escape($$_); |
|
} |
|
|
|
if (!$stayOnPage) { |
|
$link = "javascript:helpMenu('open')"; |
|
} else { |
|
$link = "javascript:helpMenu('display')"; |
|
} |
|
my $banner_link = "/adm/helpmenu?page=banner&color=$color&function=$function&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp&stayonpage=$stayOnPage"; |
|
my $details_link = "/adm/helpmenu?page=body&color=$color&function=$function&topic=$topic&component_help=$component_help&faq=$faq&bug=$bug&origurl=$origurl&stamp=$timestamp"; |
|
my $template; |
|
if ($text ne "") { |
|
$template .= |
|
"<table bgcolor='#337733' cellspacing='1' cellpadding='1' border='0'><tr>". |
|
"<td bgcolor='#448844'><a href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>"; |
|
} |
|
$template .= <<"ENDTEMPLATE"; |
|
<script> |
|
function helpMenu(caller) { |
|
if (caller == 'open') { |
|
newWindow = window.open("","helpmenu","HEIGHT=$height,WIDTH=$width,resize=yes,scrollbars=yes" ) |
|
caller = newWindow.document |
|
} else { |
|
caller = this.document |
|
} |
|
caller.write("<html><head><title>LON-CAPA Help Menu</title><meta http-equiv='pragma' content='no-cache'></head>") |
|
caller.write("<frameset rows='105,*' border='0'><frame name='bannerframe' src='$banner_link'><frame name='bodyframe' src='$details_link'></frameset>") |
|
caller.write("</html>") |
|
caller.close() |
|
if (caller == newWindow.document) { |
|
caller.focus() |
|
} |
|
} |
|
</script> |
|
<a href="$link" title="$title"><image src="/adm/lonMisc/smallFAQ.gif" border="0" alt="(Help Menu)" /></a> |
|
ENDTEMPLATE |
|
if ($text ne '') { $template.='</td></tr></table>' }; |
|
return $template; |
|
} |
|
|
sub help_open_bug { |
sub help_open_bug { |
my ($topic, $text, $stayOnPage, $width, $height) = @_; |
my ($topic, $text, $stayOnPage, $width, $height) = @_; |
unless ($ENV{'user.adv'}) { return ''; } |
unless ($ENV{'user.adv'}) { return ''; } |
Line 907 sub domain_select {
|
Line 977 sub domain_select {
|
} &get_domains; |
} &get_domains; |
if ($multiple) { |
if ($multiple) { |
$domains{''}=&mt('Any domain'); |
$domains{''}=&mt('Any domain'); |
return &multiple_select_form($name,$value,%domains); |
return &multiple_select_form($name,$value,4,%domains); |
} else { |
} else { |
return &select_form($name,$value,%domains); |
return &select_form($name,$value,%domains); |
} |
} |
} |
} |
|
|
sub multiple_select_form { |
sub multiple_select_form { |
my ($name,$value,%hash)=@_; |
my ($name,$value,$size,%hash)=@_; |
my %selected = map { $_ => 1 } ref($value)?@{$value}:($value); |
my %selected = map { $_ => 1 } ref($value)?@{$value}:($value); |
my $output=''; |
my $output=''; |
my $size =(scalar keys %hash<4?scalar keys %hash:4); |
if (! defined($size)) { |
|
$size = 4; |
|
if (scalar(keys(%hash))<4) { |
|
$size = scalar(keys(%hash)); |
|
} |
|
} |
$output.="\n<select name='$name' size='$size' multiple='1'>"; |
$output.="\n<select name='$name' size='$size' multiple='1'>"; |
foreach (sort keys %hash) { |
foreach (sort(keys(%hash))) { |
$output.="<option name='$_'". |
$output.='<option value="'.$_.'" '; |
($selected{$_}?' selected="1"' :'').">$hash{$_}</option>\n"; |
$output.='selected ' if ($selected{$_}); |
|
$output.='>'.$hash{$_}."</option>\n"; |
} |
} |
$output.="</select>\n"; |
$output.="</select>\n"; |
return $output; |
return $output; |
Line 1651 sub plainname {
|
Line 1727 sub plainname {
|
$names{'lastname'}.' '.$names{'generation'}; |
$names{'lastname'}.' '.$names{'generation'}; |
$name=~s/\s+$//; |
$name=~s/\s+$//; |
$name=~s/\s+/ /g; |
$name=~s/\s+/ /g; |
|
if ($name !~ /\S/) { $name=$uname.'@'.$udom; } |
return $name; |
return $name; |
} |
} |
|
|
Line 1806 sub copyrightdescription {
|
Line 1883 sub copyrightdescription {
|
} |
} |
|
|
=pod |
=pod |
|
|
|
=item * source_copyrightids() |
|
|
|
returns list of all source copyrights |
|
|
|
=cut |
|
|
|
sub source_copyrightids { |
|
return sort(keys(%scprtag)); |
|
} |
|
|
|
=pod |
|
|
|
=item * source_copyrightdescription() |
|
|
|
returns description of a specified source copyright id |
|
|
|
=cut |
|
|
|
sub source_copyrightdescription { |
|
return &mt($scprtag{shift(@_)}); |
|
} |
|
|
|
=pod |
|
|
=item * filecategories() |
=item * filecategories() |
|
|