';
if ($mode != 'csstemplate' and $mode != 'jstemplate') {
// Add all the available fields for this data.
echo '';
echo $OUTPUT->help_icon('availabletags', 'data');
echo ' ';
echo '';
echo '';
echo ' ';
echo '
';
echo '';
echo '
';
if ($usehtmleditor) {
$switchlink = new moodle_url($PAGE->url, ['useeditor' => false]);
echo html_writer::link($switchlink, get_string('editordisable', 'data'));
} else {
$switchlink = new moodle_url($PAGE->url, ['useeditor' => true]);
echo html_writer::link($switchlink, get_string('editorenable', 'data'), [
'id' => 'enabletemplateeditor',
]);
$PAGE->requires->event_handler('#enabletemplateeditor', 'click', 'M.util.show_confirm_dialog', [
'message' => get_string('enabletemplateeditorcheck', 'data'),
]);
}
} else {
echo '
';
echo '';
}
echo ' | ';
echo '';
if ($mode == 'listtemplate'){
echo '';
} else {
echo '';
}
$field = 'template';
$editor->set_text($data->{$mode});
$editor->use_editor($field, $options);
echo ' ';
echo ' ';
echo ' | ';
echo '
';
if ($mode == 'listtemplate'){
echo '