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

raeburn raeburn at source.lon-capa.org
Fri Nov 16 19:05:50 EST 2012


raeburn		Sat Nov 17 00:05:50 2012 EDT

  Modified files:              
    /loncom/interface	lonsimplepage.pm lonbulletin.pm 
  Log:
  - Appropriate breadcrumb trails when group page and group discussion boards
    are accessed via "Group" link in inline menu (i.e., form.ref is grouplist).
  
  
Index: loncom/interface/lonsimplepage.pm
diff -u loncom/interface/lonsimplepage.pm:1.99 loncom/interface/lonsimplepage.pm:1.100
--- loncom/interface/lonsimplepage.pm:1.99	Thu Nov  8 21:15:02 2012
+++ loncom/interface/lonsimplepage.pm	Sat Nov 17 00:05:50 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Simple Page Editor
 #
-# $Id: lonsimplepage.pm,v 1.99 2012/11/08 21:15:02 raeburn Exp $
+# $Id: lonsimplepage.pm,v 1.100 2012/11/17 00:05:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -139,10 +139,15 @@
     my %syllabus=&Apache::lonnet::dump($db_name,$dom,$crs);
 
 # --------------------------------------- There is such a user, get environment
-    my ($group_view_perm,$group_edit_perm,$group_home_view,$group_home_edit,
-        $has_group_access);
-    my $brcrum = []; 
-    if ($group ne '') {
+    my ($registered,$group_view_perm,$group_edit_perm,$group_home_view,
+        $group_home_edit,$has_group_access);
+    my $brcrum = [];
+    if ($group eq '') {
+        $registered = $env{'form.register'};
+    } else {
+        unless ($env{'form.ref'} eq 'grouplist') {
+            $registered = $env{'form.register'};
+        }
         $group_view_perm =
                &Apache::lonnet::allowed('vcg',$env{'request.course.id'}.
                ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''));
@@ -157,23 +162,20 @@
             $group_home_edit || &Apache::longroup::check_group_access($group)) {
             $has_group_access = 1;
             if (($env{'form.ref'} eq 'grouplist') && ($target ne 'tex') &&
-                (!$env{'form.register'})) {
+                (!$registered)) {
                 $brcrum = &grouppage_breadcrumbs($dom,$crs,$group,$group_desc);
             }
         }
     }
 
     if ($target ne 'tex') {
-        my $title = 'Simple Course Page';
-        if ($group ne '') {
-            $title = 'Simple Group Page';
-        }
+        my $title = ($group eq '')? 'Simple Course Page':'Simple Group Page';
         my $start_page =
         &Apache::loncommon::start_page($title,undef,
                        {'domain'         => $dom,
                         'group'          => $group,
                         'bread_crumbs'   => $brcrum,
-                        'force_register' => $env{'form.register'},
+                        'force_register' => $registered,
                        }); 
         $r->print($start_page);
     }
@@ -286,7 +288,7 @@
             if ($env{'form.grade_target'} ne 'tex') {
                 #editbox for title
                 $r->print('<form method="post" action="" enctype="multipart/form-data">'."\n".
-                          '<input type="hidden" register="'.$env{'form.register'}.'" />');
+                          '<input type="hidden" register="'.$registered.'" />');
 				&Apache::lontemplate::print_start_template($r,&mt('Title'),'LC_Box');
 				$r->print($titletext);
 				$r->print("<br /><div>");
Index: loncom/interface/lonbulletin.pm
diff -u loncom/interface/lonbulletin.pm:1.64 loncom/interface/lonbulletin.pm:1.65
--- loncom/interface/lonbulletin.pm:1.64	Thu Nov  8 22:01:00 2012
+++ loncom/interface/lonbulletin.pm	Sat Nov 17 00:05:50 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Bulletin Board Handler
 #
-# $Id: lonbulletin.pm,v 1.64 2012/11/08 22:01:00 raeburn Exp $
+# $Id: lonbulletin.pm,v 1.65 2012/11/17 00:05:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -131,7 +131,11 @@
         } else {
             $course_or_group="Group";
         }
+        my $registered;
         if ($group ne '' && $env{'form.group'} eq $group) {
+            unless ($env{'form.ref'} eq 'grouplist') {
+                $registered = $env{'form.register'}; 
+            }
             my $gpterm =  &Apache::loncommon::group_term();
             my $ucgpterm = $gpterm;
             $ucgpterm =~ s/^(\w)/uc($1)/e;
@@ -141,11 +145,17 @@
             if ((ref($groupboards) eq 'ARRAY') && (@{$groupboards} > 0)) {
                 $boardtitle = $$boards{$$groupboards[0]}{'title'};
             }
-            $boardurl .= '?register=1&group='.$group;
-            $brcrum = 
-                &groupboard_breadcrumbs($dom,$crs,$group,$refarg,$gpterm,
-                                        $ucgpterm,$grp_desc,$boardurl,$boardtitle);
+            $boardurl .= '?group='.$group;
+            if ($registered) {
+                $boardurl .= '&register='.$env{'form.register'};
+            } else {
+                $brcrum = 
+                    &groupboard_breadcrumbs($dom,$crs,$group,$refarg,$gpterm,
+                                            $ucgpterm,$grp_desc,$boardurl,
+                                            $boardtitle);
+            }
         } else {
+            $registered = $env{'form.register'};
             $brcrum = [];
         }
         my $start_page =
@@ -154,8 +164,8 @@
                                             'domain'         => $dom,
                                             'bread_crumbs'   => $brcrum, 
                                             'group'          => $group,
-                                            'force_register' =>
-                                                $env{'form.register'}});
+                                            'force_register' => $registered}
+                                          );
         $r->print($start_page);
     }
     my ($allowed);




More information about the LON-CAPA-cvs mailing list