--- loncom/interface/loncommon.pm 2010/05/18 03:48:44 1.948.2.6
+++ loncom/interface/loncommon.pm 2010/03/16 13:16:15 1.951
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.948.2.6 2010/05/18 03:48:44 raeburn Exp $
+# $Id: loncommon.pm,v 1.951 2010/03/16 13:16:15 onken Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1202,12 +1202,7 @@ ENDOUTPUT
sub help_open_menu {
my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text)
= @_;
- $stayOnPage = 0 if (not defined $stayOnPage);
- # only use pop-up help (stayOnPage == 0)
- # if environment.remote is on (using remote control UI)
- if ($env{'environment.remote'} eq 'off' ) {
- $stayOnPage=1;
- }
+ $stayOnPage = 1;
my $output;
if ($component_help) {
if (!$text) {
@@ -1228,8 +1223,8 @@ sub help_open_menu {
sub top_nav_help {
my ($text) = @_;
$text = &mt($text);
- my $stay_on_page =
- ($env{'environment.remote'} eq 'off' );
+ my $stay_on_page = 1;
+
my $link = ($stay_on_page) ? "javascript:helpMenu('display')"
: "javascript:helpMenu('open')";
my $banner_link = &update_help_link(undef,undef,undef,undef,$stay_on_page);
@@ -1244,10 +1239,7 @@ END
sub help_menu_js {
my ($text) = @_;
-
- my $stayOnPage =
- ($env{'environment.remote'} eq 'off' );
-
+ my $stayOnPage = 1;
my $width = 620;
my $height = 600;
my $helptopic=&general_help();
@@ -1304,10 +1296,7 @@ sub help_open_bug {
unless ($env{'user.adv'}) { return ''; }
unless ($Apache::lonnet::perlvar{'BugzillaHost'}) { return ''; }
$text = "" if (not defined $text);
- $stayOnPage = 0 if (not defined $stayOnPage);
- if ($env{'environment.remote'} eq 'off' ) {
$stayOnPage=1;
- }
$width = 600 if (not defined $width);
$height = 600 if (not defined $height);
@@ -1348,10 +1337,7 @@ sub help_open_faq {
unless ($env{'user.adv'}) { return ''; }
unless ($Apache::lonnet::perlvar{'FAQHost'}) { return ''; }
$text = "" if (not defined $text);
- $stayOnPage = 0 if (not defined $stayOnPage);
- if ($env{'environment.remote'} eq 'off' ) {
$stayOnPage=1;
- }
$width = 350 if (not defined $width);
$height = 400 if (not defined $height);
@@ -3701,13 +3687,10 @@ sub submlink {
}
if (!$symb) { $symb=&Apache::lonnet::symbread(); }
$symb=&escape($symb);
- if ($target) { $target=" target=\"$target\""; }
- return
- ''.$text.'';
+ if ($target) { $target="target=\"$target\""; }
+ return ''.$text.'';
}
##############################################
@@ -4553,9 +4536,9 @@ Inputs:
=item * $bgcolor, used to override the bgcolor on a webpage to a specific value
-=item * $no_inline_link, if true and in remote mode, don't show the
- 'Switch To Inline Menu' link
-
+#RC =item * $no_inline_link, if true and in remote mode, don't show the
+#RC 'Switch To Inline Menu' link
+#RC
=item * $args, optional argument valid values are
no_auto_mt_title -> prevents &mt()ing the title arg
inherit_jsmath -> when creating popup window in a page,
@@ -4575,11 +4558,6 @@ sub bodytag {
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,
$no_nav_bar,$bgcolor,$no_inline_link,$args)=@_;
- my $public;
- if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
- || ($env{'user.name'} eq '') && ($env{'user.domain'} eq '')) {
- $public = 1;
- }
if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
$function = &get_users_function() if (!$function);
@@ -4629,12 +4607,12 @@ sub bodytag {
}
my $name = &plainname($env{'user.name'},$env{'user.domain'});
- if ($public) {
+ if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
undef($role);
} else {
$name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'});
}
-
+
my $titleinfo = '
'.$title.'
';
#
# Extra info if you are the DC
@@ -4650,7 +4628,6 @@ sub bodytag {
$role = '('.$role.')' if $role;
&get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
- if ($env{'environment.remote'} eq 'off') {
# No Remote
if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') {
return $bodytag;
@@ -4688,7 +4665,7 @@ sub bodytag {
$bodytag .= qq|$realm $dc_info
|;
#don't show menus for public users
- if (!$public){
+ if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){
$bodytag .= Apache::lonmenu::secondary_menu();
$bodytag .= Apache::lonmenu::serverform();
$bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
@@ -4706,40 +4683,6 @@ sub bodytag {
}
return $bodytag;
- }
-
-#
-# Top frame rendering, Remote is up
-#
-
- my $imgsrc = $img;
- if ($img =~ /^\/adm/) {
- $imgsrc = &lonhttpdurl($img);
- }
- my $upperleft='
';
-
- # Explicit link to get inline menu
- my $menu= ($no_inline_link?''
- :''.&mt('Switch to Inline Menu Mode').'');
-
- if ($dc_info) {
- $dc_info = qq|($dc_info)|;
- }
-
- $bodytag .= qq|$name $role
- $realm $dc_info
| unless $env{'form.inhibitmenu'};
- return(<
-$upperleft |
- $messages |
-
-$titleinfo $dc_info $menu |
-
-
-ENDBODY
}
sub dc_courseid_toggle {
@@ -4860,6 +4803,10 @@ sub standard_css {
my $vlink = &designparm($function.'.vlink', $domain);
my $link = &designparm($function.'.link', $domain);
+ my $loginbg = &designparm('login.sidebg',$domain);
+ my $bgcol = &designparm('login.bgcol',$domain);
+ my $textcol = &designparm('login.textcol',$domain);
+
my $sans = 'Verdana,Arial,Helvetica,sans-serif';
my $mono = 'monospace';
my $data_table_head = $sidebg;
@@ -4878,12 +4825,12 @@ sub standard_css {
my $table_header = '#DDDDDD';
my $feedback_link_bg = '#BBBBBB';
my $lg_border_color = '#C8C8C8';
- my $button_hover = '#BF2317';
my $border = ($env{'browser.type'} eq 'explorer' ||
$env{'browser.type'} eq 'safari' ) ? '0 2px 0 2px'
: '0 3px 0 4px';
+
return < legend {
#LC_nav_bar {
float: left;
- margin: 0 0 2px 0;
+ margin: 0;
}
#LC_realm {
@@ -6111,21 +6051,11 @@ fieldset > legend {
font-style: normal;
}
-/* Preliminary fix to hide nav_bar inside bookmarks window */
-#LC_bookmarks #LC_nav_bar {
- display:none;
-}
-
ol.LC_primary_menu {
float: right;
margin: 0;
}
-span.LC_new_message{
- font-weight:bold;
- color: darkred;
-}
-
ol#LC_PathBreadcrumbs {
margin: 0;
}
@@ -6146,6 +6076,11 @@ ol.LC_primary_menu a {
text-decoration: none;
}
+ol.LC_primary_menu a.LC_new_message {
+ font-weight:bold;
+ color: darkred;
+}
+
ul#LC_secondary_menu {
clear: both;
color: $fontmenu;
@@ -6185,15 +6120,14 @@ ul#LC_secondary_menu li a {
}
ul.LC_TabContent {
- min-height:20px;
+ min-height:1.5em;
}
ul.LC_TabContent li {
vertical-align:middle;
- padding: 0 16px 0 10px;
+ padding: 0 10px 0 10px;
background-color:$tabbg;
border-bottom:solid 1px $lg_border_color;
- border-right: solid 1px $font;
}
ul.LC_TabContent .right {
@@ -6206,33 +6140,17 @@ ul.LC_TabContent li {
text-decoration:none;
font-size:95%;
font-weight:bold;
- min-height:20px;
-}
-
-ul.LC_TabContent li a:hover,
-ul.LC_TabContent li a:focus {
- color: $button_hover;
- background:none;
- outline:none;
-}
-
-ul.LC_TabContent li:hover {
- color: $button_hover;
- cursor:pointer;
+ padding-right: 16px;
}
+ul.LC_TabContent li:hover,
ul.LC_TabContent li.active {
- color: $font;
background:#FFFFFF url(/adm/lonIcons/open.gif) no-repeat scroll right center;
- border-bottom:solid 1px #FFFFFF;
- cursor: default;
+ border-bottom:solid 2px #FFFFFF;
+ padding-right: 16px;
+ cursor:pointer;
}
-ul.LC_TabContent li.active a {
- color:$font;
- background:#FFFFFF;
- outline: none;
-}
#maincoursedoc {
clear:both;
}
@@ -6251,10 +6169,6 @@ ul.LC_TabContentBigger li {
color: #737373;
}
-ul.LC_TabContentBigger li.active {
- position: relative;
- top: 1px;
-}
ul.LC_TabContentBigger li a {
background:url('/adm/lonIcons/tabbgleft.gif') left bottom no-repeat;
@@ -6263,33 +6177,31 @@ ul.LC_TabContentBigger li a {
text-align: center;
display: block;
text-decoration: none;
- outline: none;
}
+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;
}
+
ul.LC_TabContentBigger li b {
background: url('/adm/lonIcons/tabbgright.gif') no-repeat right bottom;
display: block;
float: left;
padding: 0 30px;
- border-bottom: 1px solid $lg_border_color;
-}
-
-ul.LC_TabContentBigger li:hover b {
- color:$button_hover;
}
+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: 0;
- cursor:default;
+ border-bottom: 1px solid #FFFFFF;
}
+
ul.LC_CourseBreadcrumbs {
background: $sidebg;
line-height: 32px;
@@ -6415,6 +6327,52 @@ div.LC_columnSection>* {
overflow:hidden;
}
+.LC_loginpage_container {
+ 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;
+}
+
+.LC_loginpage_loginContainer h2 {
+ 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;
+}
+
+.LC_loginpage_space {
+ clear: both;
+ margin-bottom: 20px;
+ border-bottom: 1px solid #CCCCCC;
+}
+
+.LC_loginpage_floatLeft {
+ float: left;
+ width: 200px;
+ margin: 0;
+}
+
table em {
font-weight: bold;
font-style: normal;
@@ -6757,8 +6715,8 @@ $args - additional optional args support
skip_phases -> hash ref of
head -> skip the generation
body -> skip all generation
- no_inline_link -> if true and in remote mode, don't show the
- 'Switch To Inline Menu' link
+#RC no_inline_link -> if true and in remote mode, don't show the
+#RC 'Switch To Inline Menu' link
no_auto_mt_title -> prevent &mt()ing the title arg
inherit_jsmath -> when creating popup window in a page,
should it have jsmath forced on by the
@@ -6824,7 +6782,8 @@ sub start_page {
return $result if $args->{'only_body'};
#Breadcrumbs for Construction Space provided by &bodytag.
- if (($env{'environment.remote'} eq 'off') && ($env{'request.state'} eq 'construct')) {
+ if (
+ $env{'request.state'} eq 'construct') {
return $result;
}
@@ -6959,26 +6918,15 @@ sub simple_error_page {
{
my @row_count;
-
- sub start_data_table_count {
- unshift(@row_count, 0);
- return;
- }
-
- sub end_data_table_count {
- shift(@row_count);
- return;
- }
-
sub start_data_table {
my ($add_class) = @_;
my $css_class = (join(' ','LC_data_table',$add_class));
- &start_data_table_count();
+ unshift(@row_count,0);
return ''."\n";
}
sub end_data_table {
- &end_data_table_count();
+ shift(@row_count);
return '
'."\n";;
}
@@ -10266,10 +10214,6 @@ sub construct_course {
$cenv{'url'}=$oldcenv{'url'};
# Restore title
$cenv{'description'}=$oldcenv{'description'};
-# Restore creation date, creator and creation context.
- $cenv{'internal.created'}=$oldcenv{'internal.created'};
- $cenv{'internal.creator'}=$oldcenv{'internal.creator'};
- $cenv{'internal.creationcontext'}=$oldcenv{'internal.creationcontext'};
# Mark as cloned
$cenv{'clonedfrom'}=$cloneid;
# Need to clone grading mode
@@ -10516,7 +10460,7 @@ sub construct_course {
$title=&mt('Syllabus');
$url='/public/'.$$crsudom.'/'.$$crsunum.'/syllabus';
} else {
- $title=&mt('Table of Contents');
+ $title=&mt('Navigate Contents');
$url='/adm/navmaps';
}
@@ -10698,15 +10642,12 @@ sub init_user_environment {
my %userenv = &Apache::lonnet::dump('environment',$domain,$username);
my ($tmp) = keys(%userenv);
if ($tmp !~ /^(con_lost|error|no_such_host)/i) {
- # default remote control to off
- if ($userenv{'remote'} ne 'on') { $userenv{'remote'} = 'off'; }
} else {
undef(%userenv);
}
if (($userenv{'interface'}) && (!$form->{'interface'})) {
$form->{'interface'}=$userenv{'interface'};
}
- $env{'environment.remote'}=$userenv{'remote'};
if ($userenv{'texengine'} eq 'ttm') { $clientmathml=1; }
# --------------- Do not trust query string to be put directly into environment
@@ -10738,9 +10679,6 @@ sub init_user_environment {
$initial_env{"browser.localres"} = $form->{'localres'};
}
- if ($public) {
- $initial_env{"environment.remote"} = "off";
- }
if ($form->{'interface'}) {
$form->{'interface'}=~s/\W//gs;
$initial_env{"browser.interface"} = $form->{'interface'};