File:  [LON-CAPA] / loncom / homework / edit.pm
Revision 1.48: download - view: text, annotated - select for diffs
Sun May 4 22:14:53 2003 UTC (21 years ago) by albertel
Branches: MAIN
CVS tags: HEAD
- edit mode of chemresponse now works
- needed to modify html_element_name to stop javascript from being an ass
- new editable arg type hidden_arg

    1: # The LearningOnline Network with CAPA 
    2: # edit mode helpers
    3: #
    4: # $Id: edit.pm,v 1.48 2003/05/04 22:14:53 albertel Exp $
    5: #
    6: # Copyright Michigan State University Board of Trustees
    7: #
    8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    9: #
   10: # LON-CAPA is free software; you can redistribute it and/or modify
   11: # it under the terms of the GNU General Public License as published by
   12: # the Free Software Foundation; either version 2 of the License, or
   13: # (at your option) any later version.
   14: #
   15: # LON-CAPA is distributed in the hope that it will be useful,
   16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18: # GNU General Public License for more details.
   19: #
   20: # You should have received a copy of the GNU General Public License
   21: # along with LON-CAPA; if not, write to the Free Software
   22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23: #
   24: # /home/httpd/html/adm/gpl.txt
   25: #
   26: # http://www.lon-capa.org/
   27: #
   28: # 3/20 Guy
   29: # 01/10/02 Matthew
   30: # 03/06/02 Matthew
   31: package Apache::edit; 
   32: 
   33: use strict;
   34: use Apache::lonnet();
   35: use HTML::Entities();
   36: 
   37: # Global Vars
   38: # default list of colors to use in editing
   39: @Apache::edit::colorlist=('#ffffff','#ff0000','#00ff00','#0000ff','#0ff000','#000ff0','#f0000f');
   40: # depth of nesting of edit
   41: $Apache::edit::colordepth=0;
   42: @Apache::edit::inserttag=();
   43: 
   44: sub initialize_edit {
   45:   $Apache::edit::colordepth=0;
   46:   @Apache::edit::inserttag=();
   47: }
   48: 
   49: sub tag_start {
   50:   my ($target,$token,$description) = @_;
   51:   my $result='';
   52:   if ($target eq "edit") {
   53:     my $tag=$token->[1];
   54:     if (!$description) {
   55:       $description=&Apache::lonxml::description($token);
   56:       if (!$description) { $description="<$tag>"; }
   57:     }
   58:     $result.= &start_table($token)."<tr><td>$description</td>
   59: <td>Delete".
   60:   &deletelist($target,$token)
   61:   ."</td>
   62: <td>".
   63:     &insertlist($target,$token).&end_row().&start_spanning_row();
   64: #<td>". 
   65: #  &movebuttons($target,$token).
   66: #    "</tr><tr><td colspan=\"3\">\n";
   67:   }
   68:   return $result;
   69: }
   70: 
   71: sub tag_end {
   72:   my ($target,$token,$description) = @_;
   73:   my $result='';
   74:   if ($target eq 'edit') {
   75:     my $tag=$token->[1];
   76:     if (!defined($description)) {
   77:       $result.="</td></tr><tr><td>&lt;/$tag&gt;</td><td colspan=\"2\">&nbsp;</td>";
   78:     } else {
   79:       if ($description ne '') { $result.="</td></tr><tr><td>$description</td><td colspan=\"2\">&nbsp;</td>"; }
   80:     }
   81:     $result.="</tr>".&end_table()."\n";
   82:   }
   83:   return $result;
   84: }
   85: 
   86: sub start_table {
   87:   my ($token)=@_;
   88:   my $tag = $token->[1];
   89:   my $tagnum;
   90:   foreach my $namespace (reverse @Apache::lonxml::namespace) {
   91:     my $testtag=$namespace.'::'.$tag;
   92:     $tagnum=$Apache::lonxml::insertlist{"$testtag.num"};
   93:     if (defined($tagnum)) { last; }
   94:   }
   95:   if (!defined ($tagnum)) { $tagnum=$Apache::lonxml::insertlist{"$tag.num"}; }
   96:   my $color = $Apache::lonxml::insertlist{"$tagnum.color"};
   97:   if (!defined($color)) {
   98:     $color = $Apache::edit::colorlist[$Apache::edit::colordepth];
   99:   }
  100:   $Apache::edit::colordepth++;
  101:   push(@Apache::edit::inserttag,$token->[1]);
  102:   my $result='<div align="right">';
  103:   $result.='<table bgcolor="'.$color.'" width="97%" border="0" cellspacing="5" cellpadding="3">';
  104:   return $result;
  105: }
  106: 
  107: sub end_table {
  108:   $Apache::edit::colordepth--;
  109:   my $result='</table></div>';
  110:   $result.="<table><tr><td>";
  111: 
  112:   my ($tagname,$closingtag);
  113:   if (defined($Apache::edit::inserttag[-2])) {
  114:     $tagname=$Apache::edit::inserttag[-2];
  115:   } else {$tagname='problem';}
  116:   if (defined($Apache::edit::inserttag[-1])) {
  117:     $closingtag=$Apache::edit::inserttag[-1];
  118:   }
  119:   $result.=&innerinsertlist('edit',$tagname,$closingtag).
  120:     "</td></tr></table>";
  121:   pop(@Apache::edit::inserttag);
  122:   return $result;
  123: }
  124: 
  125: sub start_spanning_row { return '<tr><td colspan="3" bgcolor="#DDDDDD">';}
  126: sub start_row          { return '<tr><td bgcolor="#DDDDDD">';            }
  127: sub end_row            { return '</td></tr>';          }
  128: 
  129: sub movebuttons {
  130:   my ($target,$token) = @_;
  131:   my $result='<input type="submit" name="moveup.'.
  132:     $Apache::lonxml::curdepth.'" value="Move Up" />';
  133:   $result.='<input type="submit" name="movedown.'.
  134:     $Apache::lonxml::curdepth.'" value="Move Down" />';
  135:   return $result;
  136: }
  137: 
  138: sub deletelist {
  139:   my ($target,$token) = @_;
  140:   my $result = "<select name=\"delete_$Apache::lonxml::curdepth\">
  141: <option></option>
  142: <option>Yes</option>
  143: </select>";
  144:   return $result;
  145: }
  146: 
  147: sub handle_delete {
  148:   if (!$ENV{"form.delete_$Apache::lonxml::curdepth"}) { return ''; }
  149:   my ($space,$target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
  150:   my $result=0;
  151:   if ($space) {
  152:     my $sub1="$space\:\:delete_$token->[1]";
  153:     {
  154:       no strict 'refs';
  155:       if (defined &$sub1) {
  156: 	$result=&$sub1($target,$token,$tagstack,$parstack,$parser,$safeeval,$style);
  157:       }
  158:     }
  159:   }
  160:   if (!$result) {
  161:     my $endtag='/'.$token->[1];
  162:     my $bodytext=&Apache::lonxml::get_all_text($endtag,$parser);
  163:     $$parser['-1']->get_token();
  164:     &Apache::lonxml::debug("Deleting :$bodytext: for $token->[1]");
  165:     &Apache::lonxml::end_tag($tagstack,$parstack,$token);
  166:   }
  167:   return 1;
  168: }
  169: 
  170: sub get_insert_list {
  171:   my ($tagname) = @_;
  172:   my $result='';
  173:   my @tagnums= ();
  174:   #&Apache::lonxml::debug("keys ".join("\n",sort(keys(%Apache::lonxml::insertlist))));
  175:   if ($Apache::lonxml::insertlist{"$tagname.which"}) {
  176:     push (@tagnums, @{ $Apache::lonxml::insertlist{"$tagname.which"} });
  177:   }
  178:   foreach my $namespace (@Apache::lonxml::namespace) {
  179:     if ($Apache::lonxml::insertlist{"$namespace".'::'."$tagname.which"}) {
  180:       push (@tagnums, @{ $Apache::lonxml::insertlist{"$namespace".'::'."$tagname.which"} });
  181:     }
  182:   }
  183:   if (@tagnums) {
  184:     my %options;
  185:     foreach my $tagnum (@tagnums) {
  186:       my $descrip=$Apache::lonxml::insertlist{"$tagnum.description"};
  187:       $options{$descrip} ="<option value=\"$tagnum\">".$descrip."</option>\n";
  188:     }
  189:     foreach my $option (sort(keys(%options))) { $result.=$options{$option}; }
  190:     if ($result) { $result='<option selected="on"></option>'.$result; }
  191:   }
  192:   return $result;
  193: }
  194: 
  195: sub insertlist {
  196:   my ($target,$token) = @_;
  197:   return &innerinsertlist($target,$token->[1]);
  198: }
  199: 
  200: sub innerinsertlist {
  201:   my ($target,$tagname,$closingtag) = @_;
  202:   my $result;
  203:   my $after='';
  204:   if ($closingtag) {
  205:      $after='_after_'.$closingtag; 
  206:   }
  207:   if ($target eq 'edit') {
  208:     my $optionlist= &get_insert_list($tagname);
  209:     if ($optionlist) {
  210:       $result = "Insert:
  211: <select name=\"insert$after\_$Apache::lonxml::curdepth\">
  212: $optionlist
  213: </select>"
  214:     } else {
  215:       $result="&nbsp;";
  216:     }
  217:   }
  218:   return $result;
  219: }
  220: 
  221: sub handle_insert {
  222:   if ($ENV{"form.insert_$Apache::lonxml::curdepth"} eq '') { return ''; }
  223:   my $result;
  224:   my $tagnum = $ENV{"form.insert_$Apache::lonxml::curdepth"};
  225:   my $func=$Apache::lonxml::insertlist{"$tagnum.function"};
  226:   if ($func eq 'default') {
  227:     my $newtag=$Apache::lonxml::insertlist{"$tagnum.tag"};
  228:     my $namespace;
  229:     if ($newtag =~ /::/) { ($namespace,$newtag) = split(/::/,$newtag); }
  230:     $result.="\n<$newtag>\n</$newtag>";
  231:   } else {
  232:     if (defined(&$func)) {
  233:       {
  234: 	no strict 'refs';
  235: 	$result.=&$func();
  236:       }
  237:     } else {
  238:       my $newtag=$Apache::lonxml::insertlist{"$tagnum.tag"};
  239:       &Apache::lonxml::error("Unable to insert tag $newtag, $func was not defined.");
  240:     }
  241:   }
  242:   return $result;
  243: }
  244: 
  245: sub handle_insertafter {
  246:   my $tagname=shift;
  247:   if ($ENV{"form.insert_after_$tagname\_$Apache::lonxml::curdepth"} eq '')
  248:      { return ''; }
  249:   my $result;
  250:   my $tagnum =$ENV{"form.insert_after_$tagname\_$Apache::lonxml::curdepth"};
  251:   my $func=$Apache::lonxml::insertlist{"$tagnum.function"};
  252:   if ($func eq 'default') {
  253:     my $newtag=$Apache::lonxml::insertlist{"$tagnum.tag"};
  254:     my $namespace;
  255:     if ($newtag =~ /::/) { ($namespace,$newtag) = split(/::/,$newtag); }
  256:     $result.="\n<$newtag>\n</$newtag>";
  257:   } else {
  258:     if (defined(&$func)) {
  259:       {
  260: 	no strict 'refs';
  261: 	$result.=&$func();
  262:       }
  263:     } else {
  264:       my $newtag=$Apache::lonxml::insertlist{"$tagnum.tag"};
  265:       &Apache::lonxml::error("Unable to insert (after) tag $newtag, $func was not defined. ($tagname $tagnum)");
  266:     }
  267:   }
  268:   return $result;
  269: }
  270: 
  271: sub insert_responseparam {
  272:   return '
  273:     <responseparam />';
  274: }
  275: 
  276: sub insert_formularesponse {
  277:   return '
  278: <formularesponse answer="" samples="">
  279:     <textline />
  280:     <hintgroup>
  281:     </hintgroup>
  282: </formularesponse>';
  283: }
  284: 
  285: sub insert_numericalresponse {
  286:   return '
  287: <numericalresponse answer="">
  288:     <textline />
  289:     <hintgroup>
  290:     </hintgroup>
  291: </numericalresponse>';
  292: }
  293: 
  294: sub insert_stringresponse {
  295:   return '
  296: <stringresponse answer="" type="">
  297:     <textline />
  298:     <hintgroup>
  299:     </hintgroup>
  300: </stringresponse>';
  301: }
  302: 
  303: sub insert_essayresponse {
  304:   return '
  305: <essayresponse>
  306:     <textfield></textfield>
  307: </essayresponse>';
  308: }
  309: 
  310: sub insert_optionresponse {
  311:   return '
  312: <optionresponse max="10">
  313:     <foilgroup options="">
  314:     </foilgroup>
  315:     <hintgroup>
  316:     </hintgroup>
  317: </optionresponse>';
  318: }
  319: 
  320: sub insert_radiobuttonresponse {
  321:   return '
  322: <radiobuttonresponse max="10">
  323:     <foilgroup>
  324:     </foilgroup>
  325:     <hintgroup>
  326:     </hintgroup>
  327: </radiobuttonresponse>';
  328: }
  329: 
  330: sub insert_rankresponse {
  331:   return '
  332: <rankresponse max="10">
  333:     <foilgroup options="">
  334:     </foilgroup>
  335:     <hintgroup>
  336:     </hintgroup>
  337: </rankresponse>';
  338: }
  339: 
  340: sub insert_matchresponse {
  341:   return '
  342: <matchresponse max="10">
  343:     <foilgroup options="">
  344:       <itemgroup>
  345:       </itemgroup>
  346:     </foilgroup>
  347:     <hintgroup>
  348:     </hintgroup>
  349: </matchresponse>';
  350: }
  351: 
  352: sub insert_displayduedate { return '<displayduedate />'; }
  353: sub insert_displaytitle   { return '<displaytitle />'; }
  354: sub insert_hintpart {
  355:   return '
  356: <hintpart on="default">
  357:     <startouttext/>
  358:     <endouttext />
  359: </hintpart>';
  360: }
  361: 
  362: sub insert_numericalhint {
  363:   return '
  364: <numericalhint>
  365: </numericalhint>';
  366: }
  367: 
  368: sub insert_stringhint {
  369:   return '
  370: <stringhint>
  371: </stringhint>';
  372: }
  373: 
  374: sub insert_formulahint {
  375:   return '
  376: <formulahint>
  377: </formulahint>';
  378: }
  379: 
  380: sub insert_radiobuttonhint {
  381:   return '
  382: <radiobuttonhint>
  383: </radiobuttonhint>';
  384: }
  385: 
  386: sub insert_startouttext {
  387:   return "<startouttext />\n<endouttext />";
  388: }
  389: 
  390: sub insert_script {
  391:   return "\n<script type=\"loncapa/perl\">\n</script>";
  392: }
  393: 
  394: sub textarea_sizes {
  395:   my ($data)=@_;
  396:   my $count=0;
  397:   my $maxlength=-1;
  398:   foreach (split ("\n", $$data)) { $count++;
  399: 	if (length($_) > $maxlength) { $maxlength = length($_); }
  400:       }
  401:   my $rows = $count;
  402:   my $cols = $maxlength;
  403:   return ($rows,$cols);
  404: }
  405: 
  406: sub editline {
  407:     my ($tag,$data,$description,$size)=@_;
  408:     $data=&HTML::Entities::encode($data);
  409:     if ($description) { $description="<br />".$description."<br />"; }
  410:     my $result = <<"END";
  411: $description
  412: <input type="text" name="homework_edit_$Apache::lonxml::curdepth" 
  413:        value="$data" size="$size" />
  414: END
  415:     return $result;
  416: }
  417: 
  418: sub editfield {
  419:   my ($tag,$data,$description,$minwidth,$minheight)=@_;
  420: 
  421:   my ($rows,$cols)=&textarea_sizes(\$data);
  422:   if ($cols > 80) { $cols = 80; }
  423:   if ($cols < $minwidth ) { $cols = $minwidth; }
  424:   if ($rows < $minheight) { $rows = $minheight; }
  425:   if ($description) { $description="<br />".$description."<br />"; }
  426:   return $description."\n".'&nbsp;&nbsp;&nbsp;<textarea rows="'.$rows.
  427:     '" cols="'.$cols.'" name="homework_edit_'.$Apache::lonxml::curdepth.'">'.
  428:       &HTML::Entities::encode($data).'</textarea>'."\n";
  429: }
  430: 
  431: sub modifiedfield {
  432:   my ($token) = @_;
  433:   my $result;
  434: #  foreach my $envkey (sort keys %ENV) {
  435: #    &Apache::lonxml::debug("$envkey ---- $ENV{$envkey}");
  436: #  }
  437: #  &Apache::lonxml::debug("I want homework_edit_$Apache::lonxml::curdepth");
  438: #  &Apache::lonxml::debug($ENV{"form.homework_edit_$Apache::lonxml::curdepth"});
  439:   $result=$ENV{"form.homework_edit_$Apache::lonxml::curdepth"};
  440:   return $result;
  441: }
  442: 
  443: # Returns a 1 if the token has been modified and you should rebuild the tag
  444: # side-effects, will modify the $token if new values are found
  445: sub get_new_args {
  446:   my ($token,$parstack,$safeeval,@args)=@_;
  447:   my $rebuild=0;
  448:   foreach my $arg (@args) {
  449:     #just want the string that it was set to
  450:     my $value=$token->[2]->{$arg};
  451:     my $element=&html_element_name($arg);
  452:     my $newvalue=$ENV{"form.$element"};
  453:     &Apache::lonxml::debug(" for:$arg: cur is :$value: new is :$newvalue:");
  454:     if ($value ne $newvalue) {
  455:       $token->[2]->{$arg}=$newvalue;
  456:       $rebuild=1;
  457:     }
  458:   }
  459:   return $rebuild;
  460: }
  461: 
  462: # looks for /> on start tags
  463: sub rebuild_tag {
  464:   my ($token) = @_;
  465:   my $result;
  466:   if ($token->[0] eq 'S') {
  467:     $result = '<'.$token->[1];
  468:     while (my ($key,$val)= each(%{$token->[2]})) {
  469:       $val=~s:^\s+|\s+$::g;
  470:       $val=~s:"::g; #"
  471:       &Apache::lonxml::debug("setting :$key: to  :$val:");
  472:       $result.=' '.$key.'="'.$val.'"';
  473:     }
  474:     if ($token->[4] =~ m:/>$:) {
  475:       $result.=' />';
  476:     } else {
  477:       $result.='>';
  478:     }
  479:   } elsif ( $token->[0] eq 'E' ) {
  480:     $result = '</'.$token->[1].'>';
  481:   }
  482:   return $result;
  483: }
  484: 
  485: sub html_element_name {
  486:     my ($name) = @_;
  487:     return $name.'_'.$Apache::lonxml::curdepth;
  488: }
  489: 
  490: sub hidden_arg {
  491:     my ($name,$token) = @_;
  492:     my $result;
  493:     my $arg=$token->[2]{$name};
  494:     $result='<input name="'.&html_element_name($name).
  495: 	'" type="hidden" value="'.$arg.'" />';
  496:     return $result;
  497: }
  498: 
  499: sub text_arg {
  500:   my ($description,$name,$token,$size) = @_;
  501:   my $result;
  502:   if (!defined $size) { $size=20; }
  503:   my $arg=$token->[2]{$name};
  504:   $result=$description.'&nbsp;<input name="'.&html_element_name($name).
  505:     '" type="text" value="'.$arg.'" size="'.$size.'" />';
  506:   return $result;
  507: }
  508: 
  509: sub select_arg {
  510:     my ($description,$name,$list,$token) = @_;
  511:     my $result;
  512:     my $optionlist="";
  513:     my $selected=$token->[2]{$name};
  514:     foreach my $option (@$list) {
  515: 	my $value;
  516: 	if ( ref($option) eq 'ARRAY') {
  517: 	    $value='value="'.$$option[0].'"';
  518: 	    $option=$$option[1];
  519: 	} else {
  520: 	    $value='value="'.$option.'"';
  521: 	}
  522: 	if ( $selected eq $option ) {
  523: 	    $optionlist.="<option $value selected=\"on\">$option</option>\n";
  524: 	} else {
  525: 	    $optionlist.="<option $value >$option</option>\n";
  526: 	}
  527:     }
  528:     $result.=$description.'&nbsp;<select name="'.&html_element_name($name).
  529:         '">
  530:        '.$optionlist.'
  531:       </select>';
  532:     return $result;
  533: }
  534: 
  535: sub select_or_text_arg {
  536:     my ($description,$name,$list,$token,$size) = @_;
  537:     my $result;
  538:     my $optionlist="";
  539:     my $found=0;
  540:     my $selected=$token->[2]{$name};
  541:     foreach my $option (@$list) {
  542: 	my $value;
  543: 	if ( ref($option) eq 'ARRAY') {
  544: 	    $value='value="'.$$option[0].'"';
  545: 	    $option=$$option[1];
  546: 	} else {
  547: 	    $value='value="'.$option.'"';
  548: 	}
  549: 	if ( $selected eq $option ) {
  550: 	    $optionlist.="<option $value selected=\"on\">$option</option>\n";
  551: 	    $found=1;
  552: 	} else {
  553: 	    $optionlist.="<option $value>$option</option>\n";
  554: 	}
  555:     }
  556:     $optionlist.="<option value=\"TYPEDINVALUE\">Type in value</option>\n";
  557:     if (($found) || (!$selected)) {
  558: 	$result.=$description.'&nbsp;<select name="'.&html_element_name($name)
  559:             .'">
  560:        '.$optionlist.'
  561:       </select>';
  562:     } else {
  563: 	$result.=&text_arg($description,$name,$token,$size);
  564:     }
  565:     return $result;
  566: }
  567: 
  568: #----------------------------------------------------- browse
  569: sub browse {
  570:     # insert a link to call up the filesystem browser (lonindexer)
  571:     my ($id, $mode) = @_;
  572:     my $form    = 'lonhomework';
  573:     my $element;
  574:     if (! defined($mode) || $mode eq 'attribute') {
  575:         $element = &Apache::lonnet::escape("$Apache::lonxml::curdepth.$id");
  576:     } elsif ($mode eq 'textnode') {  # for data between <tag> ... </tag>
  577:         $element = &Apache::lonnet::escape('homework_edit_'.
  578:                                            $Apache::lonxml::curdepth);
  579:     }
  580:     my $result = <<"ENDBUTTON";
  581: <a href=\"javascript:openbrowser('$form','$element')\"\>Browse</a>
  582: ENDBUTTON
  583:     return $result;
  584: }
  585: 
  586: #----------------------------------------------------- browse
  587: sub search {
  588:     # insert a link to call up the filesystem browser (lonindexer)
  589:     $_ = shift;
  590:     my $form    = 'lonhomework';
  591:     my $element = &Apache::lonnet::escape("$Apache::lonxml::curdepth.$_");
  592:     my $result = <<"ENDBUTTON";
  593: <a href=\"javascript:opensearcher('$form','$element')\"\>Search</a>
  594: ENDBUTTON
  595:     return $result;
  596: }
  597: 
  598: 
  599: 1;
  600: __END__
  601: 
  602: =head1 NAME
  603: 
  604: Apache::edit - edit mode helpers
  605: 
  606: =head1 SYNOPSIS
  607: 
  608: Invoked by many homework and xml related modules.
  609: 
  610:  &Apache::edit::SUBROUTINENAME(ARGUMENTS);
  611: 
  612: =head1 INTRODUCTION
  613: 
  614: This module outputs HTML syntax helpful for the rendering of edit
  615: mode interfaces.
  616: 
  617: This is part of the LearningOnline Network with CAPA project
  618: described at http://www.lon-capa.org.
  619: 
  620: =head1 HANDLER SUBROUTINE
  621: 
  622: There is no handler subroutine.
  623: 
  624: =head1 OTHER SUBROUTINES
  625: 
  626: =over 4
  627: 
  628: =item *
  629: 
  630: initialize_edit() : initialize edit (set colordepth to zero)
  631: 
  632: =item *
  633: 
  634: tag_start($target,$token,$description) : provide deletion and insertion lists
  635: for the manipulation of a start tag; return a scalar string
  636: 
  637: =item *
  638: 
  639: tag_end($target,$token,$description) : ending syntax corresponding to
  640: &tag_start. return a scalar string.
  641: 
  642: =item *
  643: 
  644: start_table($token) : start table; update colordepth; return scalar string.
  645: 
  646: =item *
  647: 
  648: end_table() : reduce color depth; end table; return scalar string
  649: 
  650: =item *
  651: 
  652: start_spanning_row() : start a new table row spanning the 'edit' environment.
  653: 
  654: =item *
  655: 
  656: start_row() : start a new table row and element. 
  657: 
  658: =item *
  659: 
  660: end_row() : end current table element and row.
  661: 
  662: =item *
  663: 
  664: movebuttons($target,$token) : move-up and move-down buttons; return scalar
  665: string
  666: 
  667: =item *
  668: 
  669: deletelist($target,$token) : provide a yes option in an HTML select element;
  670: return scalar string
  671: 
  672: =item *
  673: 
  674: handle_delete($space,$target,$token,$tagstack,$parstack,$parser,$safeeval,
  675: $style) : respond to a user delete request by passing relevant stack
  676: and array information to various rendering functions; return a scalar string
  677: 
  678: =item *
  679: 
  680: get_insert_list($token) : provide an insertion list based on possibilities
  681: from lonxml; return a scalar string
  682: 
  683: =item *
  684: 
  685: insertlist($target,$token) : api that uses get_insert_list;
  686: return a scalar string
  687: 
  688: =item *
  689: 
  690: handleinsert($token) : provide an insertion list based on possibilities
  691: from lonxml; return a scalar string
  692: 
  693: =item *
  694: 
  695: get_insert_list($token) : provide an insertion list based on possibilities
  696: from lonxml; return a scalar string
  697: 
  698: =item *
  699: browse($elementname) : provide a link which will open up the filesystem
  700: browser (lonindexer) and, once a file is selected, place the result in
  701: the form element $elementname.
  702: 
  703: =item *
  704: search($elementname) : provide a link which will open up the filesystem
  705: searcher (lonsearchcat) and, once a file is selected, place the result in
  706: the form element $elementname.
  707: 
  708: =item *
  709: editline(tag,data,description,size): Provide a <input type="text" ../> for
  710: single-line text entry.  This is to be used for text enclosed by tags, not
  711: arguements/parameters associated with a tag.
  712: 
  713: =back
  714: 
  715: incomplete...
  716: 
  717: =cut

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