[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

raeburn raeburn@source.lon-capa.org
Thu, 15 Oct 2009 22:39:59 -0000


raeburn		Thu Oct 15 22:39:59 2009 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  When editing an HTML document uploaded directly to a course:
    - Do not include CSTR breadcrumbs.
    - Include a "Course View" button to allow return from editing to course context.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.411 loncom/xml/londefdef.pm:1.412
--- loncom/xml/londefdef.pm:1.411	Thu Oct  1 15:31:24 2009
+++ loncom/xml/londefdef.pm	Thu Oct 15 22:39:58 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.411 2009/10/01 15:31:24 bisitz Exp $
+# $Id: londefdef.pm,v 1.412 2009/10/15 22:39:58 raeburn Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -561,7 +561,9 @@
 #					    'no_title'       => 1,
 					    'force_register' => 1});
 
-    $currentstring .= &Apache::lonhtmlcommon::breadcrumbs();
+        if ($env{'request.state'} eq 'construct') {
+            $currentstring .= &Apache::lonhtmlcommon::breadcrumbs();
+        }
 
         my $header = '';
         if ($env{'request.state'} ne 'published' &&
@@ -575,6 +577,8 @@
             $currentstring.=&Apache::loncommon::head_subbox(
                                 &Apache::loncommon::CSTR_pageheader()
                                .$header);
+        } elsif ($env{'request.state'} eq 'edit') {
+            $currentstring.=&Apache::loncommon::head_subbox($header);
         }
         $currentstring.=&Apache::lonxml::message_location();
     } elsif ($target eq 'tex') {
@@ -597,7 +601,11 @@
 </div>';
     }
     $result .= '
-<div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" /></div>
+<div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" />';
+    if (($env{'request.course.id'}) && ($env{'form.forceedit'})) {
+        $result .= ('&nbsp;' x 3).'<input type="button" value="'.&mt('Course View').'" onclick="javascript:location.href=currentURL" />';
+    }
+    $result .= '</div>
 </div>
 </form>
 ';