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

www lon-capa-cvs@mail.lon-capa.org
Mon, 27 Nov 2006 21:20:34 -0000


www		Mon Nov 27 16:20:34 2006 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  Breadcrumbs
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.256 loncom/interface/londocs.pm:1.257
--- loncom/interface/londocs.pm:1.256	Wed Nov 22 09:07:13 2006
+++ loncom/interface/londocs.pm	Mon Nov 27 16:20:29 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.256 2006/11/22 14:07:13 albertel Exp $
+# $Id: londocs.pm,v 1.257 2006/11/27 21:20:29 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -147,6 +147,7 @@
     my $type = &Apache::loncommon::course_type();
     $r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space').
 	      '<form name="dumpdoc" method="post">');
+    $r->print(&Apache::lonhtmlcommon::breadcrumbs('Dump '.$type.' DOCS to Construction Space'));
     my ($home,$other,%outhash)=&authorhosts();
     unless ($home) { return ''; }
     my $origcrsid=$env{'request.course.id'};
@@ -315,6 +316,7 @@
             }
         }
         $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package'));
+	$r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package'));
         $r->print($outcome);
         $r->print(&Apache::loncommon::end_page());
     } else {
@@ -456,6 +458,7 @@
         |;
 	$r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package',
 						 $scripttag));
+	$r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package'));
 	$r->print($display.'</table>'.
                   '<p><input type="hidden" name="finishexport" value="1">'.
                   '<input type="submit" name="exportcourse" value="'.
@@ -1986,6 +1989,7 @@
     my ($r) = @_;
 
     $r->print(&Apache::loncommon::start_page('Symb List'));
+    $r->print(&Apache::lonhtmlcommon::breadcrumbs('Symb List'));
     my $navmap = Apache::lonnavmaps::navmap->new();
     $r->print("<pre>\n");
     foreach my $res ($navmap->retrieveResources()) {
@@ -2005,6 +2009,7 @@
    my $loaderror=&Apache::lonnet::overloaderror($r);
    if ($loaderror) { return $loaderror; }
    $r->print(&Apache::loncommon::start_page('Verify '.$type.' Documents'));
+   $r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$type.' Documents'));
    $hashtied=0;
    undef %alreadyseen;
    %alreadyseen=();
@@ -2040,6 +2045,7 @@
     my ($r) = @_;
     my $type = &Apache::loncommon::course_type();
     $r->print(&Apache::loncommon::start_page("Check $type Document Versions"));
+    $r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $type Document Versions"));
     my $header='';
     my $startsel='';
     my $monthsel='';
@@ -2331,6 +2337,22 @@
 $help{'Caching'}.'</font></h3></form>'."\n\n");
 }
 
+# =========================================== Breadcrumbs for special functions
+
+sub init_breadcrumbs {
+    my ($form,$text)=@_;
+    &Apache::lonhtmlcommon::clear_breadcrumbs();
+    &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs",
+					    text=>&Apache::loncommon::course_type()." Documents",
+					    faq=>273,
+					    bug=>'Instructor Interface',
+                                            help => 'Docs_Adding_Course_Doc'});
+    &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs?".$form.'=1',
+					    text=>$text,
+					    faq=>273,
+					    bug=>'Instructor Interface'});
+}
+
 # ================================================================ Main Handler
 sub handler {
     my $r = shift;
@@ -2364,18 +2386,23 @@
 
 # does this user have privileges to modify docs
     my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
-
   if ($allowed && $env{'form.verify'}) {
+      &init_breadcrumbs('verify','Verify Content');
       &verifycontent($r);
   } elsif ($allowed && $env{'form.listsymbs'}) {
+      &init_breadcrumbs('listsymbs','List Symbs');
       &list_symbs($r);
   } elsif ($allowed && $env{'form.docslog'}) {
+      &init_breadcrumbs('docslog','Show Log');
       &docs_change_log($r);
   } elsif ($allowed && $env{'form.versions'}) {
+      &init_breadcrumbs('versions','Check/Set Resource Versions');
       &checkversions($r);
   } elsif ($allowed && $env{'form.dumpcourse'}) {
+      &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space');
       &dumpcourse($r);
   } elsif ($allowed && $env{'form.exportcourse'}) {
+      &init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS');
       &exportcourse($r);
   } else {
 # is this a standard course?