mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Merge branch 'MDL-80043-401' of https://github.com/junpataleta/moodle into MOODLE_401_STABLE
This commit is contained in:
commit
67f08a792f
@ -930,14 +930,24 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti
|
||||
}
|
||||
$coursecontext = context_course::instance($courseid);
|
||||
// Title will be constituted by information starting from the unique identifying information for the page.
|
||||
if (in_array($active_type, ['report', 'settings'])) {
|
||||
if ($heading) {
|
||||
// If heading is supplied, use this for the page title.
|
||||
$uniquetitle = $heading;
|
||||
} else if (in_array($active_type, ['report', 'settings'])) {
|
||||
// For grade reports or settings pages of grade plugins, use the plugin name for the unique title.
|
||||
$uniquetitle = $stractive_plugin;
|
||||
// But if editing mode is turned on, check if the report plugin has an editing mode title string and use it if present.
|
||||
if ($PAGE->user_is_editing() && $active_type === 'report') {
|
||||
$strcomponent = "gradereport_{$active_plugin}";
|
||||
if (get_string_manager()->string_exists('editingmode_title', $strcomponent)) {
|
||||
$uniquetitle = get_string('editingmode_title', $strcomponent);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$uniquetitle = $stractive_type . ': ' . $stractive_plugin;
|
||||
}
|
||||
$titlecomponents = [
|
||||
$uniquetitle,
|
||||
get_string('grades'),
|
||||
$coursecontext->get_context_name(false),
|
||||
];
|
||||
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $titlecomponents));
|
||||
|
@ -28,6 +28,7 @@ $string['ajaxerror'] = 'Error';
|
||||
$string['ajaxfailedupdate'] = 'Unable to update [1] for [2]';
|
||||
$string['ajaxfieldchanged'] = 'The field you are currently editing has changed, would you like to use the updated value?';
|
||||
$string['ajaxchoosescale'] = 'Choose';
|
||||
$string['editingmode_title'] = 'Editing the grader report';
|
||||
$string['eventgradereportviewed'] = 'Grader report viewed';
|
||||
$string['grader:manage'] = 'Manage the grader report';
|
||||
$string['grader:view'] = 'View grader report';
|
||||
|
@ -301,7 +301,9 @@ class grade extends tablelike implements selectable_items, filterable_items {
|
||||
* @return string
|
||||
*/
|
||||
public function heading(): string {
|
||||
return get_string('gradeitem', 'gradereport_singleview', $this->item->get_name());
|
||||
global $PAGE;
|
||||
$headinglangstring = $PAGE->user_is_editing() ? 'gradeitemedit' : 'gradeitem';
|
||||
return get_string($headinglangstring, 'gradereport_singleview', $this->item->get_name());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -302,7 +302,9 @@ class user extends tablelike implements selectable_items {
|
||||
* @return string
|
||||
*/
|
||||
public function heading(): string {
|
||||
return get_string('gradeuser', 'gradereport_singleview', fullname($this->item));
|
||||
global $PAGE;
|
||||
$headinglangstring = $PAGE->user_is_editing() ? 'gradeuseredit' : 'gradeuser';
|
||||
return get_string($headinglangstring, 'gradereport_singleview', fullname($this->item));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,8 +44,10 @@ $string['excludenonegrades'] = 'Exclude none';
|
||||
$string['eventgradereportviewed'] = 'Grade single view report viewed.';
|
||||
$string['feedbackfor'] = 'Feedback for {$a}';
|
||||
$string['gradefor'] = 'Grade for {$a}';
|
||||
$string['gradeitem'] = 'Grade item: {$a}';
|
||||
$string['gradeuser'] = 'Grade user: {$a}';
|
||||
$string['gradeitem'] = 'Viewing grades for {$a}';
|
||||
$string['gradeitemedit'] = 'Editing grades for {$a}';
|
||||
$string['gradeuser'] = 'Viewing {$a}\'s grades';
|
||||
$string['gradeuseredit'] = 'Editing {$a}\'s grades';
|
||||
$string['gotonextreport'] = 'Go to next user report';
|
||||
$string['gotopreviousreport'] = 'Go to previous user report';
|
||||
$string['noscreens'] = 'Could not find a suitable single view screen.';
|
||||
|
@ -1,6 +1,12 @@
|
||||
This file describes API changes in /grade/* ;
|
||||
Information provided here is intended especially for developers.
|
||||
|
||||
=== 4.1.7 ===
|
||||
* Some changes to how print_grade_page_head() sets the page title:
|
||||
* If a non-empty `$heading` parameter is passed, it will be used as the page title's unique identifying information.
|
||||
* Add support for grade report plugins that define an `editingmode_title` lang string. If the grade report plugin defines this
|
||||
language string, it will be used for the page title's unique identifying information when editing mode is turned on.
|
||||
|
||||
=== 4.1.6 ===
|
||||
* The grade `itemname` property contained in the return structure of the following external methods is now PARAM_CLEANHTML:
|
||||
- `gradereport_user_get_grade_items`
|
||||
|
Loading…
x
Reference in New Issue
Block a user