--- loncom/interface/lonsimplepage.pm 2005/11/15 22:05:04 1.28 +++ loncom/interface/lonsimplepage.pm 2005/11/16 12:47:59 1.29 @@ -1,7 +1,7 @@ # The LearningOnline Network # Simple Page Editor # -# $Id: lonsimplepage.pm,v 1.28 2005/11/15 22:05:04 raeburn Exp $ +# $Id: lonsimplepage.pm,v 1.29 2005/11/16 12:47:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,18 +70,22 @@ ENDDOCUMENT my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; my $grp_view_permission = &Apache::lonnet::allowed('vcg', $env{'request.course.id'}); + my $namespace; my %curr_group = (); my %groupinfo = (); if ($caller eq 'grppg') { $marker =~ s/\W//g; + $namespace = 'grppage_'.$marker; unless(&Apache::lonnet::get_coursegroups($dom,$crs,\%curr_group, $marker)) { $r->print('Invalid group name'); return OK; } + %groupinfo = &Apache::loncommon::get_group_settings($curr_group{$marker}); } else { $marker=~s/\D//g; + $namespace = 'smppage_'.$marker; } unless ($marker) { @@ -115,8 +119,8 @@ ENDDOCUMENT my $forceedit=''; if ($env{'form.forceedit'}) { $forceedit='edit'; } - - my %syllabus=&Apache::lonnet::dump($caller.'_'.$marker,$dom,$crs); + + my %syllabus=&Apache::lonnet::dump($namespace,$dom,$crs); # --------------------------------------- There is such a user, get environment @@ -135,7 +139,7 @@ ENDDOCUMENT (&Apache::loncommon::check_group_access($caller))) { unless(&Apache::lonnet::allowed('vgh', $env{'request.course.id'}.'/'.$marker)) { - &display_group_links($r,$target,$marker,%groupinfo); + &display_group_links($r,$target,$marker,%groupinfo,'view'); return OK; } } else { @@ -240,7 +244,7 @@ ENDDOCUMENT if ($_ eq 'abb_links' && $caller eq 'grppg') { $r->print('
'); - &display_group_links($r,$target,$marker,%groupinfo); + &display_group_links($r,$target,$marker,%groupinfo,'edit'); $r->print('
'); } elsif ($_ eq 'aaa_title') { if ($target ne 'tex') { @@ -306,7 +310,7 @@ ENDDOCUMENT } sub display_group_links { - my ($r,$target,$marker,%groupinfo) = @_; + my ($r,$target,$marker,%groupinfo,$context) = @_; my @available = (); my %menu = (); @@ -352,7 +356,12 @@ sub display_group_links { $r->print('

Functions

'.$output); } } else { - my $output = 'No group functionality (e.g., e-mail, discussion,chat or file upload) is currently available to you in this group: '.$marker; + my $output; + if ($context eq 'edit') { + $output = 'No group functionality'; + } else { + $output = 'No group functionality (e.g., e-mail, discussion,chat or file upload) is currently available to you in this group: '.$marker; + } if ($target eq 'tex') { $r->print(&Apache::lonxml::xmlparse($r,'tex',$output)); } else {