--- loncom/interface/loncommon.pm 2005/05/25 21:45:07 1.261
+++ loncom/interface/loncommon.pm 2005/11/08 03:12:35 1.284
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.261 2005/05/25 21:45:07 albertel Exp $
+# $Id: loncommon.pm,v 1.284 2005/11/08 03:12:35 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -152,19 +152,20 @@ BEGIN {
my $designdir=$Apache::lonnet::perlvar{'lonTabDir'}.'/lonDomColors';
opendir(DIR,$designdir);
while ($filename=readdir(DIR)) {
+ if ($filename!~/\.tab$/) { next; }
my ($domain)=($filename=~/^(\w+)\./);
- {
- my $designfile = $designdir.'/'.$filename;
- if ( open (my $fh,"<$designfile") ) {
- while (<$fh>) {
- next if /^\#/;
- chomp;
- my ($key,$val)=(split(/\=/,$_));
- if ($val) { $designhash{$domain.'.'.$key}=$val; }
- }
- close($fh);
- }
- }
+ {
+ my $designfile = $designdir.'/'.$filename;
+ if ( open (my $fh,"<$designfile") ) {
+ while (<$fh>) {
+ next if /^\#/;
+ chomp;
+ my ($key,$val)=(split(/\=/,$_));
+ if ($val) { $designhash{$domain.'.'.$key}=$val; }
+ }
+ close($fh);
+ }
+ }
}
closedir(DIR);
@@ -418,6 +419,31 @@ sub selectcourse_link {
'","'.$udomele.'","'.$desc.'","'.$extra_element.'");'."'>".&mt('Select Course')."";
}
+sub check_uncheck_jscript {
+ my $jscript = <<"ENDSCRT";
+function checkAll(field) {
+ if (field.length > 0) {
+ for (i = 0; i < field.length; i++) {
+ field[i].checked = true ;
+ }
+ } else {
+ field.checked = true
+ }
+}
+
+function uncheckAll(field) {
+ if (field.length > 0) {
+ for (i = 0; i < field.length; i++) {
+ field[i].checked = false ;
+ } } else {
+ field.checked = false ;
+ }
+}
+ENDSCRT
+ return $jscript;
+}
+
+
=pod
=item * linked_select_forms(...)
@@ -673,7 +699,6 @@ sub help_open_menu {
foreach (\$color,\$function,\$topic,\$component_help,\$faq,\$bug,\$origurl) {
$$_ = &Apache::lonnet::escape($$_);
}
-
if (!$stayOnPage) {
$link = "javascript:helpMenu('open')";
} else {
@@ -684,8 +709,8 @@ sub help_open_menu {
my $template;
if ($text ne "") {
$template .=
- "
".
- "$text";
+ "".
+ "$text";
}
my $nothing=&Apache::lonhtmlcommon::javascript_nothing();
my $html=&Apache::lonxml::xmlbegin();
@@ -699,7 +724,7 @@ function helpMenu(target) {
if (target == 'open') {
var newWindow = null;
try {
- newWindow = window.open("$nothing","helpmenu","HEIGHT=$height,WIDTH=$width,resizable=yes,scrollbars=yes" )
+ newWindow = window.open($nothing,"helpmenu","HEIGHT=$height,WIDTH=$width,resizable=yes,scrollbars=yes" )
}
catch(error) {
writeHelp(caller);
@@ -713,9 +738,9 @@ function helpMenu(target) {
return;
}
function writeHelp(caller) {
- caller.document.write('$htmlLON-CAPA Help Menu')
- caller.document.write("")
- caller.document.write(" |
|