[LON-CAPA-cvs] cvs: loncom /interface lonsimplepage.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Wed, 16 Nov 2005 12:48:00 -0000


raeburn		Wed Nov 16 07:48:00 2005 EDT

  Modified files:              
    /loncom/interface	lonsimplepage.pm 
  Log:
  Use correct namespace in call to lonnet::dump.   
  
  
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.28 loncom/interface/lonsimplepage.pm:1.29
--- loncom/interface/lonsimplepage.pm:1.28	Tue Nov 15 17:05:04 2005
+++ loncom/interface/lonsimplepage.pm	Wed Nov 16 07:47:59 2005
@@ -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 @@
     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('<body>Invalid group name</body>');
             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 @@
      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 @@
                            (&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 @@
                 if ($_ eq 'abb_links' && $caller eq 'grppg') {
                     $r->print('<br /><input type="hidden" name="'.$_.
                                           '" value="'.$syllabus{$_}.'" />');
-                    &display_group_links($r,$target,$marker,%groupinfo);
+                    &display_group_links($r,$target,$marker,%groupinfo,'edit');
                     $r->print('<br />');
                 } elsif ($_ eq 'aaa_title') {
                     if ($target ne 'tex') {
@@ -306,7 +310,7 @@
 }
 
 sub display_group_links {
-    my ($r,$target,$marker,%groupinfo) = @_;
+    my ($r,$target,$marker,%groupinfo,$context) = @_;
     my @available = ();
                                                                                    
     my %menu = ();
@@ -352,7 +356,12 @@
             $r->print('<h3>Functions</h3>'.$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 {