Diff for /loncom/interface/lonparmset.pm between versions 1.239 and 1.242

version 1.239, 2005/07/19 16:42:02 version 1.242, 2005/08/27 00:03:32
Line 2677  ENDMAINFORMHEAD Line 2677  ENDMAINFORMHEAD
     action => 'crsenv',      action => 'crsenv',
             permission => $parm_permission,              permission => $parm_permission,
             },              },
             { text => 'Set Instructor Defined Metadata',
       action => 'setinstmeta',
               permission => $parm_permission,
               },
           { text => 'Set/Modify Resource Parameters - Helper Mode',            { text => 'Set/Modify Resource Parameters - Helper Mode',
             url => '/adm/helper/parameter.helper',              url => '/adm/helper/parameter.helper',
             permission => $parm_permission,              permission => $parm_permission,
Line 2720  ENDMAINFORMHEAD Line 2724  ENDMAINFORMHEAD
     $r->print($menu_html);      $r->print($menu_html);
     return;      return;
 }  }
   ### Set instructor defined metadata
   sub setinstmeta {
       my ($r)=@_;
       my $next_meta;
       if ($env{'form.nextmeta'}) {
           $next_meta = $env{'form.nextmeta'};
       } else {
           $next_meta = 1;
       }
       $r->print(&Apache::lonxml::xmlbegin());
       $r->print('<head>
               <title>LON-CAPA Set Instructor Metadata</title>
               </head>');
       $r->print(&Apache::loncommon::bodytag('Set Instructor Metadata'));
       $r->print(&Apache::lonhtmlcommon::breadcrumbs(undef,
       'Set Instructor Metadata'));
       my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
       my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
       if ($env{'form.state'}eq 'add') {
           $r->print('<strong>Compose a new metadata item:</strong><br />');
           $r->print('<form method="post" action="/adm/parmset">');
           $r->print ('Title of item: '.&Apache::lonhtmlcommon::textbox("title",undef,undef,undef).'<br />');
           $r->print ('List if items (comma separated): '.&Apache::lonhtmlcommon::textbox("values",undef,undef,undef).'<br />');
           $r->print ('Select one: <input type="radio" name="type" value="one"><br />');
           $r->print ('Select many: <input type="radio" name="type" value="many"><br />');
           $r->print('<input type="hidden" name="serial" value="'.$next_meta.'" />');
           $r->print('<input type="hidden" name="action" value="setinstmeta" />');
           $r->print('<input type="hidden" name="state" value="save" />');
           $r->print('<input type="submit" value="Save Metadata">');
           $r->print('</form>');
       } elsif ($env{'form.state'}eq 'save') {
           $r->print('Here we save the metadata');
       } else {
           foreach my $key (sort keys %env) {
               my $found_one = 0;
               if ($key=~m/^course\.$env{'request.course.id'}\.metadata\.title/) {
                   unless ($found_one) {
                       $found_one = 1;
                       $r->print('<strong>Existing Metadata</strong><br >');
                   }
                   $r->print($env{$key}.'<br />');
                   $key=~~m/^course\.$env{'request.course.id'}\.metadata\.title\.(d*)\./;
                   if ($1 ge $next_meta) {
                       $next_meta = $1 ++;
                   }
               }
           }
           $r->print('<a href="/adm/parmset?action=setinstmeta&state=add&nextmeta='.$next_meta.'">Add Metadata Item</a><br />');
       }
       $r->print('</body>
                   </html>');
       return 'ok';
   }
 ##################################################  ##################################################
   
 sub defaultsetter {  sub defaultsetter {
Line 2954  sub handler { Line 3009  sub handler {
             &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',              &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
     text=>"Overview Mode"});      text=>"Overview Mode"});
     &overview($r);      &overview($r);
           } elsif ($env{'form.action'} eq 'setinstmeta' && $parm_permission) {
               &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setinstmeta',
       text=>"Instructor Metadata"});
       &setinstmeta($r);
         } elsif ($env{'form.action'} eq 'newoverview' && $parm_permission) {          } elsif ($env{'form.action'} eq 'newoverview' && $parm_permission) {
             &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',              &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
     text=>"Overview Mode"});      text=>"Overview Mode"});

Removed from v.1.239  
changed lines
  Added in v.1.242


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>