--- loncom/interface/loncommon.pm 2009/11/04 14:08:36 1.909 +++ loncom/interface/loncommon.pm 2009/11/23 14:04:36 1.918 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.909 2009/11/04 14:08:36 raeburn Exp $ +# $Id: loncommon.pm,v 1.918 2009/11/23 14:04:36 wenzelju Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1942,7 +1942,7 @@ sub select_level_form { =pod -=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange) +=item * &select_dom_form($defdom,$name,$includeempty,$showdomdesc,$onchange,$incdoms) Returns a string containing a \n"; foreach my $dom (@domains) { @@ -4496,9 +4503,8 @@ sub bodytag { $env{'course.'.$env{'request.course.id'}. '.domain'}.'/'})) { my $cid = $env{'request.course.id'}; - $dc_info.= $cid.' '.$env{'course.'.$cid.'.internal.coursecode'}; + $dc_info = $cid.' '.$env{'course.'.$cid.'.internal.coursecode'}; $dc_info =~ s/\s+$//; - $dc_info = '('.$dc_info.')'; } $role = '('.$role.')' if $role; @@ -4506,7 +4512,9 @@ sub bodytag { if ($env{'environment.remote'} eq 'off') { # No Remote - if ($no_nav_bar) { return $bodytag; } + if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { + return $bodytag; + } if ($env{'request.state'} eq 'construct') { $forcereg=1; } @@ -4514,21 +4522,29 @@ sub bodytag { # $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls # } - $bodytag .= qq|
$name $role
- $realm $dc_info
| unless $env{'form.inhibitmenu'}; - if ( $env{'form.inhibitmenu'} eq 'yes' - || $ENV{'REQUEST_URI'} eq '/adm/logout' - || $env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { + if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { + if ($dc_info) { + $dc_info = qq|$dc_info|; + } + $bodytag .= qq|
$name $role
+ $realm $dc_info
|; return $bodytag; } + $bodytag .= qq|
$name $role
|; + $bodytag .= Apache::lonhtmlcommon::scripttag( Apache::lonmenu::utilityfunctions(), 'start'); $bodytag .= Apache::lonmenu::primary_menu(); + if ($dc_info) { + $dc_info = &dc_courseid_toggle($dc_info); + } + $bodytag .= qq|
$realm $dc_info
|; + #don't show menus for public users if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){ $bodytag .= Apache::lonmenu::secondary_menu(); @@ -4560,12 +4576,15 @@ sub bodytag { # Explicit link to get inline menu my $menu= ($no_inline_link?'' :''.&mt('Switch to Inline Menu Mode').''); - $bodytag .= qq|
$name $role - $realm $dc_info
+ + if ($dc_info) { + $dc_info = qq|($dc_info)|; + } + + $bodytag .= qq|
$name $role
  1. $menu
  2. -
| unless $env{'form.inhibitmenu'}; - # +
$realm $dc_info
| unless $env{'form.inhibitmenu'}; return(< @@ -4578,6 +4597,14 @@ $bodytag ENDBODY } +sub dc_courseid_toggle { + my ($dc_info) = @_; + return ' '. + ''. + &mt('(More ...)').''. + '
'.$dc_info.'
'; +} + sub make_attr_string { my ($register,$attr_ref) = @_; @@ -4709,44 +4736,47 @@ sub standard_css { my $mail_other_hover = '#669999'; my $table_header = '#DDDDDD'; my $feedback_link_bg = '#BBBBBB'; - my $lg_border_color = '#C8C8C8'; + my $lg_border_color = '#C8C8C8'; my $border = ($env{'browser.type'} eq 'explorer' || - $env{'browser.type'} eq 'safari' ) ? '0 2px 0 2px' - : '0 3px 0 4px'; + $env{'browser.type'} eq 'safari' ) ? '0 2px 0 2px' + : '0 3px 0 4px'; return < td text-align: left; } -table.LC_data_table tr.LC_odd_row > td, +table.LC_data_table tr.LC_odd_row > td { + background-color: $data_table_light; + padding: 2px; + vertical-align: top; +} + table.LC_pick_box tr > td.LC_odd_row { background-color: $data_table_light; + vertical-align: top; +} + +table.LC_data_table tr.LC_even_row > td { + background-color: $data_table_dark; padding: 2px; vertical-align: top; } -table.LC_data_table tr.LC_even_row > td, table.LC_pick_box tr > td.LC_even_row { background-color: $data_table_dark; - padding: 2px; vertical-align: top; } @@ -5149,6 +5227,7 @@ table.LC_createuser tr.LC_info_row td { table.LC_calendar { border: 1px solid #000000; border-collapse: collapse; + width: 98%; } table.LC_calendar_pickdate { @@ -5158,6 +5237,7 @@ table.LC_calendar_pickdate { table.LC_calendar tr td { border: 1px solid #000000; vertical-align: top; + width: 14%; } table.LC_calendar tr td.LC_calendar_day_empty { @@ -5230,7 +5310,7 @@ table.LC_data_table tr.LC_browser_folder } table.LC_data_table tr > td.LC_roles_is { -/* background: #77FF77; */ + /* background: #77FF77; */ } table.LC_data_table tr > td.LC_roles_future { @@ -5278,7 +5358,8 @@ span.LC_parm_part { color: blue; } -span.LC_parm_folder, span.LC_parm_symb { +span.LC_parm_folder, +span.LC_parm_symb { font-size: x-small; font-family: $mono; color: #AAAAAA; @@ -5460,15 +5541,17 @@ table.LC_notify_front_page td { .LC_topic_bar { font-weight: bold; - width: 100%; background: $tabbg; - vertical-align: middle; - margin: 2ex 0ex 2ex 0ex; + margin: 1em 0em 1em 2em; padding: 3px; + font-size: 1.2em; } .LC_topic_bar span { + left: 0.5em; + position: absolute; vertical-align: middle; + font-size: 1.2em; } .LC_topic_bar img { @@ -5501,12 +5584,12 @@ div.LC_feedback_link img { vertical-align:middle; } -div.LC_feedback_link a{ +div.LC_feedback_link a { text-decoration: none; } div.LC_comblock { - display:inline; + display:inline; color:$font; font-size:90%; } @@ -5598,7 +5681,7 @@ table.LC_prior_option { border-collapse: collapse; } -table.LC_prior_rank, +table.LC_prior_rank, table.LC_prior_match { border-collapse: collapse; } @@ -5828,17 +5911,17 @@ div.LC_edit_problem_saves { padding-bottom: 5px; } -img.stift{ +img.stift { border-width: 0; vertical-align: middle; } -table#LC_mainmenu{ - margin-top:10px; - width:80%; +table#LC_mainmenu { + margin-top:10px; + width:80%; } -table#LC_mainmenu td.LC_mainmenu_col_fieldset{ +table#LC_mainmenu td.LC_mainmenu_col_fieldset { vertical-align: top; width: 45%; } @@ -5851,7 +5934,14 @@ table#LC_mainmenu td.LC_mainmenu_col_fie } div.LC_createcourse { - margin: 10px 10px 10px 10px; + margin: 10px 10px 10px 10px; +} + +.LC_dccid { + margin: 0.2em 0 0 0; + padding: 0; + font-size: 90%; + display:none; } /* ---- Remove when done ---- @@ -5868,220 +5958,236 @@ ol#LC_PathBreadcrumbs a:hover, ul#LC_secondary_menu a:hover, .LC_FormSectionClearButton input:hover ul.LC_TabContent li:hover a { - color:#BF2317; - text-decoration:none; + color:#BF2317; + text-decoration:none; } h1 { - padding: 0; - line-height:130%; + padding: 0; + line-height:130%; } -h2,h3,h4,h5,h6 { - margin: 5px 0 5px 0; - padding: 0; - line-height:130%; +h2, +h3, +h4, +h5, +h6 { + margin: 5px 0 5px 0; + padding: 0; + line-height:130%; } .LC_hcell { - padding:3px 15px 3px 15px; - margin: 0; - background-color:$tabbg; - color:$fontmenu; - border-bottom:solid 1px $lg_border_color; + padding:3px 15px 3px 15px; + margin: 0; + background-color:$tabbg; + color:$fontmenu; + border-bottom:solid 1px $lg_border_color; } .LC_Box > .LC_hcell { - margin: 0 -10px 10px -10px; + margin: 0 -10px 10px -10px; } .LC_noBorder { - border: 0; + border: 0; } .LC_Right { - float: right; - margin: 0; - padding: 0; + float: right; + margin: 0; + padding: 0; } .LC_FormSectionClearButton input { - background-color:transparent; - border: none; - cursor:pointer; - text-decoration:underline; + background-color:transparent; + border: none; + cursor:pointer; + text-decoration:underline; } .LC_help_open_topic { - color: #FFFFFF; - background-color: #EEEEFF; - margin: 1px; - padding: 4px; - border: 1px solid #000033; - white-space: nowrap; -/* vertical-align: middle; */ + color: #FFFFFF; + background-color: #EEEEFF; + margin: 1px; + padding: 4px; + border: 1px solid #000033; + white-space: nowrap; + /* vertical-align: middle; */ } -dl,ul,div,fieldset { - margin: 10px 10px 10px 0; -/* overflow: hidden; */ +dl, +ul, +div, +fieldset { + margin: 10px 10px 10px 0; + /* overflow: hidden; */ } fieldset > legend { - font-weight: bold; - padding: 0 5px 0 5px; + font-weight: bold; + padding: 0 5px 0 5px; } #LC_nav_bar { - float: left; - margin: 0.2em 0 0 0; + float: left; + margin: 0.2em 0 0 0; } -#LC_nav_bar em{ - font-weight: bold; - font-style: normal; +#LC_realm { + margin: 0.2em 0 0 0; + padding: 0; + font-weight: bold; + text-align: center; +} + +#LC_nav_bar em { + font-weight: bold; + font-style: normal; } ol.LC_primary_menu { - float: right; - margin: 0.2em 0 0 0; + float: right; + margin: 0.2em 0 0 0; } ol#LC_PathBreadcrumbs { - margin: 0; + margin: 0; } ol.LC_primary_menu li { - display: inline; - padding: 5px 5px 0 10px; - vertical-align: top; + display: inline; + padding: 5px 5px 0 10px; + vertical-align: top; } ol.LC_primary_menu li img { - vertical-align: bottom; + vertical-align: bottom; } ol.LC_primary_menu a { - font-size: 90%; - color: RGB(80, 80, 80); - text-decoration: none; + font-size: 90%; + color: RGB(80, 80, 80); + text-decoration: none; } ul#LC_secondary_menu { - clear: both; - color: $fontmenu; - background: $tabbg; - list-style: none; - padding: 0; - margin: 0; - width: 100%; + clear: both; + color: $fontmenu; + background: $tabbg; + list-style: none; + padding: 0; + margin: 0; + width: 100%; } ul#LC_secondary_menu li { - font-weight: bold; - line-height: 1.8em; - padding: 0 0.8em; - border-right: 1px solid black; - display: inline; - vertical-align: middle; + font-weight: bold; + line-height: 1.8em; + padding: 0 0.8em; + border-right: 1px solid black; + display: inline; + vertical-align: middle; } ul.LC_TabContent { - display:block; - background: $sidebg; - border-bottom: solid 1px $lg_border_color; - list-style:none; - margin: 0 -10px; - padding: 0; + display:block; + background: $sidebg; + border-bottom: solid 1px $lg_border_color; + list-style:none; + margin: 0 -10px; + padding: 0; } ul.LC_TabContent li, ul.LC_TabContentBigger li { - float:left; + float:left; } ul#LC_secondary_menu li a { - color: $fontmenu; - text-decoration: none; + color: $fontmenu; + text-decoration: none; } ul.LC_TabContent { - min-height:1.5em; + min-height:1.5em; } ul.LC_TabContent li { - vertical-align:middle; - padding: 0 10px 0 10px; - background-color:$tabbg; - border-bottom:solid 1px $lg_border_color; + vertical-align:middle; + padding: 0 10px 0 10px; + background-color:$tabbg; + border-bottom:solid 1px $lg_border_color; } ul.LC_TabContent .right { - float:right; + float:right; } -ul.LC_TabContent li a, ul.LC_TabContent li { - color:rgb(47,47,47); - text-decoration:none; - font-size:95%; - font-weight:bold; - padding-right: 16px; +ul.LC_TabContent li a, +ul.LC_TabContent li { + color:rgb(47,47,47); + text-decoration:none; + font-size:95%; + font-weight:bold; + padding-right: 16px; } -ul.LC_TabContent li:hover, ul.LC_TabContent li.active { - background:#FFFFFF url(/adm/lonIcons/open.gif) no-repeat scroll right center; - border-bottom:solid 2px #FFFFFF; - padding-right: 16px; +ul.LC_TabContent li:hover, +ul.LC_TabContent li.active { + background:#FFFFFF url(/adm/lonIcons/open.gif) no-repeat scroll right center; + border-bottom:solid 2px #FFFFFF; + padding-right: 16px; } #maincoursedoc { - clear:both; + clear:both; } ul.LC_TabContentBigger { - display:block; - list-style:none; - padding: 0; + display:block; + list-style:none; + padding: 0; } ul.LC_TabContentBigger li { - vertical-align:bottom; - height: 30px; - font-size:110%; - font-weight:bold; - color: #737373; + vertical-align:bottom; + height: 30px; + font-size:110%; + font-weight:bold; + color: #737373; } ul.LC_TabContentBigger li a { - background:url('/adm/lonIcons/tabbgleft.gif') left bottom no-repeat; - height: 30px; - line-height: 30px; - text-align: center; - display: block; - text-decoration: none; + background:url('/adm/lonIcons/tabbgleft.gif') left bottom no-repeat; + height: 30px; + line-height: 30px; + text-align: center; + display: block; + text-decoration: none; } -ul.LC_TabContentBigger li:hover a, +ul.LC_TabContentBigger li:hover a, ul.LC_TabContentBigger li.active a { - background:url('/adm/lonIcons/tabbgleft.gif') left top no-repeat; - color:$font; - text-decoration: underline; + background:url('/adm/lonIcons/tabbgleft.gif') left top no-repeat; + color:$font; + text-decoration: underline; } ul.LC_TabContentBigger li b { - background: url('/adm/lonIcons/tabbgright.gif') no-repeat right bottom; - display: block; - float: left; - padding: 0 30px; + background: url('/adm/lonIcons/tabbgright.gif') no-repeat right bottom; + display: block; + float: left; + padding: 0 30px; } ul.LC_TabContentBigger li:hover b, ul.LC_TabContentBigger li.active b { - background:url('/adm/lonIcons/tabbgright.gif') right top no-repeat; - color:$font; - border-bottom: 1px solid #FFFFFF; + background:url('/adm/lonIcons/tabbgright.gif') right top no-repeat; + color:$font; + border-bottom: 1px solid #FFFFFF; } @@ -6094,57 +6200,57 @@ ul.LC_CourseBreadcrumbs { } -ol#LC_MenuBreadcrumbs, +ol#LC_MenuBreadcrumbs, ol#LC_PathBreadcrumbs { - padding-left: 10px; - margin: 0; - list-style-position: inside; - /* SD working here + padding-left: 10px; + margin: 0; + list-style-position: inside; + /* SD working here white-space: nowrap; */ } -ol#LC_MenuBreadcrumbs li, -ol#LC_PathBreadcrumbs li, +ol#LC_MenuBreadcrumbs li, +ol#LC_PathBreadcrumbs li, ul.LC_CourseBreadcrumbs li { - display: inline; - white-space: nowrap; - /* SD working here - white-space: normal; */ + display: inline; + white-space: nowrap; + /* SD working here + white-space: normal; */ } ol#LC_MenuBreadcrumbs li a, ul.LC_CourseBreadcrumbs li a { - text-decoration: none; - font-size:90%; + text-decoration: none; + font-size:90%; } ol#LC_PathBreadcrumbs li a { - text-decoration:none; - font-size:100%; - font-weight:bold; + text-decoration:none; + font-size:100%; + font-weight:bold; } .LC_Box { - border: solid 1px $lg_border_color; - padding: 0 10px 10px 10px; + border: solid 1px $lg_border_color; + padding: 0 10px 10px 10px; } .LC_AboutMe_Image { - float:left; - margin-right:10px; + float:left; + margin-right:10px; } .LC_Clear_AboutMe_Image { - clear:left; + clear:left; } dl.LC_ListStyleClean dt { - padding-right: 5px; - display: table-header-group; + padding-right: 5px; + display: table-header-group; } dl.LC_ListStyleClean dd { - display: table-row; + display: table-row; } .LC_ListStyleClean, @@ -6152,11 +6258,11 @@ dl.LC_ListStyleClean dd { .LC_ListStyleNormal, .LC_ListStyle_Border, .LC_ListStyleSpecial { - /*display:block; */ - list-style-position: inside; - list-style-type: none; - overflow: hidden; - padding: 0; + /* display:block; */ + list-style-position: inside; + list-style-type: none; + overflow: hidden; + padding: 0; } .LC_ListStyleSimple li, @@ -6165,209 +6271,227 @@ dl.LC_ListStyleClean dd { .LC_ListStyleNormal dd, .LC_ListStyleSpecial li, .LC_ListStyleSpecial dd { - margin: 0; - padding: 5px 5px 5px 10px; - clear: both; + margin: 0; + padding: 5px 5px 5px 10px; + clear: both; } .LC_ListStyleClean li, .LC_ListStyleClean dd { - padding-top: 0; - padding-bottom: 0; + padding-top: 0; + padding-bottom: 0; } .LC_ListStyleSimple dd, .LC_ListStyleSimple li { - border-bottom: solid 1px $lg_border_color; + border-bottom: solid 1px $lg_border_color; } .LC_ListStyleSpecial li, .LC_ListStyleSpecial dd { - list-style-type: none; - background-color: RGB(220, 220, 220); - margin-bottom: 4px; + list-style-type: none; + background-color: RGB(220, 220, 220); + margin-bottom: 4px; } table.LC_SimpleTable { - margin:5px; - border:solid 1px $lg_border_color; + margin:5px; + border:solid 1px $lg_border_color; } table.LC_SimpleTable tr { - padding: 0; - border:solid 1px $lg_border_color; + padding: 0; + border:solid 1px $lg_border_color; } table.LC_SimpleTable thead { - background:rgb(220,220,220); + background:rgb(220,220,220); } div.LC_columnSection { - display: block; - clear: both; - overflow: hidden; - margin: 0; + display: block; + clear: both; + overflow: hidden; + margin: 0; } div.LC_columnSection>* { - float: left; - margin: 10px 20px 10px 0; - overflow:hidden; + float: left; + margin: 10px 20px 10px 0; + overflow:hidden; } .LC_loginpage_container { - text-align:left; - margin : 0 auto; - width:90%; - padding: 10px; - height: auto; - background-color:#FFFFFF; - border:1px solid #CCCCCC; + text-align:left; + margin : 0 auto; + width:90%; + padding: 10px; + height: auto; + background-color:#FFFFFF; + border:1px solid #CCCCCC; } .LC_loginpage_loginContainer { - float:left; - width: 182px; - padding: 2px; - border:1px solid #CCCCCC; - background-color:$loginbg; + float:left; + width: 182px; + padding: 2px; + border:1px solid #CCCCCC; + background-color:$loginbg; } .LC_loginpage_loginContainer h2 { - margin-top: 0; - display:block; - background:$bgcol; - color:$textcol; - padding-left:5px; + margin-top: 0; + display:block; + background:$bgcol; + color:$textcol; + padding-left:5px; } .LC_loginpage_loginInfo { - float:left; - width:182px; - border:1px solid #CCCCCC; - padding:2px; + float:left; + width:182px; + border:1px solid #CCCCCC; + padding:2px; } .LC_loginpage_space { - clear: both; - margin-bottom: 20px; - border-bottom: 1px solid #CCCCCC; + clear: both; + margin-bottom: 20px; + border-bottom: 1px solid #CCCCCC; } .LC_loginpage_floatLeft { - float: left; - width: 200px; - margin: 0; + float: left; + width: 200px; + margin: 0; } table em { - font-weight: bold; - font-style: normal; + font-weight: bold; + font-style: normal; } table.LC_tableBrowseRes, table.LC_tableOfContent { - border:none; - border-spacing: 1px; - padding: 3px; - background-color: #FFFFFF; - font-size: 90%; + border:none; + border-spacing: 1px; + padding: 3px; + background-color: #FFFFFF; + font-size: 90%; } -table.LC_tableOfContent{ - border-collapse: collapse; +table.LC_tableOfContent { + border-collapse: collapse; } table.LC_tableBrowseRes a, table.LC_tableOfContent a { - background-color: transparent; - text-decoration: none; + background-color: transparent; + text-decoration: none; } table.LC_tableBrowseRes tr.LC_trOdd, -table.LC_tableOfContent tr.LC_trOdd{ - background-color: #EEEEEE; +table.LC_tableOfContent tr.LC_trOdd { + background-color: #EEEEEE; } table.LC_tableOfContent img { - border: none; - height: 1.3em; - vertical-align: text-bottom; - margin-right: 0.3em; + border: none; + height: 1.3em; + vertical-align: text-bottom; + margin-right: 0.3em; } a#LC_content_toolbar_firsthomework { - background-image:url(/res/adm/pages/open-first-problem.gif); + background-image:url(/res/adm/pages/open-first-problem.gif); } a#LC_content_toolbar_launchnav { - background-image:url(/res/adm/pages/start-navigation.gif); + background-image:url(/res/adm/pages/start-navigation.gif); } a#LC_content_toolbar_closenav { - background-image:url(/res/adm/pages/close-navigation.gif); + background-image:url(/res/adm/pages/close-navigation.gif); } a#LC_content_toolbar_everything { - background-image:url(/res/adm/pages/show-all.gif); + background-image:url(/res/adm/pages/show-all.gif); } a#LC_content_toolbar_uncompleted { - background-image:url(/res/adm/pages/show-incomplete-problems.gif); + background-image:url(/res/adm/pages/show-incomplete-problems.gif); } #LC_content_toolbar_clearbubbles { - background-image:url(/res/adm/pages/mark-discussionentries-read.gif); + background-image:url(/res/adm/pages/mark-discussionentries-read.gif); } a#LC_content_toolbar_changefolder { - background : url(/res/adm/pages/close-all-folders.gif) top center ; + background : url(/res/adm/pages/close-all-folders.gif) top center ; } a#LC_content_toolbar_changefolder_toggled { - background-image:url(/res/adm/pages/open-all-folders.gif); + background-image:url(/res/adm/pages/open-all-folders.gif); } ul#LC_toolbar li a:hover { - background-position: bottom center; + background-position: bottom center; } ul#LC_toolbar { - padding: 0; - margin: 2px; - list-style:none; - position:relative; - background-color:white; + padding: 0; + margin: 2px; + list-style:none; + position:relative; + background-color:white; } ul#LC_toolbar li { - border:1px solid white; - padding: 0; - margin: 0; - float: left; - display:inline; - vertical-align:middle; -} + border:1px solid white; + padding: 0; + margin: 0; + float: left; + display:inline; + vertical-align:middle; +} a.LC_toolbarItem { - display:block; - padding: 0; - margin: 0; - height: 32px; - width: 32px; - color:white; - border: none; - background-repeat:no-repeat; - background-color:transparent; + display:block; + padding: 0; + margin: 0; + height: 32px; + width: 32px; + color:white; + border: none; + background-repeat:no-repeat; + background-color:transparent; +} + +ul.LC_funclist { + margin: 0; + padding: 0.5em 1em 0.5em 0; +} + +ul.LC_funclist + ul.LC_funclist { + /* + left border as a seperator if we have more than + one list + */ + border-left: 1px solid $sidebg; + /* + this hides the left border behind the border of the + outer box if element is wrapped to the next 'line' + */ + margin-left: -1px; } ul.LC_funclist li { - float: left; + display: inline; white-space: nowrap; - height: 35px; /* at least as high as heighest list item */ - margin: 0 15px 15px 10px; + margin: 0 0 0 25px; + line-height: 150%; }