--- loncom/interface/loncommon.pm 2006/07/04 21:31:02 1.419 +++ loncom/interface/loncommon.pm 2006/07/17 19:47:20 1.429 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.419 2006/07/04 21:31:02 raeburn Exp $ +# $Id: loncommon.pm,v 1.429 2006/07/17 19:47:20 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1918,12 +1918,20 @@ sub get_related_words { return (); } my @Words=(); + my $count=0; if (exists($thesaurus_db{$keyword})) { # The first element is the number of times # the word appears. We do not need it now. - (undef,@Words) = (split(/:/,$thesaurus_db{$keyword})); - for (my $i=0;$i<=$#Words;$i++) { - ($Words[$i],undef)= split(/\,/,$Words[$i]); + my (undef,@RelatedWords) = (split(/:/,$thesaurus_db{$keyword})); + my (undef,$mostfrequentcount)=split(/\,/,$RelatedWords[0]); + my $threshold=$mostfrequentcount/10; + foreach my $possibleword (@RelatedWords) { + my ($word,$wordcount)=split(/\,/,$possibleword); + if ($wordcount>$threshold) { + push(@Words,$word); + $count++; + if ($count>10) { last; } + } } } untie %thesaurus_db; @@ -3107,6 +3115,7 @@ sub standard_css { my $data_table_head = $tabbg; my $data_table_light = '#EEEEEE'; my $data_table_dark = '#DDD'; + my $data_table_darker = '#CCC'; my $data_table_highlight = '#FFFF00'; my $mail_new = '#FFBB77'; my $mail_new_hover = '#DD9955'; @@ -3124,7 +3133,9 @@ sub standard_css { h1, h2, h3, th { font-family: $sans } a:focus { color: red; background: yellow } table.thinborder { border-collapse: collapse; } -table.thinborder tr th, table.thinborder tr td { border-style: solid; border-width: 1px} +table.thinborder tr th { border-style: solid; border-width: 1px; background: $tabbg;} +table.thinborder tr td { border-style: solid; border-width: 1px} + form, .inline { display: inline; } .center { text-align: center; } .LC_filename {font-family: $mono;} @@ -3175,7 +3186,7 @@ table#LC_title_bar td { table#LC_title_bar td.LC_title_bar_who { background: $tabbg; color: $font; - font: medium $sans; + font: small $sans; text-align: right; } span.LC_title_bar_title { @@ -3264,19 +3275,32 @@ td.LC_menubuttons_img { table.LC_data_table, table.LC_mail_list { border: 1px solid #000000; border-collapse: separate; + border-spacing: 1px; +} +.LC_data_table_dense { + font-size: small; } table.LC_data_table tr th, table.LC_calendar tr th, table.LC_mail_list tr th { font-weight: bold; background-color: $data_table_head; + font-size: smaller; } table.LC_data_table tr td { background-color: $data_table_light; + padding: 2px; } table.LC_data_table tr.LC_even_row td { background-color: $data_table_dark; } -table.LC_data_table tr.LC_empty td { +table.LC_data_table tr.LC_data_table_highlight td { + background-color: $data_table_darker; +} +table.LC_data_table tr.LC_empty_row td { background-color: #FFFFFF; + font-weight: bold; + font-style: italic; + text-align: center; + padding: 8px; } table.LC_calendar { @@ -3474,6 +3498,97 @@ table#LC_helpmenu_links a:hover { background: #CCCCFF; } +table.LC_pick_box { + width: 100%; + border-collapse: separate; + background: white; + border: 1px solid black; + border-spacing: 1px; +} +table.LC_pick_box td.LC_pick_box_title { + background: $tabbg; + font-weight: bold; + text-align: right; + width: 184px; + padding: 8px; +} +table.LC_pick_box td.LC_pick_box_separator { + padding: 0px; + height: 1px; + background: black; +} +table.LC_pick_box td.LC_pick_box_submit { + text-align: right; +} + +table.LC_group_priv_box { + background: white; + border: 1px solid black; + border-spacing: 1px; +} +table.LC_group_priv_box td.LC_pick_box_title { + background: $tabbg; + font-weight: bold; + text-align: right; + width: 184px; +} +table.LC_group_priv_box td.LC_groups_fixed { + background: $data_table_light; + text-align: center; +} +table.LC_group_priv_box td.LC_groups_optional { + background: $data_table_dark; + text-align: center; +} +table.LC_group_priv_box td.LC_groups_functionality { + background: $data_table_darker; + text-align: center; + font-weight: bold; +} +table.LC_group_priv td { + text-align: left; + padding: 0px; +} + +table.LC_notify_front_page { + background: white; + border: 1px solid black; + padding: 8px; +} +table.LC_notify_front_page td { + padding: 8px; +} +.LC_navbuttons { + margin: 2ex 0ex 2ex 0ex; +} +.LC_topic_bar { + font-family: $sans; + font-weight: bold; + width: 100%; + background: $tabbg; + vertical-align: middle; + margin: 2ex 0ex 2ex 0ex; +} +.LC_topic_bar span { + vertical-align: middle; +} +.LC_topic_bar img { + vertical-align: bottom; +} +table.LC_course_group_status { + margin: 20px; +} +table.LC_status_selector td { + vertical-align: top; + text-align: center; + padding: 4px; +} +table.LC_descriptive_input td.LC_description { + vertical-align: top; + text-align: right; + font-weight: bold; +} + END } @@ -3844,8 +3959,10 @@ sub simple_error_page { { my $row_count; sub start_data_table { + my ($add_class) = @_; + my $css_class = (join(' ','LC_data_table',$add_class)); undef($row_count); - return ''."\n"; + return '
'."\n"; } sub end_data_table { @@ -3854,14 +3971,26 @@ sub simple_error_page { } sub start_data_table_row { + my ($add_class) = @_; $row_count++; - return ''."\n";; + my $css_class = ($row_count % 2)?'':'LC_even_row'; + $css_class = (join(' ',$css_class,$add_class)); + return ''."\n";; } sub end_data_table_row { return ''."\n";; } + sub start_data_table_empty_row { + $row_count++; + return ''."\n";; + } + + sub end_data_table_empty_row { + return ''."\n";; + } + sub start_data_table_header_row { return ''."\n";; } @@ -4113,10 +4242,10 @@ sub get_course_users { $section = 'none'; } if ((ref($sections) eq 'ARRAY') && (@{$sections} > 0)) { - if (grep/^all$/,@{$sections}) { + if (grep(/^all$/,@{$sections})) { $secmatch = 1; } elsif ($$classlist{$student}[$idx{section}] eq '') { - if (grep/^none$/,@{$sections}) { + if (grep(/^none$/,@{$sections})) { $secmatch = 1; } } else { @@ -4128,7 +4257,7 @@ sub get_course_users { next; } } - push (@{$seclists{$student}},$section); + push(@{$seclists{$student}},$section); if (defined($$types{'active'})) { if ($$classlist{$student}[$idx{status}] eq 'Active') { push(@{$$users{st}{$student}},'active'); @@ -4162,10 +4291,10 @@ sub get_course_users { if (($role) && (grep(/^\Q$role\E$/,@{$roles}))) { my ($uname,$udom) = split(/:/,$user); if ((ref($sections) eq 'ARRAY') && (@{$sections} > 0)) { - if (grep/^all$/,@{$sections}) { + if (grep(/^all$/,@{$sections})) { $secmatch = 1; } elsif ($usec eq '') { - if (grep/^none$/,@{$sections}) { + if (grep(/^none$/,@{$sections})) { $secmatch = 1; } } else { @@ -4185,7 +4314,7 @@ sub get_course_users { $usec); foreach my $type (keys(%{$types})) { if ($status eq $type) { - if (!grep/^\Q$type\E$/,@{$$users{$role}{$user}}) { + if (!grep(/^\Q$type\E$/,@{$$users{$role}{$user}})) { push(@{$$users{$role}{$user}},$type); } $match = 1; @@ -4195,7 +4324,7 @@ sub get_course_users { if (!exists($$userdata{$uname.':'.$udom})) { &get_user_info($udom,$uname,\%idx,$userdata); } - if (!grep/^\Q$usec\E$/,@{$seclists{$uname.':'.$udom}}) { + if (!grep(/^\Q$usec\E$/,@{$seclists{$uname.':'.$udom}})) { push(@{$seclists{$uname.':'.$udom}},$usec); } } @@ -4211,7 +4340,7 @@ sub get_course_users { if (defined($userdata) && !exists($$userdata{$owner.':'.$cdom})) { &get_user_info($cdom,$owner,\%idx,$userdata); - if (!grep/^none$/,@{$seclists{$owner.':'.$cdom}}) { + if (!grep(/^none$/,@{$seclists{$owner.':'.$cdom}})) { push(@{$seclists{$owner.':'.$cdom}},'none'); } }