Skip to content

Commit

Permalink
MDL-33426 Completion: Multilang activity names wrong in alt/title
Browse files Browse the repository at this point in the history
  • Loading branch information
sammarshallou committed Jul 3, 2012
1 parent d71b79a commit 110f73a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1470,9 +1470,8 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
// 2. the activity has dates set which do not include current, or
// 3. the activity has any other conditions set (regardless of whether
// current user meets them)
$canviewhidden = has_capability(
'moodle/course:viewhiddenactivities',
get_context_instance(CONTEXT_MODULE, $mod->id));
$modcontext = context_module::instance($mod->id);
$canviewhidden = has_capability('moodle/course:viewhiddenactivities', $modcontext);
$accessiblebutdim = false;
if ($canviewhidden) {
$accessiblebutdim = !$mod->visible;
Expand Down Expand Up @@ -1684,9 +1683,10 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
}
if ($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) {
$imgtitle = s(get_string('completion-title-'.$completionicon, 'completion', $mod->name));
$imgtitle = get_string('completion-title-' . $completionicon, 'completion', $formattedname);
$newstate =
$completiondata->completionstate==COMPLETION_COMPLETE
? COMPLETION_INCOMPLETE
Expand Down
3 changes: 2 additions & 1 deletion report/progress/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,13 @@ function csv_quote($value) {
($activity->completion==COMPLETION_TRACKING_AUTOMATIC ? 'auto' : 'manual').
'-'.$completiontype;

$modcontext = context_module::instance($activity->id);
$describe = get_string('completion-' . $completiontype, 'completion');
$a=new StdClass;
$a->state=$describe;
$a->date=$date;
$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);

if ($csv) {
Expand Down

0 comments on commit 110f73a

Please sign in to comment.