--- loncom/interface/loncommon.pm 2011/12/26 13:47:18 1.1028.2.1
+++ loncom/interface/loncommon.pm 2011/12/09 01:04:27 1.1034
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1028.2.1 2011/12/26 13:47:18 foxr Exp $
+# $Id: loncommon.pm,v 1.1034 2011/12/09 01:04:27 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -154,7 +154,6 @@ sub ssi_with_retries {
# ----------------------------------------------- Filetypes/Languages/Copyright
my %language;
my %supported_language;
-my %latex_language; # Language name LaTeX uses for selecting hyphenation.
my %cprtag;
my %scprtag;
my %fe; my %fd; my %fm;
@@ -187,14 +186,11 @@ BEGIN {
while (my $line = <$fh>) {
next if ($line=~/^\#/);
chomp($line);
- my ($key,$two,$country,$three,$enc,$val,$sup,$latex)=(split(/\t/,$line));
+ my ($key,$two,$country,$three,$enc,$val,$sup)=(split(/\t/,$line));
$language{$key}=$val.' - '.$enc;
if ($sup) {
$supported_language{$key}=$sup;
}
- if ($latex) {
- $latex_language{$two} = $latex;
- }
}
close($fh);
}
@@ -1190,7 +1186,7 @@ sub help_open_topic {
my ($topic, $text, $stayOnPage, $width, $height, $imgid) = @_;
$text = "" if (not defined $text);
$stayOnPage = 0 if (not defined $stayOnPage);
- $width = 350 if (not defined $width);
+ $width = 500 if (not defined $width);
$height = 400 if (not defined $height);
my $filename = $topic;
$filename =~ s/ /_/g;
@@ -1201,7 +1197,7 @@ sub help_open_topic {
$topic=~s/\W/\_/g;
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:openMyModal('/adm/help/${filename}.hlp',$width,$height,'yes');";
} else {
$link = "/adm/help/${filename}.hlp";
}
@@ -3234,29 +3230,11 @@ sub languagedescription {
($supported_language{$code}?' ('.&mt('interface available').')':'');
}
-=pod
-
-=item * &plainlanguagedescription
-
-Returns both the plain language description (e.g. 'Creoles and Pidgins, English-based (Other)')
-and the language character encoding (e.g. ISO) separated by a ' - ' string.
-
-=cut
-
sub plainlanguagedescription {
my $code=shift;
return $language{$code};
}
-=pod
-
-=item * &supportedlanguagecode
-
-Returns the supported language code (e.g. sptutf maps to pt) given a language
-code.
-
-=cut
-
sub supportedlanguagecode {
my $code=shift;
return $supported_language{$code};
@@ -3264,21 +3242,6 @@ sub supportedlanguagecode {
=pod
-=item * &latexlanguage()
-
-Given a language key code returns the correspondnig language to use
-to select the correct hyphenation on LaTeX printouts. This is undef if there
-is no supported hyphenation for the language code.
-
-=cut
-
-sub latexlanguage {
- my $code = shift;
- return $latex_language{$code};
-}
-
-=pod
-
=item * ©rightids()
returns list of all copyrights
@@ -5561,6 +5524,11 @@ span.LC_current_location {
background: $pgbg;
}
+span.LC_current_nav_location {
+ font-weight:bold;
+ background: $sidebg;
+}
+
span.LC_parm_menu_item {
font-size: larger;
}
@@ -6666,6 +6634,53 @@ ul.LC_funclist li {
display: none;
}
+.LCmodal-overlay {
+ position:fixed;
+ top:0;
+ right:0;
+ bottom:0;
+ left:0;
+ height:100%;
+ width:100%;
+ margin:0;
+ padding:0;
+ background:#999;
+ opacity:.75;
+ filter: alpha(opacity=75);
+ -moz-opacity: 0.75;
+ z-index:101;
+}
+
+* html .LCmodal-overlay {
+ position: absolute;
+ height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
+}
+
+.LCmodal-window {
+ position:fixed;
+ top:50%;
+ left:50%;
+ margin:0;
+ padding:0;
+ z-index:102;
+ }
+
+* html .LCmodal-window {
+ position:absolute;
+}
+
+.LCclose-window {
+ position:absolute;
+ width:32px;
+ height:32px;
+ right:8px;
+ top:8px;
+ background:transparent url('/res/adm/pages/process-stop.png') no-repeat scroll right top;
+ text-indent:-99999px;
+ overflow:hidden;
+ cursor:pointer;
+}
+
END
}
@@ -6724,8 +6739,16 @@ sub headtag {
&& !$args->{'only_body'}
&& !$args->{'frameset'}) {
$result .= &help_menu_js();
+ $result.=&modal_window();
+ $result.=&wishlist_window();
+ } else {
+ if ($args->{'add_modal'}) {
+ $result.=&modal_window();
+ }
+ if ($args->{'add_wishlist'}) {
+ $result.=&wishlist_window();
+ }
}
-
if (ref($args->{'redirect'})) {
my ($time,$url,$inhibit_continue) = @{$args->{'redirect'}};
$url = &Apache::lonenc::check_encrypt($url);
@@ -6850,32 +6873,12 @@ $args - additional optional args support
sub start_page {
my ($title,$head_extra,$args) = @_;
#&Apache::lonnet::logthis("start_page ".join(':',caller(0)));
-#SD
-#I don't see why we copy certain elements of %$args to %head_args
-#head args is passed to headtag() and this routine only reads those
-#keys that are needed. There doesn't happen any writes or any processing
-#of other keys.
-#proposal: just pass $args to headtag instead of \%head_args and delete
-#marked lines
-#<- MARK
- my %head_args;
- foreach my $arg ('redirect','force_register','domain','function',
- 'bgcolor','frameset','no_nav_bar','only_body',
- 'no_auto_mt_title') {
- if (defined($args->{$arg})) {
- $head_args{$arg} = $args->{$arg};
- }
- }
-#MARK ->
$env{'internal.start_page'}++;
my $result;
if (! exists($args->{'skip_phases'}{'head'}) ) {
- $result .=
- &xml_begin() . &headtag($title,$head_extra,\%head_args);
-#replace prev line by
-# &xml_begin() . &headtag($title, $head_extra, $args);
+ $result .= &xml_begin() . &headtag($title, $head_extra, $args);
}
if (! exists($args->{'skip_phases'}{'body'}) ) {
@@ -6941,7 +6944,6 @@ sub end_page {
}
$result .= &Apache::lonxml::xmlend($target,$parser);
}
-
if ($args->{'frameset'}) {
$result .= '';
} else {
@@ -6960,6 +6962,100 @@ sub end_page {
return $result;
}
+sub wishlist_window {
+ return(<<'ENDWISHLIST');
+
+ENDWISHLIST
+}
+
+sub modal_window {
+ return(<<'ENDMODAL');
+
+ENDMODAL
+}
+
+sub modal_link {
+ my ($link,$linktext,$width,$height,$target,$scrolling)=@_;
+ unless ($width) { $width=480; }
+ unless ($height) { $height=400; }
+ unless ($scrolling) { $scrolling='yes'; }
+ return ''.
+ $linktext.'';
+}
+
+sub modal_adhoc_script {
+ my ($funcname,$width,$height,$content)=@_;
+ return (<
+//
+
+ENDADHOC
+}
+
sub html_encode {
my ($result) = @_;