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

www www at source.lon-capa.org
Wed Oct 19 17:15:53 EDT 2011


www		Wed Oct 19 21:15:53 2011 EDT

  Modified files:              
    /loncom/interface	courseprefs.pm lonconfigsettings.pm 
  Log:
  Tab for Course Preferences shows up
  
  
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.46 loncom/interface/courseprefs.pm:1.47
--- loncom/interface/courseprefs.pm:1.46	Thu Jul 28 04:26:36 2011
+++ loncom/interface/courseprefs.pm	Wed Oct 19 21:15:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set configuration settings for a course
 #
-# $Id: courseprefs.pm,v 1.46 2011/07/28 04:26:36 raeburn Exp $
+# $Id: courseprefs.pm,v 1.47 2011/10/19 21:15:53 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -509,15 +509,15 @@
         my @allitems = &get_allitems(%prefs);
         &Apache::lonconfigsettings::make_changes($r,$cdom,$phase,$context,
                                                  \@prefs_order,\%prefs,\%values,
-                                                  $cnum,undef,\@allitems);
+                                                  $cnum,undef,\@allitems,'coursepref');
     } elsif ($phase eq 'display') {
         my $jscript = &get_jscript($cid,$cdom,$phase,$crstype);
         my @allitems = &get_allitems(%prefs);
         &Apache::lonconfigsettings::display_settings($r,$cdom,$phase,$context,
-            \@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype);
+            \@prefs_order,\%prefs,\%values,undef,$jscript,\@allitems,$crstype,'coursepref');
     } else {
         &Apache::lonconfigsettings::display_choices($r,$phase,$context,
-                                                    \@prefs_order,\%prefs);
+                                                    \@prefs_order,\%prefs,'coursepref');
     }
     return OK;
 }
Index: loncom/interface/lonconfigsettings.pm
diff -u loncom/interface/lonconfigsettings.pm:1.19 loncom/interface/lonconfigsettings.pm:1.20
--- loncom/interface/lonconfigsettings.pm:1.19	Sun Jun  5 12:59:47 2011
+++ loncom/interface/lonconfigsettings.pm	Wed Oct 19 21:15:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: lonconfigsettings.pm,v 1.19 2011/06/05 12:59:47 www Exp $
+# $Id: lonconfigsettings.pm,v 1.20 2011/10/19 21:15:53 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -35,9 +35,10 @@
 use Apache::loncommon();
 use Apache::lonhtmlcommon();
 use Apache::lonlocal;
+use Apache::lonparmset();
 
 sub print_header {
-    my ($r,$phase,$context,$jscript) = @_;
+    my ($r,$phase,$context,$jscript,$container) = @_;
     my ($pagetitle,$brcrumtitle,$action,$call_category_check);
     if ($context eq 'domain') {
         ($pagetitle, $brcrumtitle) = ('View/Modify Domain Settings','View/Modify Domain Settings');
@@ -126,13 +127,16 @@
 <input type="hidden" name="pres_value" />
 </form>
 ');
+    if ($container) {
+       &Apache::lonparmset::startSettingsScreen($r,$container);
+    }
     $r->print('<form method="post" name="'.$phase.'" action="'.$action.'"'.
               ' enctype="multipart/form-data">');
     return;
 }
 
 sub print_footer {
-    my ($r,$phase,$newphase,$button_text,$actions) = @_;
+    my ($r,$phase,$newphase,$button_text,$actions,$container) = @_;
     $button_text = &mt($button_text);
     $r->print('<input type="hidden" name="phase" value="" />');
     if (defined($env{'form.origin'})) {
@@ -159,13 +163,17 @@
                   $button_text.'" onclick='.$onclick.' /></p>');
     }
     if ($phase eq 'process') {
-        $r->print('</form>'.&Apache::loncommon::end_page());
+        $r->print('</form>');
+        if ($container) {
+           &Apache::lonparmset::endSettingsScreen($r);
+        }
+        $r->print(&Apache::loncommon::end_page());
     }
     return;
 }
 
 sub make_changes {
-    my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$roles,$allitems) = @_;
+    my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$roles,$allitems,$container) = @_;
     my %brcrumtext = &get_crumb_text();
     my @actions = &Apache::loncommon::get_env_multiple('form.actions');
     my ($numchanged,%changes,%disallowed);
@@ -174,7 +182,7 @@
         text=>$brcrumtext{$context}},
        {href=>"javascript:changePage(document.$phase,'$phase')",
         text=>"Updated"});
-    &print_header($r,$phase,$context);
+    &print_header($r,$phase,$context,undef,$container);
     my $crstype;
     if ($context eq 'course') {
         $crstype = &Apache::loncommon::course_type();
@@ -229,19 +237,19 @@
     if ($context eq 'course') {
         $footer_text = 'Back to display/edit settings'; 
     }
-    &print_footer($r,$phase,'display',$footer_text,\@actions);
+    &print_footer($r,$phase,'display',$footer_text,\@actions,$container);
     $r->print('</p>');
 }
 
 sub display_settings {
     my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$jscript,
-        $allitems,$crstype) = @_;
+        $allitems,$crstype,$container) = @_;
     my %brcrumtext = &get_crumb_text();
     my @actions = &Apache::loncommon::get_env_multiple('form.actions');
     &Apache::lonhtmlcommon::add_breadcrumb
         ({href=>"javascript:changePage(document.$phase,'display')",
           text=>"Display/Edit Settings"});
-    &print_header($r,$phase,$context,$jscript);
+    &print_header($r,$phase,$context,$jscript,$container);
     my $divwidth = 900;
     if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { 
         if (@actions > 0) {
@@ -274,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,$phase,'process','Save Changes',\@actions,$container));
         } else {
             $r->print('<input type="hidden" name="phase" value="" />'.
                       '<span class="LC_error">'.&mt('No settings chosen').
@@ -287,12 +295,12 @@
 }
 
 sub display_choices {
-    my ($r,$phase,$context,$prefs_order,$prefs) = @_;
+    my ($r,$phase,$context,$prefs_order,$prefs,$container) = @_;
     if ($phase eq '') {
         $phase = 'pickactions';
     }
     my %helphash;
-    &print_header($r,$phase,$context);
+    &print_header($r,$phase,$context,undef,$container);
     $r->print('<script type="text/javascript">'."\n".
               '// <![CDATA['."\n".
               &Apache::loncommon::check_uncheck_jscript()."\n".
@@ -336,7 +344,7 @@
         }
         $r->print('</div><br clear="all" />');
     }
-    $r->print(&print_footer($r,$phase,'display','Display'));
+    $r->print(&print_footer($r,$phase,'display','Display',undef,$container));
     $r->print('</form>');
     $r->print(&Apache::loncommon::end_page());
     return;




More information about the LON-CAPA-cvs mailing list