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

raeburn raeburn@source.lon-capa.org
Thu, 31 Mar 2011 15:35:55 -0000


raeburn		Thu Mar 31 15:35:55 2011 EDT

  Modified files:              
    /loncom/interface	lonconfigsettings.pm 
  Log:
  - No "Course Settings" and "Content and Problem Settings" tabs
    when module is used in domain context (for Domain Configuration -- DC roles).
  
  
Index: loncom/interface/lonconfigsettings.pm
diff -u loncom/interface/lonconfigsettings.pm:1.17 loncom/interface/lonconfigsettings.pm:1.18
--- loncom/interface/lonconfigsettings.pm:1.17	Thu Jan 13 22:49:47 2011
+++ loncom/interface/lonconfigsettings.pm	Thu Mar 31 15:35:54 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: lonconfigsettings.pm,v 1.17 2011/01/13 22:49:47 www Exp $
+# $Id: lonconfigsettings.pm,v 1.18 2011/03/31 15:35:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -120,7 +120,9 @@
     }
     $r->print(&Apache::loncommon::start_page($pagetitle,$js,$additem));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs($brcrumtitle));
-    &Apache::lonparmset::startSettingsScreen($r,'coursepref');
+    if ($context eq 'course') {
+        &Apache::lonparmset::startSettingsScreen($r,'coursepref');
+    }
     $r->print('
 <form name="parmform" action="">
 <input type="hidden" name="pres_marker" />
@@ -134,7 +136,7 @@
 }
 
 sub print_footer {
-    my ($r,$phase,$newphase,$button_text,$actions) = @_;
+    my ($r,$context,$phase,$newphase,$button_text,$actions) = @_;
     $button_text = &mt($button_text);
     $r->print('<input type="hidden" name="phase" value="" />');
     if (defined($env{'form.origin'})) {
@@ -162,7 +164,9 @@
     }
     if ($phase eq 'process') {
         $r->print('</form>');
-        &Apache::lonparmset::endSettingsScreen($r);
+        if ($context eq 'course') {
+            &Apache::lonparmset::endSettingsScreen($r);
+        }
         $r->print(&Apache::loncommon::end_page());
     }
     return;
@@ -233,7 +237,7 @@
     if ($context eq 'course') {
         $footer_text = 'Back to display/edit settings'; 
     }
-    &print_footer($r,$phase,'display',$footer_text,\@actions);
+    &print_footer($r,$context,$phase,'display',$footer_text,\@actions);
     $r->print('</p>');
 }
 
@@ -278,7 +282,7 @@
                 $r->print($output{$items[$i]});
             }
             $r->print('</div>');
-            $r->print(&print_footer($r,$phase,'process','Save Changes',\@actions));
+            $r->print(&print_footer($r,$context,$phase,'process','Save Changes',\@actions));
         } else {
             $r->print('<input type="hidden" name="phase" value="" />'.
                       '<span class="LC_error">'.&mt('No settings chosen').
@@ -368,7 +372,7 @@
         }
         $r->print('</div><br clear="all" />');
     }
-    $r->print(&print_footer($r,$phase,'display','Display'));
+    $r->print(&print_footer($r,$context,$phase,'display','Display'));
     $r->print('</form>');
     $r->print(&Apache::loncommon::end_page());
     return;