[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm
raeburn
raeburn at source.lon-capa.org
Thu Nov 8 15:46:43 EST 2012
raeburn Thu Nov 8 20:46:43 2012 EDT
Modified files:
/loncom/interface loncommon.pm
Log:
- Consistent Interface for templated pages (bug 6128).
- Additional arg for &bodytag() -- $advtoolsref.
- Generation of icons/links in Functions bar separated from
lonmenu::innerregister() into lonmenu::prepare_functions() and
lonmenu::advtools_crumbs() so they are available for unregistered content.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1095 loncom/interface/loncommon.pm:1.1096
--- loncom/interface/loncommon.pm:1.1095 Mon Aug 27 06:28:06 2012
+++ loncom/interface/loncommon.pm Thu Nov 8 20:46:42 2012
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1095 2012/08/27 06:28:06 raeburn Exp $
+# $Id: loncommon.pm,v 1.1096 2012/11/08 20:46:42 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3326,7 +3326,7 @@
if (!defined($username) && !defined($domain)) {
return;
}
- return '<a href="/adm/'.$domain.'/'.$username.'/aboutme?forcestudent=1"'.
+ return '<a href="/adm/'.$domain.'/'.$username.'/aboutme"'.
($target?' target="'.$target.'"':'').($class?' class="'.$class.'"':'').' title="'.&mt("View this user's personal information page").'">'.$link.'</a>';
}
@@ -5060,6 +5060,10 @@
should it have jsmath forced on by the
current page
+=item * $advtoolsref, optional argument, ref to an array containing
+ inlineremote items to be added in "Functions" menu below
+ breadcrumbs.
+
=back
Returns: A uniform header for LON-CAPA web pages.
@@ -5071,7 +5075,7 @@
sub bodytag {
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,
- $no_nav_bar,$bgcolor,$args)=@_;
+ $no_nav_bar,$bgcolor,$args,$advtoolsref)=@_;
my $public;
if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
@@ -5190,8 +5194,15 @@
if ($env{'request.state'} eq 'construct') {
$bodytag .= &Apache::lonmenu::innerregister($forcereg,
$args->{'bread_crumbs'});
- } elsif ($forcereg) {
- $bodytag .= &Apache::lonmenu::innerregister($forcereg);
+ } elsif ($forcereg) {
+ $bodytag .= &Apache::lonmenu::innerregister($forcereg,undef,
+ $args->{'group'});
+ } else {
+ $bodytag .=
+ &Apache::lonmenu::prepare_functions($env{'request.noversionuri'},
+ $forcereg,$args->{'group'},
+ $args->{'bread_crumbs'},
+ $advtoolsref);
}
}else{
# this is to seperate menu from content when there's no secondary
@@ -7376,6 +7387,8 @@
current page
bread_crumbs -> Array containing breadcrumbs
bread_crumbs_component -> if exists show it as headline else show only the breadcrumbs
+ group -> includes the current group, if page is for a
+ specific group
=back
@@ -7388,7 +7401,7 @@
#&Apache::lonnet::logthis("start_page ".join(':',caller(0)));
$env{'internal.start_page'}++;
- my $result;
+ my ($result, at advtools);
if (! exists($args->{'skip_phases'}{'head'}) ) {
$result .= &xml_begin() . &headtag($title, $head_extra, $args);
@@ -7405,7 +7418,8 @@
$args->{'function'}, $args->{'add_entries'},
$args->{'only_body'}, $args->{'domain'},
$args->{'force_register'}, $args->{'no_nav_bar'},
- $args->{'bgcolor'}, $args);
+ $args->{'bgcolor'}, $args,
+ \@advtools);
}
}
@@ -7434,6 +7448,10 @@
&Apache::lonhtmlcommon::add_breadcrumb($crumb);
}
}
+ # if @advtools array contains items add then to the breadcrumbs
+ if (@advtools > 0) {
+ &Apache::lonmenu::advtools_crumbs(@advtools);
+ }
#if bread_crumbs_component exists show it as headline else show only the breadcrumbs
if(exists($args->{'bread_crumbs_component'})){
@@ -7829,7 +7847,7 @@
my ($r,$title,$msg) = @_;
my $page =
&Apache::loncommon::start_page($title).
- &mt($msg).
+ '<span class="LC_warning">'.&mt($msg).'</span>'.
&Apache::loncommon::end_page();
if (ref($r)) {
$r->print($page);
More information about the LON-CAPA-cvs
mailing list