[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonmenu.pm lonsyllabus.pm

raeburn raeburn at source.lon-capa.org
Thu Dec 6 16:43:27 EST 2012


raeburn		Thu Dec  6 21:43:27 2012 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm lonaboutme.pm lonsyllabus.pm 
  Log:
  - Supplemental Content area can contain Syllabus and Personal Information 
    (aboutme) pages.
  - Provide breadcrumbs when these items are accessed via a Supplemental 
    Content folder.
  - Users with mdc prvilege should also receive "Edit Folder" link in Functions
    area to provide direct access to Content Editor for corresponding Supplemental
    Content folder.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.396 loncom/interface/lonmenu.pm:1.397
--- loncom/interface/lonmenu.pm:1.396	Thu Dec  6 14:37:35 2012
+++ loncom/interface/lonmenu.pm	Thu Dec  6 21:43:27 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.396 2012/12/06 14:37:35 raeburn Exp $
+# $Id: lonmenu.pm,v 1.397 2012/12/06 21:43:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -915,7 +915,9 @@
             (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) &&
             (($resurl =~ m{^/adm/wrapper/ext/}) ||
              ($resurl =~ m{^/uploaded/$cdom/$cnum/supplemental/}) ||
-             ($resurl eq '/adm/supplemental'))) {
+             ($resurl eq '/adm/supplemental') ||
+             ($resurl =~ m{^/public/$cdom/$cnum/syllabus$}) ||
+             ($resurl =~ m{^/adm/$match_domain/$match_username/aboutme$}))) {
             my @folders=split('&',$env{'form.folderpath'});
             if ((@folders > 2) || ($resurl ne '/adm/supplemental')) {
                 my $esc_path=&escape(&HTML::Entities::encode(&escape($env{'form.folderpath'}),'<>&"'));
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.151 loncom/interface/lonaboutme.pm:1.152
--- loncom/interface/lonaboutme.pm:1.151	Fri Nov  9 17:27:10 2012
+++ loncom/interface/lonaboutme.pm	Thu Dec  6 21:43:27 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.151 2012/11/09 17:27:10 raeburn Exp $
+# $Id: lonaboutme.pm,v 1.152 2012/12/06 21:43:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -140,7 +140,7 @@
 # ------------------------------------------------------------ Get Query String
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                         ['forceedit','forcestudent',
-                         'register','popup']);
+                         'register','popup','folderpath','title']);
 
 # ----------------------------------------------- Available Portfolio file display
     if (($target ne 'tex') && ($action eq 'portfolio')) {
@@ -220,8 +220,22 @@
         if ($env{'form.popup'}) { # Don't show breadcrumbs in popup window 
             $args->{'no_nav_bar'} = 1;
         } elsif (!$env{'form.register'}) { #Don't show breadcrumbs twice, when this page is part of course content and you call it
-            $args->{'bread_crumbs'} = [{href=>"/adm/$cdom/$cnum/aboutme",
-                                        text=>"Personal Information Page"}];
+            if (($env{'request.course.id'}) &&
+                 ($env{'form.folderpath'} =~ /^supplemental/)) {
+                my $crstype = &Apache::loncommon::course_type();
+                my $title = $env{'form.title'};
+                if ($title eq '') {
+                    $title = &mt('Personal Information Page');
+                }
+                my $brcrum =
+                    &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
+                if (ref($brcrum) eq 'ARRAY') {
+                    $args->{'bread_crumbs'} = $brcrum;
+                }
+            } else {
+                $args->{'bread_crumbs'} = [{href=>"/adm/$cdom/$cnum/aboutme",
+                                            text=>"Personal Information Page"}];
+            }
         }
         my $start_page = &Apache::loncommon::start_page('Personal Information Page',$rss_link,$args);
         $r->print($start_page);
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.114 loncom/interface/lonsyllabus.pm:1.115
--- loncom/interface/lonsyllabus.pm:1.114	Mon Dec  3 23:53:03 2012
+++ loncom/interface/lonsyllabus.pm	Thu Dec  6 21:43:27 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.114 2012/12/03 23:53:03 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.115 2012/12/06 21:43:27 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,7 +52,8 @@
     my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
 # ------------------------------------------------------------ Get query string
     &Apache::loncommon::get_unprocessed_cgi
-                        ($ENV{'QUERY_STRING'},['register','forceedit']);
+                        ($ENV{'QUERY_STRING'},['register','forceedit',
+                                               'folderpath','title']);
 # ----------------------------------------------------- Is this even a course?
     my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom);
     if ($homeserver eq 'no_host') {
@@ -139,17 +140,19 @@
 
 ENDSCRIPT
         }
+        my $args = {'function'       => undef,
+                    'domain'         => $cdom};
         my $forcereg;
         if ($env{'form.register'}) {
             $forcereg = 1;
+            $args->{'force_register'} = $forcereg;
         }
-        my $brcrum = [];
         if ($env{'form.backto'} eq 'coursecatalog') {
             &Apache::lonhtmlcommon::clear_breadcrumbs();
-            $brcrum = [{href=>"javascript:ToCatalog();",
-                        text=>&mt('Course/Community Catalog'),
-                        no_mt=>1}
-                      ];
+            my $brcrum = [{href=>"javascript:ToCatalog();",
+                           text=>&mt('Course/Community Catalog'),
+                           no_mt=>1}
+                         ];
             if ($env{'form.coursenum'} ne '') {
                 push(@{$brcrum},
                       {href=>"javascript:ToCatalog('details')",
@@ -158,12 +161,18 @@
             push(@{$brcrum},
                   {href=>$r->uri,
                    text=>"Course syllabus"});
-        }
-        my $args = {'function'       => undef,
-                    'domain'         => $cdom,
-                    'force_register' => $forcereg,};
-        if (@{$brcrum} > 0) {
             $args->{'bread_crumbs'} = $brcrum;
+        } elsif ($env{'form.folderpath'} =~ /^supplemental/) {
+            my $crstype = &Apache::loncommon::course_type();
+            my $title = $env{'form.title'};
+            if ($title eq '') {
+                $title = &mt('Syllabus');
+            }
+            my $brcrum =
+                &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
+            if (ref($brcrum) eq 'ARRAY') {
+                $args->{'bread_crumbs'} = $brcrum;
+            }
         }
         my $start_page =
             &Apache::loncommon::start_page("Syllabus", $rss_link.$js,$args);




More information about the LON-CAPA-cvs mailing list