--- loncom/interface/loncommon.pm 2009/04/29 16:57:29 1.799
+++ loncom/interface/loncommon.pm 2009/05/15 14:48:42 1.816
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.799 2009/04/29 16:57:29 bisitz Exp $
+# $Id: loncommon.pm,v 1.816 2009/05/15 14:48:42 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -517,6 +517,10 @@ sub coursebrowser_javascript {
else {
if (formname == 'portform') {
url += '&setroles='+extra_element;
+ } else {
+ if (formname == 'rules') {
+ url += '&fixeddom='+extra_element;
+ }
}
}
}
@@ -1851,7 +1855,7 @@ sub home_server_form_item {
if ($numlib > 1) {
$result .= ' '."\n";
if ($default) {
- $result .= ''.&mt('default').
+ $result .= ' '.&mt('default').
' '."\n";
}
foreach my $hostid (sort(keys(%servers))) {
@@ -2810,6 +2814,26 @@ sub screenname {
}
+# ------------------------------------------------------------- Confirm Wrapper
+=pod
+
+=item confirmwrapper
+
+Wrap messages about completion of operation in box
+
+=cut
+
+sub confirmwrapper {
+ my ($message)=@_;
+ if ($message) {
+ return "\n".'
'."\n"
+ .$message."\n"
+ .'
'."\n";
+ } else {
+ return $message;
+ }
+}
+
# ------------------------------------------------------------- Message Wrapper
sub messagewrapper {
@@ -2820,6 +2844,7 @@ sub messagewrapper {
'&subject='.&escape($subject).'&text='.&escape($text).'" '.
'title="'.&mt('Send message').'">'.$link.'';
}
+
# --------------------------------------------------------------- Notes Wrapper
sub noteswrapper {
@@ -2827,6 +2852,7 @@ sub noteswrapper {
return
"$link ";
}
+
# ------------------------------------------------------------- Aboutme Wrapper
sub aboutmewrapper {
@@ -2840,12 +2866,13 @@ sub aboutmewrapper {
# ------------------------------------------------------------ Syllabus Wrapper
-
sub syllabuswrapper {
my ($linktext,$coursedir,$domain)=@_;
return qq{$linktext };
}
+# -----------------------------------------------------------------------------
+
sub track_student_link {
my ($linktext,$sname,$sdom,$target,$start) = @_;
my $link ="/adm/trackstudent?";
@@ -4188,13 +4215,11 @@ Inputs:
in the title box that appears, this text
is not auto translated like the $title is
-=item * $notopbar, if true, keep the 'what is this' info but remove the
- navigational links
+=item * $no_nav_bar, if true, keep the 'what is this' info but remove the
+ navigational links
=item * $bgcolor, used to override the bgcolor on a webpage to a specific value
-=item * $notitle, if true keep the nav controls, but remove the title bar
-
=item * $no_inline_link, if true and in remote mode, don't show the
'Switch To Inline Menu' link
@@ -4215,7 +4240,7 @@ other decorations will be returned.
sub bodytag {
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,$customtitle,
- $notopbar,$bgcolor,$notitle,$no_inline_link,$args)=@_;
+ $no_nav_bar,$bgcolor,$no_inline_link,$args)=@_;
if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
@@ -4224,7 +4249,7 @@ sub bodytag {
my $font = &designparm($function.'.font',$domain);
my $pgbg = $bgcolor || &designparm($function.'.pgbg',$domain);
- my %design = ( 'style' => 'margin-top: 0px',
+ my %design = ( 'style' => 'margin-top: 0',
'bgcolor' => $pgbg,
'text' => $font,
'alink' => &designparm($function.'.alink',$domain),
@@ -4333,16 +4358,15 @@ ENDROLE
.&Apache::lonmenu::constspaceform();
}
- my $titletable;
- if (!$notitle) {
- $titletable =
- ''.
- " $titleinfo $dc_info ".$roleinfo.
- '
';
- }
- if ($notopbar) {
+ my $titletable = ''
+ ." $titleinfo $dc_info ".$roleinfo
+ .'
';
+
+ if ($no_nav_bar) {
$bodytag .= $titletable;
} else {
+ $bodytag .= qq|$name ($role)
+ $realm $dc_info
|;
if ($env{'request.state'} eq 'construct') {
$bodytag .= &Apache::lonmenu::menubuttons($forcereg,$forcereg,
$titletable);
@@ -4368,9 +4392,6 @@ ENDROLE
my $menu= ($no_inline_link?''
:''.&mt('Switch to Inline Menu Mode').' ');
#
- if ($notitle) {
- return $bodytag;
- }
return(<
@@ -4492,6 +4513,7 @@ sub standard_css {
my $img = &designparm($function.'.img', $domain);
my $tabbg = &designparm($function.'.tabbg', $domain);
my $font = &designparm($function.'.font', $domain);
+ my $fontmenu = &designparm($function.'.fontmenu', $domain);
#second colour for later usage
my $sidebg = &designparm($function.'.sidebg',$domain);
my $pgbg_or_bgcolor =
@@ -4526,8 +4548,8 @@ sub standard_css {
my $lg_border_color = '#C8C8C8';
my $border = ($env{'browser.type'} eq 'explorer' ||
- $env{'browser.type'} eq 'safari' ) ? '0px 2px 0px 2px'
- : '0px 3px 0px 4px';
+ $env{'browser.type'} eq 'safari' ) ? '0 2px 0 2px'
+ : '0 3px 0 4px';
return < td
}
table.LC_data_table tr.LC_odd_row > td,
-table.LC_pick_box tr > td.LC_odd_row,
-table.LC_aboutme_port tr td {
+table.LC_pick_box tr > td.LC_odd_row {
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 {
+table.LC_pick_box tr > td.LC_even_row {
background-color: $data_table_dark;
padding: 2px;
}
@@ -4942,6 +4950,7 @@ table.LC_nested tr.LC_empty_row td {
table.LC_nested_outer tr th {
font-weight: bold;
+ color:$fontmenu;
background-color: $data_table_head;
font-size: small;
border-bottom: 1px solid #000000;
@@ -5158,9 +5167,9 @@ table.LC_parm_overview_restrictions th {
}
table#LC_helpmenu {
- border: 0px;
+ border: none;
height: 55px;
- border-spacing: 0px;
+ border-spacing: 0;
}
table#LC_helpmenu fieldset legend {
@@ -5172,7 +5181,7 @@ table#LC_helpmenu_links {
width: 100%;
border: 1px solid black;
background: $pgbg;
- padding: 0px;
+ padding: 0;
border-spacing: 1px;
}
@@ -5245,7 +5254,7 @@ table.LC_pick_box td.LC_pick_box_select
}
table.LC_pick_box td.LC_pick_box_separator {
- padding: 0px;
+ padding: 0;
height: 1px;
background: black;
}
@@ -5295,7 +5304,7 @@ table.LC_helpform_receipt td.LC_oddrow_v
}
table.LC_helpform_receipt td.LC_pick_box_separator {
- padding: 0px;
+ padding: 0;
height: 1px;
background: black;
}
@@ -5335,7 +5344,7 @@ table.LC_group_priv_box td.LC_groups_fun
table.LC_group_priv td {
text-align: left;
- padding: 0px;
+ padding: 0;
}
table.LC_notify_front_page {
@@ -5359,6 +5368,7 @@ table.LC_notify_front_page td {
background: $tabbg;
vertical-align: middle;
margin: 2ex 0ex 2ex 0ex;
+ padding: 3px;
}
.LC_topic_bar span {
@@ -5379,12 +5389,6 @@ table.LC_status_selector td {
padding: 4px;
}
-table.LC_descriptive_input td.LC_description {
- vertical-align: top;
- text-align: right;
- font-weight: bold;
-}
-
div.LC_feedback_link {
clear: both;
background: white;
@@ -5503,7 +5507,7 @@ span.LC_cusr_subheading {
table.LC_docs_documents {
background: #BBBBBB;
- border-width: 0px;
+ border-width: 0;
border-collapse: collapse;
}
@@ -5513,7 +5517,7 @@ table.LC_docs_documents td.LC_docs_docum
}
.LC_docs_entry_move {
- border: 0px;
+ border: none;
border-collapse: collapse;
}
@@ -5575,7 +5579,7 @@ table.LC_sty_end {
}
table.LC_double_column {
- border-width: 0px;
+ border-width: 0;
border-collapse: collapse;
width: 100%;
padding: 2px;
@@ -5712,7 +5716,7 @@ table.LC_edit_problem_header_title {
border-width: $border;
background: $tabbg;
border-collapse: collapse;
- padding: 0px
+ padding: 0;
}
div.LC_edit_problem_discards {
@@ -5730,12 +5734,12 @@ hr.LC_edit_problem_divide {
color: $tabbg;
background-color: $tabbg;
height: 3px;
- border: 0px;
+ border: none;
}
img.stift{
- border-width:0;
- vertical-align:middle;
+ border-width: 0;
+ vertical-align: middle;
}
table#LC_mainmenu{
@@ -5779,25 +5783,26 @@ ul.LC_TabContent li:hover a {
}
h1 {
- padding:5px 10px 5px 20px;
+ padding: 0;
line-height:130%;
}
h2,h3,h4,h5,h6 {
- margin:5px 0px 5px 0px;
- padding:0px;
+ margin: 5px 0 5px 0;
+ padding: 0;
line-height:130%;
}
.LC_hcell {
padding:3px 15px 3px 15px;
- margin:0px;
+ margin: 0;
background-color:$tabbg;
+ color:$fontmenu;
border-bottom:solid 1px $lg_border_color;
}
.LC_noBorder {
- border:0px;
+ border: 0;
}
@@ -5805,13 +5810,13 @@ h2,h3,h4,h5,h6 {
.LC_Right {
float: right;
- margin: 0px;
- padding: 0px;
+ margin: 0;
+ padding: 0;
}
.LC_FormSectionClearButton input {
background-color:transparent;
- border:0px;
+ border: none;
cursor:pointer;
text-decoration:underline;
}
@@ -5827,17 +5832,31 @@ h2,h3,h4,h5,h6 {
}
dl,ul,div,fieldset {
- margin: 10px 10px 10px 0px;
- overflow:hidden;
+ margin: 10px 10px 10px 0;
+/* overflow: hidden; */
+}
+
+#LC_nav_bar {
+ float: left;
+ margin: 0;
+}
+
+#LC_nav_bar em{
+ font-weight: bold;
+ font-style: normal;
+}
+
+ol.LC_smallMenu {
+ float: right;
}
ol.LC_smallMenu, ol#LC_PathBreadcrumbs {
- margin: 0px;
+ margin: 0;
}
ol.LC_smallMenu li {
display: inline;
- padding: 5px 5px 0px 10px;
+ padding: 5px 5px 0 10px;
vertical-align: top;
}
@@ -5851,16 +5870,35 @@ ol.LC_smallMenu a {
text-decoration: none;
}
-ol#LC_TabMainMenuContent,
+ul#LC_TabMainMenuContent {
+ clear: both;
+ color: $fontmenu;
+ background: $tabbg;
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ float:left;
+ width: 100%;
+}
+
+ul#LC_TabMainMenuContent li {
+ float: left;
+ font-weight: bold;
+ line-height: 1.8em;
+ padding: 0 0.8em;
+ border-right: 1px solid black;
+ display: inline;
+ vertical-align: middle;
+}
+
ul.LC_TabContent ,
ul.LC_TabContentBigger {
display:block;
list-style:none;
- margin: 0px;
- padding: 0px;
+ margin: 0;
+ padding: 0;
}
-ol#LC_TabMainMenuContent li,
ul.LC_TabContent li,
ul.LC_TabContentBigger li {
display: inline;
@@ -5870,18 +5908,8 @@ ul.LC_TabContentBigger li {
white-space:nowrap;
}
-ol#LC_TabMainMenuContent li {
- vertical-align: bottom;
- border-bottom: solid 1px RGB(175, 175, 175);
- padding: 5px 10px 5px 10px;
- margin-right:5px;
- margin-bottom:3px;
- font-weight: bold;
- background: url(/adm/lonIcons/lightGreyBG.png) repeat-x left top;
-}
-
-ol#LC_TabMainMenuContent li a {
- color: RGB(47, 47, 47);
+ul#LC_TabMainMenuContent li a {
+ color: $fontmenu;
text-decoration: none;
}
@@ -5891,7 +5919,7 @@ ul.LC_TabContent {
ul.LC_TabContent li {
vertical-align:middle;
- padding:0px 10px 0px 10px;
+ padding: 0 10px 0 10px;
background-color:$tabbg;
border-bottom:solid 1px $lg_border_color;
}
@@ -5937,7 +5965,7 @@ ul.LC_CourseBreadcrumbs {
height: 20px;
line-height: 20px;
vertical-align: bottom;
- margin: 0px 0px 30px 0px;
+ margin: 0 0 30px 0;
padding-left: 10px;
list-style-position: inside;
background: url(/adm/lonIcons/lightGreyBG.png) repeat-x left top;
@@ -5950,7 +5978,7 @@ ul.LC_CourseBreadcrumbs li {
background: url(/adm/lonIcons/arrow_white.png) no-repeat left center;
*/
display: inline;
- padding: 0px 0px 0px 10px;
+ padding: 0 0 0 10px;
/* vertical-align: bottom; */
overflow:hidden;
}
@@ -6007,7 +6035,7 @@ dl.LC_ListStyleClean dd {
list-style-position: inside;
list-style-type: none;
overflow: hidden;
- padding: 0px;
+ padding: 0;
}
.LC_ListStyleSimple li,
@@ -6016,15 +6044,15 @@ dl.LC_ListStyleClean dd {
.LC_ListStyleNormal dd,
.LC_ListStyleSpecial li,
.LC_ListStyleSpecial dd {
- margin: 0px;
+ margin: 0;
padding: 5px 5px 5px 10px;
clear: both;
}
.LC_ListStyleClean li,
.LC_ListStyleClean dd {
- padding-top: 0px;
- padding-bottom: 0px;
+ padding-top: 0;
+ padding-bottom: 0;
}
.LC_ListStyleSimple dd,
@@ -6045,7 +6073,7 @@ table.LC_SimpleTable {
}
table.LC_SimpleTable tr {
- padding:0px;
+ padding: 0;
border:solid 1px $lg_border_color;
}
@@ -6057,12 +6085,12 @@ div.LC_columnSection {
display: block;
clear: both;
overflow: hidden;
- margin:0px;
+ margin: 0;
}
div.LC_columnSection>* {
float: left;
- margin: 10px 20px 10px 0px;
+ margin: 10px 20px 10px 0;
overflow:hidden;
}
@@ -6081,9 +6109,9 @@ div.LC_columnSection > .ContentBoxSpecia
.clear {
clear: both;
- line-height: 0px;
- font-size: 0px;
- height: 0px;
+ line-height: 0;
+ font-size: 0;
+ height: 0;
}
.LC_loginpage_container {
@@ -6106,7 +6134,7 @@ div.LC_columnSection > .ContentBoxSpecia
}
.LC_loginpage_loginContainer h2 {
- margin-top:0;
+ margin-top: 0;
display:block;
background:$bgcol;
color:$textcol;
@@ -6205,7 +6233,7 @@ ul#LC_toolbar li a:hover {
}
ul#LC_toolbar {
- padding:0;
+ padding: 0;
margin: 2px;
list-style:none;
position:relative;
@@ -6214,7 +6242,7 @@ ul#LC_toolbar {
ul#LC_toolbar li {
border:1px solid white;
- padding:0;
+ padding: 0;
margin: 0;
float: left;
display:inline;
@@ -6224,12 +6252,12 @@ ul#LC_toolbar li {
a.LC_toolbarItem {
display:block;
- padding:0;
- margin:0;
+ padding: 0;
+ margin: 0;
height: 32px;
width: 32px;
color:white;
- border:0 none;
+ border: none;
background-repeat:no-repeat;
background-color:transparent;
}
@@ -6238,7 +6266,7 @@ ul.LC_functionslist li {
float: left;
white-space: nowrap;
height: 35px; /* at least as high as heighest list item */
- margin: 0px 15px 15px 10px;
+ margin: 0 15px 15px 10px;
}
@@ -6431,7 +6459,7 @@ $args - additional optional args support
only_body -> is true will set &bodytag() onlybodytag
arg on
- no_nav_bar -> is true will set &bodytag() notopbar arg on
+ no_nav_bar -> is true will set &bodytag() no_nav_bar arg on
add_entries -> additional attributes to add to the
domain -> force to color decorate a page for a
specific domain
@@ -6450,7 +6478,6 @@ $args - additional optional args support
is not auto translated like the $title is
frameset -> if true will start with a
rather than
- no_title -> if true the title bar won't be shown
skip_phases -> hash ref of
head -> skip the generation
body -> skip all generation
@@ -6499,7 +6526,7 @@ sub start_page {
$args->{'only_body'}, $args->{'domain'},
$args->{'force_register'}, $args->{'body_title'},
$args->{'no_nav_bar'}, $args->{'bgcolor'},
- $args->{'no_title'}, $args->{'no_inline_link'},
+ $args->{'no_inline_link'},
$args);
}
}
@@ -6511,7 +6538,15 @@ sub start_page {
$result = &html_encode($result);
}
- #Breadcrumbs
+ # Preparation for new and consistent functionlist at top of screen
+ # if ($args->{'functionlist'}) {
+ # $result .= &build_functionlist();
+ #}
+
+ # Don't add anything more if only_body wanted
+ return $result if $args->{'only_body'};
+
+ #Breadcrumbs
if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) {
&Apache::lonhtmlcommon::clear_breadcrumbs();
#if any br links exists, add them to the breadcrumbs
@@ -6755,7 +6790,7 @@ Returns either 'student','coordinator','
###############################################
sub get_users_function {
- my $function = 'student';
+ my $function = 'norole';
if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
$function='coordinator';
}