[LON-CAPA-cvs] cvs: loncom /interface portfolio.pm
raeburn
lon-capa-cvs@mail.lon-capa.org
Sat, 08 Jul 2006 01:20:42 -0000
raeburn Fri Jul 7 21:20:42 2006 EDT
Modified files:
/loncom/interface portfolio.pm
Log:
Adding breadcrumbs for course group portfolio files directory listing screen.
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.131 loncom/interface/portfolio.pm:1.132
--- loncom/interface/portfolio.pm:1.131 Wed Jul 5 18:52:53 2006
+++ loncom/interface/portfolio.pm Fri Jul 7 21:20:40 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# portfolio browser
#
-# $Id: portfolio.pm,v 1.131 2006/07/05 22:52:53 banghart Exp $
+# $Id: portfolio.pm,v 1.132 2006/07/08 01:20:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,7 @@
use Apache::lonlocal;
use Apache::lonnet;
use Apache::longroup;
+use Apache::lonhtmlcommon;
use HTML::Entities;
use LONCAPA;
@@ -1675,6 +1676,24 @@
return;
}
+sub coursegrp_portfolio_header {
+ my ($cdom,$cnum,$group,$grp_desc)=@_;
+ my $gpterm = &Apache::loncommon::group_term();
+ my $ucgpterm = $gpterm;
+ $ucgpterm =~ s/^(\w)/uc($1)/e;
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"/adm/$cdom/$cnum/$group/smppg",
+ text=>"$ucgpterm: $grp_desc",
+ title=>"Go to group's home page"},
+ {href=>"//?group=$group",
+ text=>"Group Portfolio",
+ title=>"Display group portfolio"},);
+ my $output = &Apache::lonhtmlcommon::breadcrumbs(
+ &mt('[_1] portfolio files - [_2]',$gpterm,$grp_desc));
+ return $output;
+}
+
+
sub handler {
# this handles file management
my $r = shift;
@@ -1682,7 +1701,7 @@
['selectfile','currentpath','meta','lockinfo','currentfile','action',
'fieldname','mode','rename','continue','group','access','setnum',
'cnum','cdom','type','setroles','showversions']);
- my ($uname,$udom,$portfolio_root,$url,$group,$caller,$title);
+ my ($uname,$udom,$portfolio_root,$url,$group,$caller,$title,$grp_desc);
if ($r->uri =~ m|^(/adm/)([^/]+)|) {
$url = $1.$2;
$caller = $2;
@@ -1706,6 +1725,9 @@
my %curr_groups = &Apache::longroup::coursegroups($udom,$uname,
$group);
if (%curr_groups) {
+ my %grp_content = &Apache::longroup::get_group_settings(
+ $curr_groups{$group});
+ $grp_desc = &unescape($grp_content{'description'});
if (($view_permission) || (&Apache::lonnet::allowed('rgf',
$env{'request.course.id'}.'/'.$group))) {
$portfolio_root = &get_portfolio_root($group);
@@ -1855,6 +1877,10 @@
if ($env{'form.currentpath'}) {
$current_path = $env{'form.currentpath'};
}
+ if ($caller eq 'coursegrp_portfolio') {
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ $r->print(&coursegrp_portfolio_header($udom,$uname,$group,$grp_desc));
+ }
my @dir_list=&get_dir_list($portfolio_root,$group);
if ($dir_list[0] eq 'no_such_dir'){
# two main reasons for this: