Cleaning up xhtml markup. Code now validates for xhtml 1.0 transitional.

This commit is contained in:
vyshane 2006-02-20 02:15:45 +00:00
parent 7541b03f28
commit af25f45e1a
21 changed files with 224 additions and 135 deletions

View file

@ -80,8 +80,8 @@ class data_field_checkbox extends data_field_base {
foreach (explode("\n", $field->param1) as $checkbox) {
$checkbox = ltrim(rtrim($checkbox));
$str .= '<input type="checkbox" name="field_' . $field->id . '[]" id="field_';
$str .= $field->id . '[]" value="' . $checkbox . '" ';
$str .= '<input type="checkbox" name="field_' . $field->id . '[]" ';
$str .= 'value="' . $checkbox . '" ';
if (array_search($checkbox, $content) !== false) {
// Selected by user.

View file

@ -1,11 +1,11 @@
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td span="2">
<td colspan="2">
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden">
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
<?php echo ($this->name()); ?>
</td>
</tr>
@ -19,13 +19,13 @@
</tr>
<tr>
<td valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1"><?php if($field->param1) {echo $field->param1;} ?></textarea></td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($field->param1) {echo $field->param1;} ?></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" \>
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
</td>
</tr>
</table>

View file

@ -97,7 +97,7 @@ class data_field_file extends data_field_base {// extends
}
*/
$str .= '<div title="' . $field->description . '">';
$str .= '<input type="hidden" name ="field_'.$field->id.'_0" id="field_'.$field->id.'"_0 value="fakevalue" />';
$str .= '<input type="hidden" name ="field_'.$field->id.'_0" value="fakevalue" />';
$str .= get_string('file','data'). ': <input type="file" name ="field_'.$field->id.'" id="field_'.$field->id.'" title="'.$field->description.'" /><br />';
$str .= get_string('optionalfilename','data').': <input type="text" name="field_'
.$field->id.'_1" id="field_'.$field->id.'_1" value="'.$displayname.'" /><br />';
@ -108,7 +108,7 @@ class data_field_file extends data_field_base {// extends
if ($rid and isset($content)){
require_once($CFG->libdir.'/filelib.php');
$icon = mimeinfo('icon', $src);
$str .= '<img align="absmiddle" src="'.$CFG->pixpath.'/f/'.$icon.'" height="16" width="16" alt="'.$icon.'" />&nbsp;'.
$str .= '<img src="'.$CFG->pixpath.'/f/'.$icon.'" height="16" width="16" alt="'.$icon.'" />&nbsp;'.
'<a href="'.$source.'/'.$src.'" >'.$name.'</a>';
}
return $str;
@ -143,7 +143,7 @@ class data_field_file extends data_field_base {// extends
require_once($CFG->libdir.'/filelib.php');
$icon = mimeinfo('icon', $src);
$str = '<img align="absmiddle" src="'.$CFG->pixpath.'/f/'.$icon.'" height="16" width="16" alt="'.$icon.'" />&nbsp;'.
$str = '<img src="'.$CFG->pixpath.'/f/'.$icon.'" height="16" width="16" alt="'.$icon.'" />&nbsp;'.
'<a href="'.$source.'/'.$src.'" >'.$name.'</a>';
return $str;
}

View file

@ -1,14 +1,33 @@
<table width="100%"><tr><td span="2">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<?php echo ($this->name()); ?></td></tr>
<tr><td><Name><?php echo get_string('fieldname', 'data'); ?>:</td><td><input style="width:300px;" type="text" name="name" id="name" value = "<?php echo($field->name); ?>" /></td></tr>
<tr><td><?php echo get_string('fielddescription', 'data'); ?>:</td><td><input style="width:300px;" type="text" name="description" id="description" value = "<? echo ($field->description);?>" /></td></tr>
<tr><td></td><td><input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" \>
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden"></td>
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td colspan="2">
<?php echo ($this->name()); ?>
</td>
</tr>
<tr>
<td>
<?php echo get_string('fieldname', 'data'); ?>:
</td>
<td>
<input style="width:300px;" type="text" name="name" id="name" value = "<?php echo($field->name); ?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('fielddescription', 'data'); ?>:</td><td><input style="width:300px;" type="text" name="description" id="description" value = "<? echo ($field->description);?>" />
</td>
</tr>
<tr>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
</td>
</tr>
</table>
</form>
</td></tr></table>

View file

@ -54,27 +54,25 @@ class data_field_menu extends data_field_base {
notify("that is not a valid field id!");
exit;
}
$content = '';
//look for that record and pull it out
if ($rid) {
$datacontent = get_record('data_content','fieldid',$id,'recordid',$rid);
if (isset($datacontent->content)) {
$content = $datacontent->content;
}else {
$content = '';
}
}
$str .= '<table><tr><td>';
$str = '<div title="'.$field->description.'"><table><tr><td>';
/*
if ($field->description) {
$str .= '<img src="'.$CFG->pixpath.'/help.gif" alt="'.$field->description.'" title="'.$field->description.'">&nbsp;';
}
*/
$str .= '<div title="'.$field->description.'">';
$str .= get_string('menu','data').': </td><td>';
$str .= '<select name="field_'.$field->id.' id="field_'.$field->id.'>';
$str .= '<select name="field_'.$field->id.'" id="field_'.$field->id.'">';
$str .= '<option value="">' . get_string('menuchoose', 'data') . '</option>';
foreach (explode("\n",$field->param1) as $option) {
@ -84,8 +82,7 @@ class data_field_menu extends data_field_base {
$str.='<option value="'.ltrim(rtrim($option)).'">'.ltrim(rtrim($option)).'</option>';
}
}
$str .= '</div>';
$str .= '</select></td></tr></table>';
$str .= '</select></td></tr></table></div>';
return $str;
}

View file

@ -1,16 +1,16 @@
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td span="2">
<td colspan="2">
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden">
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
<?php echo ($this->name()); ?>
</td>
</tr>
<tr>
<td><Name><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value = "<?php echo($field->name); ?>" /></td>
</tr>
<tr>
@ -19,13 +19,13 @@
</tr>
<tr>
<td valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1"><?php if($field->param1) {echo $field->param1;} ?></textarea></td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($field->param1) {echo $field->param1;} ?></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" \>
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
</td>
</tr>
</table>

View file

@ -1,16 +1,16 @@
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td span="2">
<td colspan="2">
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden">
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
<?php echo ($this->name()); ?>
</td>
</tr>
<tr>
<td><Name><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value="<?php echo($field->name); ?>" /></td>
</tr>
<tr>
@ -19,13 +19,13 @@
</tr>
<tr>
<td valign="top"><?php echo get_string('fieldoptions', 'data'); ?></td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1"><?php if($field->param1) {echo $field->param1;} ?></textarea></td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($field->param1) {echo $field->param1;} ?></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" \>
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
</td>
</tr>
</table>

View file

@ -95,7 +95,7 @@ class data_field_picture extends data_field_file {// extends
}
*/
$str .= '<div title="'.$field->description.'">';
$str .= '<input type="hidden" name ="field_'.$field->id.'_0" id="field_'.$field->id.'"_0 value="fakevalue" />';
$str .= '<input type="hidden" name ="field_'.$field->id.'_0" id="field_'.$field->id.'_0" value="fakevalue" />';
$str .= get_string('picture','data'). ': <input type="file" name ="field_'.$field->id.'" id="field_'.$field->id.'" /><br />';
$str .= get_string('optionaldescription','data') .': <input type="text" name="field_'
.$field->id.'_1" id="field_'.$field->id.'_1" value="'.$des.'" /><br />';
@ -135,7 +135,7 @@ class data_field_picture extends data_field_file {// extends
if ($template == 'listtemplate') {
$width = $field->param4 ? ' width="'.$field->param4.'" ':' ';
$height = $field->param5 ? ' height="'.$field->param5.'" ':' ';
$str = '<a href="view.php?d='.$field->dataid.'&rid='.$recordid.'"><img '.$width.$height.' src="'.$source.'/'.$src.'" alt="'.$alt.'" title="'.$title.'" border="0" /></a>';
$str = '<a href="view.php?d='.$field->dataid.'&amp;rid='.$recordid.'"><img '.$width.$height.' src="'.$source.'/'.$src.'" alt="'.$alt.'" title="'.$title.'" border="0" /></a>';
} else {
$width = $field->param1 ? ' width="'.$field->param1.'" ':' ';
$height = $field->param2 ? ' height="'.$field->param2.'" ':' ';

View file

@ -1,25 +1,73 @@
<table width="100%"><tr><td span="2">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<?php echo ($this->name()); ?></td></tr>
<tr><td><?php echo get_string('fieldname', 'data');?>:</td><td><input style="width:300px;" type="text" name="name" id="name" value = "<?php echo($field->name); ?>" /></td></tr>
<tr><td><?php echo get_string('fielddescription', 'data');?>:</td><td><input style="width:300px;" type="text" name="description" id="description" value = "<? echo ($field->description);?>" /></td></tr>
<tr><td><?php echo get_string('fieldwidthsingleview', 'data');?>:</td><td><input style="width:70px;" type="text" name="param1" id="param1" value = "<? if (!empty($field->param1)) echo $field->param1; ?>" />
<tr><td><?php echo get_string('fieldheightsingleview', 'data');?>:</td><td><input style="width:70px;" type="text" name="param2" id="param2" value = "<? if (!empty($field->param2)) echo $field->param2; ?>" />
<tr><td><?php echo get_string('fieldwidthlistview', 'data');?>:</td><td><input style="width:70px;" type="text" name="param4" id="param4" value = "<? if (!empty($field->param4)) echo $field->param4; ?>" />
<tr><td><?php echo get_string('fieldheightlistview', 'data');?>:</td><td><input style="width:70px;" type="text" name="param5" id="param5" value = "<? if (!empty($field->param5)) echo $field->param5; ?>" />
<tr><td><?php echo get_string('maxsize', 'data'); ?>:</td><td>
<?php
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
choose_from_menu ($choices, "param3", $field->param3, "");
?>
</td>
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td colspan="2">
<?php echo ($this->name()); ?>
</td>
</tr>
<tr>
<td>
<?php echo get_string('fieldname', 'data');?>:</td><td><input style="width:300px;" type="text" name="name" id="name" value = "<?php echo($field->name); ?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('fielddescription', 'data');?>:
</td>
<td>
<input style="width:300px;" type="text" name="description" id="description" value = "<? echo ($field->description);?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('fieldwidthsingleview', 'data');?>:
</td>
<td>
<input style="width:70px;" type="text" name="param1" id="param1" value = "<? if (!empty($field->param1)) echo $field->param1; ?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('fieldheightsingleview', 'data');?>:
</td>
<td>
<input style="width:70px;" type="text" name="param2" id="param2" value = "<? if (!empty($field->param2)) echo $field->param2; ?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('fieldwidthlistview', 'data');?>:</td><td><input style="width:70px;" type="text" name="param4" id="param4" value = "<? if (!empty($field->param4)) echo $field->param4; ?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('fieldheightlistview', 'data');?>:
</td>
<td>
<input style="width:70px;" type="text" name="param5" id="param5" value = "<? if (!empty($field->param5)) echo $field->param5; ?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('maxsize', 'data'); ?>:
</td>
<td>
<?php
$choices = get_max_upload_sizes($CFG->maxbytes, $course->maxbytes);
choose_from_menu ($choices, "param3", $field->param3, "");
?>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
</td>
</tr>
<tr><td></td><td><input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden"></td>
</table>
</form>
</td></tr></table>

View file

@ -80,8 +80,8 @@ class data_field_radiobutton extends data_field_base {
foreach (explode("\n",$field->param1) as $radio) {
$radio = ltrim(rtrim($radio));
$str .= '<input type="radio" name="field_' . $field->id . '" id="field_';
$str .= $field->id . '" value="' . $radio . '" ';
$str .= '<input type="radio" name="field_' . $field->id . '" ';
$str .= 'value="' . $radio . '" ';
if ($content == $radio) {
// Selected by user.

View file

@ -1,11 +1,11 @@
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td span="2">
<td colspan="2">
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden">
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
<?php echo ($this->name()); ?>
</td>
</tr>
@ -19,13 +19,13 @@
</tr>
<tr>
<td valign="top"><?php echo get_string('fieldoptions', 'data'); ?>:</td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1"><?php if($field->param1) {echo $field->param1;} ?></textarea></td>
<td><textarea style="width:300px; height:150px;" name="param1" id="param1" cols="80" rows="10"><?php if($field->param1) {echo $field->param1;} ?></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" \>
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
</td>
</tr>
</table>

View file

@ -1,11 +1,11 @@
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td span="2">
<td colspan="2">
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden">
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
<?php echo ($this->name()); ?>
</td>
</tr>
@ -24,8 +24,8 @@
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" \>
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
</td>
</tr>
</table>

View file

@ -1,16 +1,16 @@
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td span="2">
<td colspan="2">
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden">
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
<?php echo ($this->name()); ?>
</td>
</tr>
<tr>
<td><Name><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><?php echo get_string('fieldname', 'data'); ?>:</td>
<td><input style="width:300px;" type="text" name="name" id="name" value="<?php echo($field->name); ?>" /></td>
</tr>
<tr>
@ -28,8 +28,8 @@
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" \>
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
</td>
</tr>
</table>

View file

@ -71,13 +71,13 @@ class data_field_url extends data_field_base {// extends
$url = empty($contents[0])? 'http://':$contents[0];
$text = empty($contents[1])? '':$contents[1];
$str = '<table><tr><td align="right">';
$str = '<div title="'.$field->description.'">';
$str .= '<table><tr><td align="right">';
/*
if ($field->description){
$str .= '<img src="'.$CFG->pixpath.'/help.gif" alt="'.$field->description.'" title="'.$field->description.'">&nbsp;';
}
*/
$str .= '<div title="'.$field->description.'">';
$str .= get_string('url','data').':</td><td><input type="text" name="field_'.$field->id.'_0" id="field_'.$field->id.'_0" value="'.$url.'" /></td></tr>';
$str .= '<tr><td align="right">'.get_string('text','data').':</td><td><input type="text" name="field_'.$field->id.'_1" id="field_'.$field->id.'_1" value="'.$text.'" /></td></tr>';
$str .= '</table>';

View file

@ -1,14 +1,36 @@
<table width="100%"><tr><td span="2">
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="POST">
<?php echo ($this->name()); ?></td></tr>
<tr><td><Name><?php echo get_string('fieldname', 'data'); ?>:</td><td><input style="width:350px;" type="text" name="name" id="name" value = "<?php echo($field->name); ?>" /></td></tr>
<tr><td><?php echo get_string('fielddescription', 'data'); ?>:</td><td><input style="width:350px;" type="text" name="description" id="description" value = "<? echo ($field->description);?>" /></td></tr>
<tr><td></td><td><input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" \>
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden"></td>
</form>
</td></tr></table>
<form name="fieldsubform" action="<?php echo $CFG->wwwroot; ?>/mod/data/fields.php?d=<?php echo ($field->dataid); ?>" method="post">
<table width="100%">
<tr>
<td colspan="2">
<?php echo ($this->name()); ?>
</td>
</tr>
<tr>
<td>
<?php echo get_string('fieldname', 'data'); ?>:
</td>
<td>
<input style="width:350px;" type="text" name="name" id="name" value = "<?php echo($field->name); ?>" />
</td>
</tr>
<tr>
<td>
<?php echo get_string('fielddescription', 'data'); ?>:
</td>
<td>
<input style="width:350px;" type="text" name="description" id="description" value = "<? echo ($field->description);?>" />
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="submit" value="<?php if ($newfield) {echo get_string('add');} else {echo get_string('save','data');} ?>" />
<input type="hidden" name="fid" value="<?php echo ($field->id); ?>" />
<input type="hidden" name="mode" value="<?php if ($newfield) {echo 'add';} else {echo 'update';} ?>" />
<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
<input type="submit" value="<?php echo get_string('cancel'); ?>" onclick="document.fieldsubform.mode.value='void';" />
<input name="sesskey" value="<?php echo sesskey(); ?>" type="hidden" />
</td>
</tr>
</table>
</form>