--- loncom/interface/loncommon.pm 2009/01/08 19:51:28 1.692.2.11 +++ loncom/interface/loncommon.pm 2008/12/06 17:29:34 1.709 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.692.2.11 2009/01/08 19:51:28 raeburn Exp $ +# $Id: loncommon.pm,v 1.709 2008/12/06 17:29:34 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -271,7 +271,7 @@ BEGIN { } } &Apache::lonnet::logthis( - "INFO: Read file types"); + "INFO: Read file types"); $readit=1; } # end of unless($readit) @@ -926,7 +926,7 @@ sub help_open_topic { if ($text ne "") { $template .= "". - "
$text"; + "$text"; } # Add the graphic @@ -935,7 +935,7 @@ sub help_open_topic { $template .= <<"ENDTEMPLATE"; (Help: $topic) ENDTEMPLATE - if ($text ne '') { $template.='
' }; + if ($text ne '') { $template.='' }; return $template; } @@ -1128,7 +1128,7 @@ sub help_open_bug { { $template .= "". - "
$text"; + "$text"; } # Add the graphic @@ -1173,7 +1173,7 @@ sub help_open_faq { { $template .= "". - "'."\n";; } @@ -6557,35 +6782,19 @@ sub default_quota { if ($inststatus ne '') { my @statuses = split(/:/,$inststatus); foreach my $item (@statuses) { - if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') { - if ($quotahash{'quotas'}{'defaultquota'}{$item} ne '') { - if ($defquota eq '') { - $defquota = $quotahash{'quotas'}{'defaultquota'}{$item}; - $settingstatus = $item; - } elsif ($quotahash{'quotas'}{'defaultquota'}{$item} > $defquota) { - $defquota = $quotahash{'quotas'}{'defaultquota'}{$item}; - $settingstatus = $item; - } - } - } else { - if ($quotahash{'quotas'}{$item} ne '') { - if ($defquota eq '') { - $defquota = $quotahash{'quotas'}{$item}; - $settingstatus = $item; - } elsif ($quotahash{'quotas'}{$item} > $defquota) { - $defquota = $quotahash{'quotas'}{$item}; - $settingstatus = $item; - } + if ($quotahash{'quotas'}{$item} ne '') { + if ($defquota eq '') { + $defquota = $quotahash{'quotas'}{$item}; + $settingstatus = $item; + } elsif ($quotahash{'quotas'}{$item} > $defquota) { + $defquota = $quotahash{'quotas'}{$item}; + $settingstatus = $item; } } } } if ($defquota eq '') { - if (ref($quotahash{'quotas'}{'defaultquota'}) eq 'HASH') { - $defquota = $quotahash{'quotas'}{'defaultquota'}{'default'}; - } else { - $defquota = $quotahash{'quotas'}{'default'}; - } + $defquota = $quotahash{'quotas'}{'default'}; $settingstatus = 'default'; } } else { @@ -7381,9 +7590,9 @@ sub upload_embedded { ' '. $orig_uploaded_filename.'
'; } else { - $output .= ''. + $output .= ''. &mt('View embedded file: [_1]',''. - $orig_uploaded_filename.'').'
'; + $orig_uploaded_filename.'').'
'; } } close($fh); @@ -7730,7 +7939,7 @@ sub csv_print_select_table { &end_data_table_header_row()."\n"); foreach my $array_ref (@$d) { my ($value,$display,$defaultcol)=@{ $array_ref }; - $r->print(&start_data_table_row().''); + $r->print(&start_data_table_row().''); $r->print('
$text"; + "$text"; } # Add the graphic @@ -2717,42 +2717,6 @@ sub flush_email_cache { &Apache::lonnet::devalidate_cache_new('emailscache',$id); } -# -------------------------------------------------------------------- getlangs - -=pod - -=item * &getlangs($uname,$udom) - -Gets a user's language preference and returns it as a hash with key: -language. - -=cut - -sub getlangs { - my ($uname,$udom) = @_; - if (!$udom) { $udom =$env{'user.domain'}; } - if (!$uname) { $uname=$env{'user.name'}; } - my $id=$uname.':'.$udom; - my ($langs,$cached)=&Apache::lonnet::is_cached_new('userlangs',$id); - if ($cached) { - return %{$langs}; - } else { - my %loadlangs=&Apache::lonnet::get('environment',['languages'], - $udom,$uname); - &Apache::lonnet::do_cache_new('userlangs',$id,\%loadlangs); - return %loadlangs; - } -} - -sub flush_langs_cache { - my ($uname,$udom)=@_; - if (!$udom) { $udom =$env{'user.domain'}; } - if (!$uname) { $uname=$env{'user.name'}; } - return if ($udom eq 'public' && $uname eq 'public'); - my $id=$uname.':'.$udom; - &Apache::lonnet::devalidate_cache_new('userlangs',$id); -} - # ------------------------------------------------------------------ Screenname =pod @@ -2804,10 +2768,7 @@ sub aboutmewrapper { sub syllabuswrapper { - my ($linktext,$coursedir,$domain,$fontcolor)=@_; - if ($fontcolor) { - $linktext=''.$linktext.''; - } + my ($linktext,$coursedir,$domain)=@_; return qq{$linktext}; } @@ -3207,7 +3168,7 @@ sub relative_to_absolute { } $thisdir=~s-/[^/]*$--; foreach my $link (@rlinks) { - unless (($link=~/^https?\:\/\//i) || + unless (($link=~/^http:\/\//i) || ($link=~/^\//) || ($link=~/^javascript:/i) || ($link=~/^mailto:/i) || @@ -3918,7 +3879,7 @@ sub get_domainconf { foreach my $key (keys(%{$domconfig{'login'}})) { if (ref($domconfig{'login'}{$key}) eq 'HASH') { foreach my $img (keys(%{$domconfig{'login'}{$key}})) { - $designhash{$udom.'.login.'.$key.'_'.$img} = + $designhash{$udom.'.login.'.$key.'_'.$img} = $domconfig{'login'}{$key}{$img}; } } else { @@ -4256,7 +4217,7 @@ ENDROLE .''.&mt('Construction Space').': ' .'
' - .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."$lastitem
" + .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."$lastitem
" .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()') .'
' .&Apache::lonmenu::constspaceform(); @@ -4430,6 +4391,8 @@ sub standard_css { my $vlink = &designparm($function.'.vlink', $domain); my $link = &designparm($function.'.link', $domain); + my $loginbg = &designparm('login.sidebg',$domain); + my $sans = 'Verdana,Arial,Helvetica,sans-serif'; my $mono = 'monospace'; my $data_table_head = $tabbg; @@ -4447,6 +4410,7 @@ sub standard_css { my $mail_other_hover = '#669999'; my $table_header = '#DDDDDD'; my $feedback_link_bg = '#BBBBBB'; + my $lg_border_color = '#C8C8C8'; my $border = ($env{'browser.type'} eq 'explorer' || $env{'browser.type'} eq 'safari' ) ? '0px 2px 0px 2px' @@ -4454,22 +4418,35 @@ sub standard_css { return < td { - background-color: #CCC; - font-weight: bold; - text-align: left; + font-size:90%; } table.LC_data_table tr.LC_odd_row > td, +table.LC_pick_box tr > td.LC_odd_row, table.LC_aboutme_port tr td { background-color: $data_table_light; padding: 2px; } table.LC_data_table tr.LC_even_row > td, +table.LC_pick_box tr > td.LC_even_row, table.LC_aboutme_port tr.LC_even_row td { background-color: $data_table_dark; + padding: 2px; } table.LC_data_table tr.LC_data_table_highlight td { background-color: $data_table_darker; @@ -4776,7 +4730,7 @@ table.LC_nested tr.LC_empty_row td { table.LC_nested_outer tr th { font-weight: bold; background-color: $data_table_head; - font-size: smaller; + font-size: small; border-bottom: 1px solid #000000; } table.LC_nested_outer tr td.LC_subheader { @@ -4815,7 +4769,7 @@ table.LC_createuser { } table.LC_createuser tr.LC_section_row td { - font-size: smaller; + font-size: small; } table.LC_createuser tr.LC_info_row td { @@ -4871,71 +4825,46 @@ table.LC_mail_list tr.LC_mail_even { table.LC_mail_list tr.LC_mail_odd { } - -table#LC_portfolio_actions { - width: auto; - background: $pgbg; - border: 0px; - border-spacing: 2px 2px; - padding: 0px; - margin: 0px; - border-collapse: separate; -} -table#LC_portfolio_actions td.LC_label { - background: $tabbg; - text-align: right; +table.LC_data_table tr > td.LC_browser_file, +table.LC_data_table tr > td.LC_browser_file_published { + background: #CCFF88; } -table#LC_portfolio_actions td.LC_value { - background: $tabbg; +table.LC_data_table tr > td.LC_browser_file_locked, +table.LC_data_table tr > td.LC_browser_file_unpublished { + background: #FFAA99; } - -table#LC_cstr_controls { - width: 100%; - border-collapse: collapse; +table.LC_data_table tr > td.LC_browser_file_obsolete { + background: #AAAAAA; } -table#LC_cstr_controls tr td { - border: 4px solid $pgbg; - padding: 4px; - text-align: center; - background: $tabbg; +table.LC_data_table tr > td.LC_browser_file_modified, +table.LC_data_table tr > td.LC_browser_file_metamodified { + background: #FFFF77; } -table#LC_cstr_controls tr th { - border: 4px solid $pgbg; - background: $table_header; - text-align: center; - font-family: $sans; - font-size: smaller; +table.LC_data_table tr.LC_browser_folder > td { + background: #CCCCFF; } -table#LC_browser { - +table.LC_data_table tr > td.LC_roles_is { +/* background: #77FF77; */ } -table#LC_browser tr th { - background: $table_header; -} -table#LC_browser tr td { - padding: 2px; -} -table#LC_browser tr.LC_browser_file, -table#LC_browser tr.LC_browser_file_published { - background: #CCFF88; +table.LC_data_table tr > td.LC_roles_future { + background: #FFFF77; } -table#LC_browser tr.LC_browser_file_locked, -table#LC_browser tr.LC_browser_file_unpublished { - background: #FFAA99; +table.LC_data_table tr > td.LC_roles_will { + background: #FFAA77; } -table#LC_browser tr.LC_browser_file_obsolete { - background: #AAAAAA; +table.LC_data_table tr > td.LC_roles_expired { + background: #FF7777; } -table#LC_browser tr.LC_browser_file_modified, -table#LC_browser tr.LC_browser_file_metamodified { - background: #FFFF77; +table.LC_data_table tr > td.LC_roles_will_not { + background: #AAFF77; } -table#LC_browser tr.LC_browser_folder { - background: #CCCCFF; +table.LC_data_table tr > td.LC_roles_selected { + background: #11CC55; } + span.LC_current_location { - font-size: x-large; + font-size:larger; background: $pgbg; } @@ -5390,7 +5319,8 @@ div.LC_grade_select_mode_selector { float: left; } div.LC_grade_select_mode_selector_header { - font: bold medium $sans; + font-weight: bold; + font-size: medium; } div.LC_grade_select_mode_type { clear: left; @@ -5403,7 +5333,8 @@ div.LC_grade_show_user { div.LC_grade_user_name { background: #DDDDEE; border-bottom: 1px solid black; - font: bold large $sans; + font-weight: bold; + font-size: large; } div.LC_grade_show_user_odd_row div.LC_grade_user_name { background: #DDEEDD; @@ -5422,7 +5353,8 @@ div.LC_grade_show_problem_header, div.LC_grade_submissions_header, div.LC_grade_message_center_header, div.LC_grade_assign_header { - font: bold large $sans; + font-weight: bold; + font-size: large; } div.LC_grade_show_problem_problem, div.LC_grade_submissions_body, @@ -5433,7 +5365,8 @@ div.LC_grade_assign_body { background: #FFFFFF; } span.LC_grade_check_note { - font: normal medium $sans; + font-weight: normal; + font-size: medium; display: inline; position: absolute; right: 1em; @@ -5443,12 +5376,13 @@ table.LC_scantron_action { width: 100%; } table.LC_scantron_action tr th { - font: normal bold $sans; + font-weight:bold; + font-style:normal; } - -div.LC_edit_problem_header, +.LC_edit_problem_header, div.LC_edit_problem_footer { - font: normal medium $sans; + font-weight: normal; + font-size: medium; margin: 2px; } div.LC_edit_problem_header, @@ -5465,12 +5399,14 @@ div.LC_edit_problem_header_edit_row { margin-bottom: 5px; } div.LC_edit_problem_header_title { - font: larger bold $sans; + font-weight: bold; + font-size: larger; background: $tabbg; padding: 3px; } table.LC_edit_problem_header_title { - font: larger bold $sans; + font-size: larger; + font-weight: bold; width: 100%; border-color: $pgbg; border-style: solid; @@ -5518,15 +5454,304 @@ table#LC_mainmenu td.LC_mainmenu_col_fie font-size: small; font-weight: bold; } -fieldset#LC_mainmenu_fieldset { - margin:0px 10px 10px 0px; +/* ---- Remove when done ---- +# The following styles is part of the redesign of LON-CAPA and are +# subject to change during this project. +# Don't rely on their current functionality as they might be +# changed or removed. +# --------------------------*/ + +a:hover, +ol.smallMenu a:hover, +ol#MenuBreadcrumbs a:hover, +ul#TabMainMenuContent a:hover, +.FormSectionClearButton input:hover{ + color:#BF2317; + text-decoration:none; +} + +h1 { + padding:5px 10px 5px 0px; + line-height:130%; +} + +h2,h3,h4,h5,h6 +{ +margin:5px 0px 5px 0px; +line-height:130%; +} +.hcell{ + padding:3px 15px 3px 15px; + margin:0px; + background-color:$tabbg; + border-bottom:solid 1px $lg_border_color; +} +.noBorder { + border:0px; +} +/* +.bgLightGrey { background:URL(images/TabMenuBG.png) repeat-x left top; } +.bgLightGreyYellow {background-color:#EFECE0;} +*/ + + +/* Main Header with discription of Person, Course, etc. */ +.HeadRight { + text-align: right; + float: right; + margin: 0px; + padding: 0px; + right:0; + position:absolute; + overflow:hidden; +} + +p { + padding: 10px; + +} +.FormSectionClearButton input { + background-color:transparent; + border:0px; + cursor:pointer; + text-decoration:underline; +} + + +dl,ul,div,fieldset { + margin: 10px 10px 10px 0px; + overflow:hidden; +} +ol.smallMenu { + margin: 0px; +} + +ol.smallMenu li { + display: inline; + padding: 5px 5px 0px 10px; + vertical-align: top; +} + +ol.smallMenu li img { + vertical-align: bottom; +} + +ol.smallMenu a { + font-size: 90%; + color: RGB(80, 80, 80); + text-decoration: none; +} + +ol#TabMainMenuContent { + + margin: 0px 0px 10px 0px; + padding: 0px; +} + +ol#TabMainMenuContent li { + display: inline; + vertical-align: bottom; + border-bottom: solid 1px RGB(175, 175, 175); + border-right: solid 1px RGB(175, 175, 175); + padding: 5px 15px 5px 15px; + margin-right:4px; + line-height: 140%; + font-weight: bold; + overflow:hidden; +/* background: RGB(211, 206, 205) URL(images/TabMenuBG.png) repeat-x left top;*/ +} + +ol#TabMainMenuContent li a{ + color: RGB(47, 47, 47); + text-decoration: none; +} + +ol#TabMainMenuContent div.columnSection { + margin-bottom: 0px; +} + +ol#MenuBreadcrumbs, ol#PathBreadcrumbs { + border-top: solid 1px RGB(255, 255, 255); + height: 20px; + line-height: 20px; + vertical-align: bottom; + margin: 0px 0px 30px 0px; + padding-left: 10px; + list-style-position: inside; +/* background: RGB(211, 206, 205) URL(images/TabMenuBG.png) repeat-x left + top;*/ } -div.LC_createcourse { - margin: 10px 10px 10px 10px; +ol#MenuBreadcrumbs li, ol#PathBreadcrumbs li { +/* background: url(images/pfeil_white.png) no-repeat left center;*/ + display: inline; + padding: 0px 0px 0px 10px; + vertical-align: bottom; + overflow:hidden; } +ol#MenuBreadcrumbs li a { + text-decoration: none; + font-size:90%; +} +ol#PathBreadcrumbs li a{ + text-decoration:none; + font-size:100%; + font-weight:bold; +} + +.ContentBoxSpecial +{ + border: solid 1px $lg_border_color; +} +.ContentBox { + padding:10px; +} +.PopUp +{ + padding:10px; + border-left:solid 1px $lg_border_color; + border-top:solid 1px $lg_border_color; + border-bottom:outset 1px $lg_border_color; + border-right:outset 1px $lg_border_color; + display:none; + position:absolute; + right:0; + background-color:white; + z-index:5; +} + +dl.ListStyleClean dt { + padding-right: 5px; + display: table-header-group; +} + +dl.ListStyleClean dd { + display: table-row; +} + +.ListStyleClean, +.ListStyleSimple, +.ListStyleNormal, +.ListStyleNormal_Border, +.ListStyleSpecial + { + /*display:block; */ + list-style-position: inside; + list-style-type: none; + overflow: hidden; + padding: 0px; +} + +.ListStyleSimple li, +.ListStyleSimple dd, +.ListStyleNormal li, +.ListStyleNormal dd, +.ListStyleSpecial li, +.ListStyleSpecial dd + { + margin: 0px; + padding: 5px 5px 5px 10px; + clear: both; +} + +.ListStyleClean li, +.ListStyleClean dd { + padding-top: 0px; + padding-bottom: 0px; +} + +.ListStyleSimple dd, +.ListStyleSimple li{ + border-bottom: solid 1px $lg_border_color; +} + +.ListStyleSpecial li, +.ListStyleSpecial dd { + list-style-type: none; + background-color: RGB(220, 220, 220); + margin-bottom: 4px; +} + +table.SimpleTable { + margin:5px; + border:solid 1px $lg_border_color; + } + +table.SimpleTable tr { + padding:0px; + border:solid 1px $lg_border_color; +} +table.SimpleTable thead{ + background:rgb(220,220,220); +} + +div.columnSection { + display: block; + clear: both; + overflow: hidden; + margin:0px; +} + +div.columnSection>* { + float: left; + margin: 10px 20px 10px 0px; + overflow:hidden; +} +div.columnSection > .ContentBox, +div.columnSection > .ContentBoxSpecial + { + width: 400px; + +} + +.LC_loginpage_container { + text-align:left; + margin : 0 auto; + width:65%; + padding: 10px; + height: auto; +# background-color:#FFFFFF; + background-color:$loginbg; + border:1px solid #CCCCCC; +} + + +.LC_loginpage_loginContainer { + float:left; + width:60%; +} + +.LC_loginpage_loginInfo { + margin-top:20px; + margin-left:20px; + float:left; + width:30%; + border:1px solid #CCCCCC; + padding:10px; +} + +.LC_loginpage_space { + clear:both; + margin-bottom:20px; + border-bottom: 1px solid #CCCCCC; +} + +.LC_loginpage_fieldset{ + border: 1px solid #CCCCCC; + margin: 0 auto; +} + +.LC_loginpage_legend{ + padding: 2px; + margin: 0px; + font-size:14px; + font-weight:bold; +} + + + END } @@ -5941,7 +6166,7 @@ sub simple_error_page { } sub start_data_table_empty_row { - $row_count[0]++; +# $row_count[0]++; return '
'.$display.'
'.$display.'