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

banghart lon-capa-cvs@mail.lon-capa.org
Thu, 07 Sep 2006 21:57:52 -0000


banghart		Thu Sep  7 17:57:52 2006 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  	Saving work in progress. Not even close to working.
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.333 loncom/interface/lonparmset.pm:1.334
--- loncom/interface/lonparmset.pm:1.333	Fri Aug 18 18:39:37 2006
+++ loncom/interface/lonparmset.pm	Thu Sep  7 17:57:52 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.333 2006/08/18 22:39:37 albertel Exp $
+# $Id: lonparmset.pm,v 1.334 2006/09/07 21:57:52 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3210,14 +3210,25 @@
     }
     return ($output);
 }
-
+sub addmetafield {
+    my ($r)=@_;
+    $r->print(&Apache::loncommon::start_page('Add Metadata Field'));
+    $r->print(&Apache::lonhtmlcommon::breadcrumbs('Add Metadata Field'));
+    if (exists($env{'form.fieldname'})) {
+        $r->print('Here is a field');
+    }
+    $r->print('<form method="post" action="/adm/parmset?action=addmetadata"');
+    $r->print('<input type="text" name="fieldname" /><br />');
+    $r->print('<input type="submit" value="Add Metadata Field" />');
+    $r->print('</form>');
+}
 sub setrestrictmeta {
     my ($r)=@_;
     my $next_meta;
     my $output;
     my $item_num;
     my $put_result;
-    
+    &Apache::lonnet::logthis("restricting metadata");    
     $r->print(&Apache::loncommon::start_page('Restrict Metadata'));
     $r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata'));
     my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -3264,6 +3275,9 @@
         <p>
         $output
         <input type="submit" name="restrictmeta" value="Update Metadata Restrictions">
+        </form><br />
+        <form method="post" action="/adm/parmset?action=addmetadata" name="form">
+        <input type="submit" name="restrictmeta" value="Add a Metadata Field">
         </form>
 ENDenv
     $r->print(&Apache::loncommon::end_page());
@@ -3715,6 +3729,10 @@
             &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
 						    text=>"Overview Mode"});
 	    &overview($r);
+	} elsif ($env{'form.action'} eq 'addmetadata' && $parm_permission) {
+            &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata',
+						    text=>"Add Metadata Field"});
+	    &addmetafield($r);
         } elsif ($env{'form.action'} eq 'setrestrictmeta' && $parm_permission) {
             &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setrestrictmeta',
 						    text=>"Restrict Metadata"});