Skip to content

Commit

Permalink
Merge branch 'MDL-77015-402' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_402_STABLE
  • Loading branch information
HuongNV13 committed Apr 12, 2024
2 parents efa2c58 + f2c3a62 commit a1eec36
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion mod/data/classes/template.php
Expand Up @@ -993,7 +993,7 @@ private function get_field_input(
$errors .= $renderer->notification(get_string(
'missingfieldtype',
'data',
(object)['name' => $field->field->name]
(object)['name' => s($field->field->name)]
));
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion mod/data/export_form.php
Expand Up @@ -71,7 +71,7 @@ function definition() {
$exportfields = [];
$unsupportedfields = [];
foreach ($this->_datafields as $field) {
$label = get_string('fieldnametype', 'data', (object)['name' => $field->field->name, 'type' => $field->name()]);
$label = get_string('fieldnametype', 'data', (object)['name' => s($field->field->name), 'type' => $field->name()]);
if ($field->text_export_supported()) {
$numfieldsthatcanbeselected++;
$exportfields[] = $mform->createElement('advcheckbox', 'field_' . $field->field->id, '', $label,
Expand Down
8 changes: 4 additions & 4 deletions mod/data/field.php
Expand Up @@ -240,7 +240,7 @@
} else {
$fieldtypename = $field->name();
}
echo $OUTPUT->confirm('<strong>' . $fieldtypename . ': ' . $field->field->name . '</strong><br /><br />' .
echo $OUTPUT->confirm('<strong>' . $fieldtypename . ': ' . s($field->field->name) . '</strong><br /><br />' .
get_string('confirmdeletefield', 'data'),
'field.php?d=' . $data->id . '&mode=delete&fid=' . $fid . '&confirm=1',
'field.php?d=' . $data->id,
Expand Down Expand Up @@ -410,7 +410,7 @@
$actionmenutemplate = $actionmenu->export_for_template($OUTPUT);

$table->data[] = [
$field->field->name,
s($field->field->name),
$fieltypedata,
$field->field->required ? get_string('yes') : get_string('no'),
shorten_text($field->field->description, 30),
Expand All @@ -435,9 +435,9 @@
echo '<optgroup label="'.get_string('fields', 'data').'">';
foreach ($fields as $field) {
if ($data->defaultsort == $field->id) {
echo '<option value="'.$field->id.'" selected="selected">'.$field->name.'</option>';
echo '<option value="'.$field->id.'" selected="selected">'.s($field->name).'</option>';
} else {
echo '<option value="'.$field->id.'">'.$field->name.'</option>';
echo '<option value="'.$field->id.'">'.s($field->name).'</option>';
}
}
echo '</optgroup>';
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/checkbox/field.class.php
Expand Up @@ -66,7 +66,7 @@ function display_add_field($recordid = 0, $formdata = null) {
}

$str = '<div title="' . s($this->field->description) . '">';
$str .= '<fieldset><legend><span class="accesshide">'.$this->field->name;
$str .= '<fieldset><legend><span class="accesshide">'.s($this->field->name);
if ($this->field->required) {
$str .= '$nbsp;' . get_string('requiredelement', 'form');
$str .= '</span></legend>';
Expand Down
4 changes: 2 additions & 2 deletions mod/data/field/file/field.class.php
Expand Up @@ -70,7 +70,7 @@ function display_add_field($recordid = 0, $formdata = null) {

// database entry label
$html = '<div title="' . s($this->field->description) . '">';
$html .= '<fieldset><legend><span class="accesshide">'.$this->field->name;
$html .= '<fieldset><legend><span class="accesshide">'.s($this->field->name);

if ($this->field->required) {
$html .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>';
Expand Down Expand Up @@ -105,7 +105,7 @@ function display_add_field($recordid = 0, $formdata = null) {
}

function display_search_field($value = '') {
return '<label class="accesshide" for="f_' . $this->field->id . '">' . $this->field->name . '</label>' .
return '<label class="accesshide" for="f_' . $this->field->id . '">' . s($this->field->name) . '</label>' .
'<input type="text" size="16" id="f_'.$this->field->id.'" name="f_'.$this->field->id.'" ' .
'value="'.s($value).'" class="form-control"/>';
}
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/latlong/field.class.php
Expand Up @@ -77,7 +77,7 @@ function display_add_field($recordid = 0, $formdata = null) {
}
}
$str = '<div title="'.s($this->field->description).'">';
$str .= '<fieldset><legend><span class="accesshide">'.$this->field->name.'</span></legend>';
$str .= '<fieldset><legend><span class="accesshide">'.s($this->field->name).'</span></legend>';
$str .= '<table class="form-inline"><tr><td align="right">';
$classes = 'mod-data-input form-control-static';
$str .= '<label for="field_'.$this->field->id.'_0" class="' . $classes . '">' . get_string('latitude', 'data');
Expand Down
4 changes: 2 additions & 2 deletions mod/data/field/multimenu/field.class.php
Expand Up @@ -74,7 +74,7 @@ function display_add_field($recordid = 0, $formdata = null) {
$str .= '<input name="field_' . $this->field->id . '[xxx]" type="hidden" value="xxx"/>'; // hidden field - needed for empty selection

$str .= '<label for="field_' . $this->field->id . '">';
$str .= '<legend><span class="accesshide">' . $this->field->name;
$str .= '<legend><span class="accesshide">' . s($this->field->name);

if ($this->field->required) {
$str .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>';
Expand Down Expand Up @@ -119,7 +119,7 @@ function display_search_field($value = '') {

static $c = 0;

$str = '<label class="accesshide" for="f_' . $this->field->id . '">' . $this->field->name . '</label>';
$str = '<label class="accesshide" for="f_' . $this->field->id . '">' . s($this->field->name) . '</label>';
$str .= '<select id="f_'.$this->field->id.'" name="f_'.$this->field->id.'[]" multiple="multiple" class="form-control">';

// display only used options
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/picture/field.class.php
Expand Up @@ -87,7 +87,7 @@ function display_add_field($recordid = 0, $formdata = null) {
$itemid = file_get_unused_draft_itemid();
}
$str = '<div title="' . s($this->field->description) . '">';
$str .= '<fieldset><legend><span class="accesshide">'.$this->field->name;
$str .= '<fieldset><legend><span class="accesshide">'.s($this->field->name);

if ($this->field->required) {
$str .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>';
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/radiobutton/field.class.php
Expand Up @@ -69,7 +69,7 @@ function display_add_field($recordid = 0, $formdata = null) {
}

$str = '<div title="' . s($this->field->description) . '">';
$str .= '<fieldset><legend><span class="accesshide">' . $this->field->name;
$str .= '<fieldset><legend><span class="accesshide">' . s($this->field->name);

if ($this->field->required) {
$str .= '&nbsp;' . get_string('requiredelement', 'form') . '</span></legend>';
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/text/field.class.php
Expand Up @@ -50,7 +50,7 @@ public function get_data_content_preview(int $recordid): stdClass {
}

function display_search_field($value = '') {
return '<label class="accesshide" for="f_' . $this->field->id . '">' . $this->field->name.'</label>' .
return '<label class="accesshide" for="f_' . $this->field->id . '">' . s($this->field->name) . '</label>' .
'<input type="text" class="form-control" size="16" id="f_' . $this->field->id . '" ' .
'name="f_' . $this->field->id . '" value="' . s($value) . '" />';
}
Expand Down
2 changes: 1 addition & 1 deletion mod/data/field/textarea/field.class.php
Expand Up @@ -203,7 +203,7 @@ function display_add_field($recordid = 0, $formdata = null) {


function display_search_field($value = '') {
return '<label class="accesshide" for="f_' . $this->field->id . '">' . $this->field->name . '</label>' .
return '<label class="accesshide" for="f_' . $this->field->id . '">' . s($this->field->name) . '</label>' .
'<input type="text" size="16" id="f_' . $this->field->id . '" name="f_' . $this->field->id . '" ' .
'value="' . s($value) . '" class="form-control"/>';
}
Expand Down
6 changes: 3 additions & 3 deletions mod/data/lib.php
Expand Up @@ -380,7 +380,7 @@ function display_add_field($recordid=0, $formdata=null) {
}

$str = '<div title="' . s($this->field->description) . '">';
$str .= '<label for="field_'.$this->field->id.'"><span class="accesshide">'.$this->field->name.'</span>';
$str .= '<label for="field_'.$this->field->id.'"><span class="accesshide">'.s($this->field->name).'</span>';
if ($this->field->required) {
$image = $OUTPUT->pix_icon('req', get_string('requiredelement', 'form'));
$str .= html_writer::div($image, 'inline-req');
Expand Down Expand Up @@ -1713,9 +1713,9 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
echo '<optgroup label="'.get_string('fields', 'data').'">';
foreach ($fields as $field) {
if ($field->id == $sort) {
echo '<option value="'.$field->id.'" selected="selected">'.$field->name.'</option>';
echo '<option value="'.$field->id.'" selected="selected">'.s($field->name).'</option>';
} else {
echo '<option value="'.$field->id.'">'.$field->name.'</option>';
echo '<option value="'.$field->id.'">'.s($field->name).'</option>';
}
}
echo '</optgroup>';
Expand Down
Expand Up @@ -47,7 +47,7 @@
{{#fields}}
<div class="form-group col">
<div class="font-weight-bold mb-2">{{fieldname}}</div>
{{fieldcontent}}
{{{fieldcontent}}}
</div>
{{/fields}}

Expand Down
2 changes: 1 addition & 1 deletion mod/data/templates/defaulttemplate_listtemplate.mustache
Expand Up @@ -57,7 +57,7 @@
{{#fields}}
<div class="row my-3 align-items-start justify-content-start">
<div class="col-4 col-lg-3 font-weight-bold">{{fieldname}}</div>
<div class="col-8 col-lg-9 ml-n3">{{fieldcontent}}</div>
<div class="col-8 col-lg-9 ml-n3">{{{fieldcontent}}}</div>
</div>
{{/fields}}
{{#tags}}
Expand Down
2 changes: 1 addition & 1 deletion mod/data/templates/defaulttemplate_rsstemplate.mustache
Expand Up @@ -38,7 +38,7 @@
{{#fields}}
<div class="mt-4">
<span class="font-weight-bold">{{fieldname}}</span>
<p class="mt-2">{{fieldcontent}}</p>
<p class="mt-2">{{{fieldcontent}}}</p>
</div>
{{/fields}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion mod/data/templates/defaulttemplate_singletemplate.mustache
Expand Up @@ -58,7 +58,7 @@
{{#fields}}
<div class="mt-4">
<span class="font-weight-bold">{{fieldname}}</span>
<p class="mt-2">{{fieldcontent}}</p>
<p class="mt-2">{{{fieldcontent}}}</p>
</div>
{{/fields}}
##otherfields##
Expand Down

0 comments on commit a1eec36

Please sign in to comment.