MDL-7905 Add new available tag for element id for in database mod
This commit is contained in:
@@ -88,6 +88,7 @@ $string['fieldmappings'] = 'Field Mappings';
|
||||
$string['fieldname'] = 'Field name';
|
||||
$string['fieldoptions'] = 'Options (one per line)';
|
||||
$string['fields'] = 'Fields';
|
||||
$string['fieldids'] = 'Field ids';
|
||||
$string['fieldupdated'] = 'Field updated';
|
||||
$string['fieldwidth'] = 'Width';
|
||||
$string['fieldwidthlistview'] = 'Width in list view';
|
||||
|
||||
@@ -276,6 +276,8 @@
|
||||
$field = data_get_field($eachfield, $data);
|
||||
$patterns[]="[[".$field->field->name."]]";
|
||||
$replacements[] = $field->display_add_field($rid);
|
||||
$patterns[]="[[".$field->field->name."#id]]";
|
||||
$replacements[] = 'field_'.$field->field->id;
|
||||
}
|
||||
$newtext = str_ireplace($patterns, $replacements, $data->{$mode});
|
||||
|
||||
|
||||
@@ -204,6 +204,14 @@
|
||||
echo '<option value="[['.$field->name.']]" title="'.$field->description.'">'.$field->name.' - [['.$field->name.']]</option>';
|
||||
}
|
||||
echo '</optgroup>';
|
||||
|
||||
if ($mode == 'addtemplate') {
|
||||
echo '<optgroup label="'.get_string('fieldids', 'data').'">';
|
||||
foreach ($fields as $field) {
|
||||
echo '<option value="[['.$field->name.'#id]]" title="'.$field->description.' id">'.$field->name.' id - [['.$field->name.'#id]]</option>';
|
||||
}
|
||||
echo '</optgroup>';
|
||||
}
|
||||
|
||||
// Print special tags. fix for MDL-7031
|
||||
if ($mode != 'addtemplate') {
|
||||
|
||||
Reference in New Issue
Block a user