mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-33426 Completion: Multilang activity names wrong in alt/title
This commit is contained in:
parent
116714e8dc
commit
383fc1fbae
2 changed files with 7 additions and 6 deletions
|
@ -1515,9 +1515,8 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||||
// 2. the activity has dates set which do not include current, or
|
// 2. the activity has dates set which do not include current, or
|
||||||
// 3. the activity has any other conditions set (regardless of whether
|
// 3. the activity has any other conditions set (regardless of whether
|
||||||
// current user meets them)
|
// current user meets them)
|
||||||
$canviewhidden = has_capability(
|
$modcontext = context_module::instance($mod->id);
|
||||||
'moodle/course:viewhiddenactivities',
|
$canviewhidden = has_capability('moodle/course:viewhiddenactivities', $modcontext);
|
||||||
get_context_instance(CONTEXT_MODULE, $mod->id));
|
|
||||||
$accessiblebutdim = false;
|
$accessiblebutdim = false;
|
||||||
if ($canviewhidden) {
|
if ($canviewhidden) {
|
||||||
$accessiblebutdim = !$mod->visible;
|
$accessiblebutdim = !$mod->visible;
|
||||||
|
@ -1733,9 +1732,10 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
|
||||||
}
|
}
|
||||||
if ($completionicon) {
|
if ($completionicon) {
|
||||||
$imgsrc = $OUTPUT->pix_url('i/completion-'.$completionicon);
|
$imgsrc = $OUTPUT->pix_url('i/completion-'.$completionicon);
|
||||||
$imgalt = s(get_string('completion-alt-'.$completionicon, 'completion', $mod->name));
|
$formattedname = format_string($mod->name, true, array('context' => $modcontext));
|
||||||
|
$imgalt = get_string('completion-alt-' . $completionicon, 'completion', $formattedname);
|
||||||
if ($completion == COMPLETION_TRACKING_MANUAL && !$isediting) {
|
if ($completion == COMPLETION_TRACKING_MANUAL && !$isediting) {
|
||||||
$imgtitle = s(get_string('completion-title-'.$completionicon, 'completion', $mod->name));
|
$imgtitle = get_string('completion-title-' . $completionicon, 'completion', $formattedname);
|
||||||
$newstate =
|
$newstate =
|
||||||
$completiondata->completionstate==COMPLETION_COMPLETE
|
$completiondata->completionstate==COMPLETION_COMPLETE
|
||||||
? COMPLETION_INCOMPLETE
|
? COMPLETION_INCOMPLETE
|
||||||
|
|
|
@ -388,12 +388,13 @@ foreach($progress as $user) {
|
||||||
($activity->completion==COMPLETION_TRACKING_AUTOMATIC ? 'auto' : 'manual').
|
($activity->completion==COMPLETION_TRACKING_AUTOMATIC ? 'auto' : 'manual').
|
||||||
'-'.$completiontype;
|
'-'.$completiontype;
|
||||||
|
|
||||||
|
$modcontext = context_module::instance($activity->id);
|
||||||
$describe = get_string('completion-' . $completiontype, 'completion');
|
$describe = get_string('completion-' . $completiontype, 'completion');
|
||||||
$a=new StdClass;
|
$a=new StdClass;
|
||||||
$a->state=$describe;
|
$a->state=$describe;
|
||||||
$a->date=$date;
|
$a->date=$date;
|
||||||
$a->user=fullname($user);
|
$a->user=fullname($user);
|
||||||
$a->activity=strip_tags($activity->name);
|
$a->activity = format_string($activity->name, true, array('context' => $modcontext));
|
||||||
$fulldescribe=get_string('progress-title','completion',$a);
|
$fulldescribe=get_string('progress-title','completion',$a);
|
||||||
|
|
||||||
if ($csv) {
|
if ($csv) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue