[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Mon, 01 May 2006 20:48:58 -0000
This is a MIME encoded message
--albertel1146516538
Content-Type: text/plain
albertel Mon May 1 16:48:58 2006 EDT
Modified files:
/loncom/interface loncommon.pm
Log:
- the title table has been reworked,
- uses css
- remote & remoteless tables are more similar now
--albertel1146516538
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20060501164858.txt"
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.358 loncom/interface/loncommon.pm:1.359
--- loncom/interface/loncommon.pm:1.358 Mon May 1 15:28:21 2006
+++ loncom/interface/loncommon.pm Mon May 1 16:48:55 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.358 2006/05/01 19:28:21 albertel Exp $
+# $Id: loncommon.pm,v 1.359 2006/05/01 20:48:55 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2805,14 +2805,13 @@
@$addentries{keys(%design)} = @design{keys(%design)};
# role and realm
- my ($role,$realm)
- =&Apache::lonnet::plaintext((split(/\./,$env{'request.role'}))[0]);
+ my ($role,$realm) =
+ &Apache::lonnet::plaintext((split(/\./,$env{'request.role'}))[0]);
# realm
if ($env{'request.course.id'}) {
- $realm=
- $env{'course.'.$env{'request.course.id'}.'.description'};
+ $realm = $env{'course.'.$env{'request.course.id'}.'.description'};
}
- unless ($realm) { $realm=' '; }
+ if (!$realm) { $realm=' '; }
# Set messages
my $messages=&domainlogo($domain);
# Port for miniserver
@@ -2822,14 +2821,9 @@
my $extra_body_attr = &make_attr_string($forcereg,$addentries);
# construct main body tag
- my $bodytag = <<END;
-<body $extra_body_attr>
-END
-
- $bodytag .= &Apache::lontexconvert::init_math_support();
+ my $bodytag = "<body $extra_body_attr>".
+ &Apache::lontexconvert::init_math_support();
- my $upperleft='<img src="http://'.$ENV{'HTTP_HOST'}.':'.
- $lonhttpdPort.$img.'" alt="'.$function.'" />';
if ($bodyonly
|| ($env{'request.state'} eq 'construct'
&& $env{'environment.remote'} ne 'off' )) {
@@ -2842,75 +2836,91 @@
$bodytag.='<h1>LON-CAPA: '.$title.'</h1>';
}
return $bodytag;
- } elsif ($env{'environment.remote'} eq 'off') {
-# No Remote
- my $roleinfo=(<<ENDROLE);
-<td bgcolor="$tabbg" align="right">
-<font size="2" face="Arial, Helvetica, sans-serif">
+ }
+
+
+
+ my $roleinfo=(<<ENDROLE);
+<td class="LC_title_bar_who">
+<div class="LC_title_bar_name">
$env{'environment.firstname'}
$env{'environment.middlename'}
$env{'environment.lastname'}
$env{'environment.generation'}
- </font>
-<br />
-<font size="2" face="Arial, Helvetica, sans-serif">$role</font>
-<br />
-<font size="2" face="Arial, Helvetica, sans-serif">$realm</font>
+</div>
+<div class="LC_title_bar_role">
+$role
+</div>
+<div class="LC_title_bar_realm">
+$realm
+</div>
</td>
ENDROLE
- my $titleinfo = '<font face="Arial, Helvetica, sans-serif" size="+3" color="'.
- $font.'"><b>'.$title.'</b></font>';
- if ($customtitle) {
- $titleinfo = $customtitle;
- }
+ my $titleinfo = '<span class="LC_title_bar_title">'.$title.'</span>';
+ if ($customtitle) {
+ $titleinfo = $customtitle;
+ }
+ #
+ # Extra info if you are the DC
+ my $dc_info = '';
+ if ($env{'user.adv'} && exists($env{'user.role.dc./'.
+ $env{'course.'.$env{'request.course.id'}.
+ '.domain'}.'/'})) {
+ my $cid = $env{'request.course.id'};
+ $dc_info.= $cid.' '.$env{'course.'.$cid.'.internal.coursecode'};
+ $dc_info = '('.$dc_info.')';
+ }
+
+ if ($env{'environment.remote'} eq 'off') {
+ # No Remote
if ($env{'request.state'} eq 'construct') {
+ $forcereg=1;
+ }
+
+ if (!$customtitle && $env{'request.state'} eq 'construct') {
+ # this is for resources; directories have customtitle, and crumbs
+ # and select recent are created in lonpubdir.pm
my ($uname,$thisdisfn)=
($env{'request.filename'} =~ m|^/home/([^/]+)/public_html/(.*)|);
my $formaction='/priv/'.$uname.'/'.$thisdisfn;
$formaction=~s/\/+/\//g;
- unless ($customtitle) { #this is for resources; directories have customtitle, and crumbs and select recent are created in lonpubdir.pm
- my $parentpath = '';
- my $lastitem = '';
- if ($thisdisfn =~ m-(.+/)([^/]*)$-) {
- $parentpath = $1;
- $lastitem = $2;
- } else {
- $lastitem = $thisdisfn;
- }
- $titleinfo = &Apache::loncommon::help_open_menu('','','','',3,'Authoring').
- '<font face="Arial, Helvetica, sans-serif"><b>Construction Space</b>:</font> '.
- '<form name="dirs" method="post" action="'.$formaction
- .'" target="_top"><tt><b>'
- .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."<font size=\"+1\">$lastitem</font></b></tt><br />"
- .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')
- .'</form>'
- .&Apache::lonmenu::constspaceform();
- }
- $forcereg=1;
+ my $parentpath = '';
+ my $lastitem = '';
+ if ($thisdisfn =~ m-(.+/)([^/]*)$-) {
+ $parentpath = $1;
+ $lastitem = $2;
+ } else {
+ $lastitem = $thisdisfn;
+ }
+ $titleinfo =
+ &Apache::loncommon::help_open_menu('','','','',3,'Authoring').
+ '<b>Construction Space</b>: '.
+ '<form name="dirs" method="post" action="'.$formaction
+ .'" target="_top"><tt><b>'
+ .&Apache::lonhtmlcommon::crumbs($uname.'/'.$parentpath,'_top','/priv','','+1',1)."<font size=\"+1\">$lastitem</font></b></tt><br />"
+ .&Apache::lonhtmlcommon::select_recent('construct','recent','this.form.action=this.form.recent.value;this.form.submit()')
+ .'</form>'
+ .&Apache::lonmenu::constspaceform();
}
+
my $titletable;
if (!$notitle) {
$titletable =
- '<table bgcolor="'.$pgbg.'" width="100%" border="0" '.
- 'cellspacing="3" cellpadding="3">'.
- '<tr><td bgcolor="'.$tabbg.'">'.
- $titleinfo.'</td>'.$roleinfo.'</tr></table>';
+ '<table id="LC_title_bar">'.
+ "<tr><td> $titleinfo $dc_info</td>".$roleinfo.
+ '</tr></table>';
}
- if ($env{'request.state'} eq 'construct') {
- if ($notopbar) {
- $bodytag .= $titletable;
- } else {
+ if ($notopbar) {
+ $bodytag .= $titletable;
+ } else {
+ if ($env{'request.state'} eq 'construct') {
$bodytag .= &Apache::lonmenu::menubuttons($forcereg,$forcereg,
$titletable);
- }
- } else {
- if ($notopbar) {
- $bodytag .= $titletable;
} else {
$bodytag .= &Apache::lonmenu::menubuttons($forcereg,$forcereg).
- $titletable;
+ $titletable;
}
}
return $bodytag;
@@ -2919,50 +2929,24 @@
#
# Top frame rendering, Remote is up
#
- my $titleinfo = ' <font size="5" face="Arial, Helvetica, sans-serif"><b>'.$title.'</b></font>';
- if ($customtitle) {
- $titleinfo = $customtitle;
- }
- #
- # Extra info if you are the DC
- my $dc_info = '';
- if ($env{'user.adv'} && exists($env{'user.role.dc./'.
- $env{'course.'.$env{'request.course.id'}.
- '.domain'}.'/'})) {
- my $cid = $env{'request.course.id'};
- $dc_info.= $cid.' '.$env{'course.'.$cid.'.internal.coursecode'};
- $dc_info = '('.$dc_info.')';
- }
+
+ my $upperleft='<img src="http://'.$ENV{'HTTP_HOST'}.':'.
+ $lonhttpdPort.$img.'" alt="'.$function.'" />';
+
# Explicit link to get inline menu
- my $menu='<br /><font size="2" face="Arial, Helvetica, sans-serif"> <a href="/adm/remote?action=collapse">'.&mt('Switch to Inline Menu Mode').'</a></font>';
+ my $menu='<br /><a href="/adm/remote?action=collapse">'.&mt('Switch to Inline Menu Mode').'</a>';
#
if ($notitle) {
return $bodytag;
}
return(<<ENDBODY);
$bodytag
-<table width="100%" cellspacing="0" border="0" cellpadding="0">
-<tr><td bgcolor="$sidebg">
-$upperleft</td>
-<td bgcolor="$sidebg" align="right">$messages </td>
-</tr>
-<tr>
-<td rowspan="3" bgcolor="$tabbg">
-$titleinfo $dc_info $menu
-</td><td bgcolor="$tabbg" align="right">
-<font size="2" face="Arial, Helvetica, sans-serif">
- $env{'environment.firstname'}
- $env{'environment.middlename'}
- $env{'environment.lastname'}
- $env{'environment.generation'}
- </font>
-</td>
+<table id="LC_title_bar" class="LC_with_remote">
+<tr><td>$upperleft</td>
+ <td class="LC_title_bar_domain_logo">$messages </td>
</tr>
-<tr><td bgcolor="$tabbg" align="right">
-<font size="2" face="Arial, Helvetica, sans-serif">$role</font>
-</td></tr>
-<tr>
-<td bgcolor="$tabbg" align="right"><font size="2" face="Arial, Helvetica, sans-serif">$realm</font> </td></tr>
+<tr><td>$titleinfo $dc_info $menu</td>
+$roleinfo
</table>
ENDBODY
}
@@ -3127,6 +3111,39 @@
margin: 0px;
border-collapse: separate;
}
+table#LC_title_bar {
+ width: 100%;
+ border: 0;
+ border-spacing: 3px;
+ background: $pgbg;
+ font-family: $sans;
+}
+table#LC_title_bar.LC_with_remote {
+ width: 100%;
+ border: 0;
+ border-spacing: 0;
+ background: $pgbg;
+ font-family: $sans;
+ border-collapse: collapse;
+}
+table#LC_title_bar td {
+ padding: 3px;
+ background: $tabbg;
+}
+table#LC_title_bar td.LC_title_bar_who {
+ background: $tabbg;
+ color: $font;
+ font: medium $sans;
+ text-align: right;
+}
+span.LC_title_bar_title {
+ font: bold xx-large $sans;
+}
+table#LC_title_bar td.LC_title_bar_domain_logo {
+ background: $sidebg;
+ text-align: right;
+}
+
table#LC_menubuttons_mainmenu {
background: $pgbg;
border: 0px;
--albertel1146516538--