Files
moodle/mod/data/field/latlong/mod.html
T
Damyon Wiese b89cca197e MDL-5583 mod_data: Add required fields
This is implemented for most fields but not all. The reason is that there are
some fields for which this does not make sense because no entry is a valid entry.

The supported fields are:
    checkbox
    file
    latlong
    menu
    number
    picture
    radio
    text
    textarea
    url

The unsupported fields are:
    date
    multimenu
2015-03-06 09:55:49 +08:00

53 lines
3.1 KiB
HTML

<table width="100%" cellpadding="5">
<tr>
<td class="c0"><label for="name"><?php echo get_string('fieldname', 'data'); ?></label></td>
<td class="c1"><input class="fieldname" type="text" name="name" id="name" value="<?php p($this->field->name); ?>" /></td>
</tr>
<tr>
<td class="c0"><label for="description"><?php echo get_string('fielddescription', 'data'); ?></label></td>
<td class="c1"><input class="fielddescription" type="text" name="description" id="description" value="<?php p ($this->field->description);?>" /></td>
</tr>
<tr>
<td class="c0"><label for="required"><?php echo get_string('requiredfield', 'data'); ?></label></td>
<td class="c1"><input class="requiredfield" type="checkbox" name="required" id="required" <?php p($this->field->required?"checked=\"checked\"":""); ?>/></td>
</tr>
<tr>
<td class="c0"><label for="param1"><?php echo get_string('latlonglinkservicesdisplayed', 'data'); ?></label></td>
<td class="c1">
<select class="linkservicesdisplayed" name="param1[]" id="param1" multiple="multiple" size="<?php p(sizeof($this->linkoutservices)); ?>">
<?php
$serviceschosen = explode(',', htmlspecialchars($this->field->param1));
foreach($this->linkoutservices as $servicename=>$serviceurl) {
$servicename = htmlspecialchars($servicename);
echo "\n <option" . (array_search($servicename, $serviceschosen)===false ? '' : ' selected="selected"') . ">$servicename</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td class="c0"><label for="param2"><?php echo get_string('latlongkmllabelling', 'data'); ?></label></td>
<td class="c1">
<select class="kmllabelling" name="param2" id="param2">
<option value="-1"<?php if($this->field->param2==-1) echo ' selected="selected"' ?>><?php echo get_string('entry', 'data') ?> #</option>
<option value="-2"<?php if($this->field->param2==-2) echo ' selected="selected"' ?>><?php echo get_string('latitude', 'data').'/'.get_string('longitude', 'data') ?></option>
<?php
// Fetch all "suitable" other fields that exist for this database
$textfields = $DB->get_records('data_fields', array('dataid'=>$this->data->id, 'type'=>'text'));
if(sizeof($textfields)>0) {
echo '<optgroup label="'.get_string('latlongotherfields', 'data').':">';
foreach($textfields as $textfield) {
echo "<option value='$textfield->id'".($this->field->param2==$textfield->id ? ' selected="selected"' : '').">$textfield->name</option>";
}
echo '</optgroup>';
}
?>
</select>
</td>
</tr>
<tr>
<td class="c0">&nbsp;</td>
<td class="c1"><?php if($this->field->id) {echo "<a href='./field/latlong/kml.php?d=".$this->data->id."&fieldid=".$this->field->id."'>" . get_string('latlongdownloadallhint', 'data') . "</a>"; } ?></td>
</tr>
</table>