Skip to content

Commit

Permalink
Merge branch 'MDL-55340-38' of git://github.com/sarjona/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_38_STABLE
  • Loading branch information
andrewnicols committed Sep 3, 2020
2 parents 9f770c1 + a44ce9a commit b74d856
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mod/feedback/classes/complete_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ protected function add_item_number($item, $element) {
*/
protected function add_item_label($item, $element) {
if (strlen($item->label) && ($this->mode == self::MODE_EDIT || $this->mode == self::MODE_VIEW_TEMPLATE)) {
$name = $element->getLabel();
$name = '('.format_string($item->label).') '.$name;
$name = get_string('nameandlabelformat', 'mod_feedback',
(object)['label' => format_string($item->label), 'name' => $element->getLabel()]);
$element->setLabel($name);
}
}
Expand Down
10 changes: 9 additions & 1 deletion mod/feedback/classes/responses_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,15 @@ protected function add_all_values_to_output() {

$tablecolumns[] = "val{$nr}";
$itemobj = feedback_get_item_class($item->typ);
$tableheaders[] = $itemobj->get_display_name($item, $headernamepostfix);
$columnheader = $itemobj->get_display_name($item, $headernamepostfix);
if (!$this->is_downloading()) {
$columnheader = shorten_text($columnheader);
}
if (strval($item->label) !== '') {
$columnheader = get_string('nameandlabelformat', 'mod_feedback',
(object)['label' => format_string($item->label), 'name' => $columnheader]);
}
$tableheaders[] = $columnheader;
}

// Add 'Delete entry' column.
Expand Down
1 change: 1 addition & 0 deletions mod/feedback/lang/en/feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
$string['multiplesubmit_help'] = 'If enabled for anonymous surveys, users can submit feedback an unlimited number of times.';
$string['name'] = 'Name';
$string['name_required'] = 'Name required';
$string['nameandlabelformat'] = '({$a->label}) {$a->name}';
$string['next_page'] = 'Next page';
$string['no_handler'] = 'No action handler exists for';
$string['no_itemlabel'] = 'No label';
Expand Down

0 comments on commit b74d856

Please sign in to comment.