Browse Source

Fix #455 - Fix some hard-coded language strings.

MOODLE_36_STABLE
Dan Marsden 5 years ago
parent
commit
9f32902f26
  1. 4
      export.php
  2. 1
      lang/en/attendance.php
  3. 2
      locallib.php
  4. 12
      renderer.php

4
export.php

@ -79,7 +79,9 @@ if ($formdata = $mform->get_data()) {
$reportdata = new attendance_report_data($att); $reportdata = new attendance_report_data($att);
if ($reportdata->users) { if ($reportdata->users) {
$filename = clean_filename($course->shortname.'_Attendances_'.userdate(time(), '%Y%m%d-%H%M')); $filename = clean_filename($course->shortname.'_'.
get_string('modulenameplural', 'attendance').
'_'.userdate(time(), '%Y%m%d-%H%M'));
$group = $formdata->group ? $reportdata->groups[$formdata->group] : 0; $group = $formdata->group ? $reportdata->groups[$formdata->group] : 0;
$data = new stdClass; $data = new stdClass;

1
lang/en/attendance.php

@ -332,6 +332,7 @@ $string['oversessionstaken_help'] = 'Shows statistics for sessions where attenda
<li><strong>Points</strong>: points awarded based on the taken sessions.</li> <li><strong>Points</strong>: points awarded based on the taken sessions.</li>
<li><strong>Percentage</strong>: percentage of points awarded over the maxium possible points of the taken sessions.</li> <li><strong>Percentage</strong>: percentage of points awarded over the maxium possible points of the taken sessions.</li>
</ul>'; </ul>';
$string['pageof'] = 'Page {$a->page} of {$a->numpages}';
$string['participant'] = 'Participant'; $string['participant'] = 'Participant';
$string['password'] = 'Password'; $string['password'] = 'Password';
$string['enterpassword'] = 'Enter password'; $string['enterpassword'] = 'Enter password';

2
locallib.php

@ -518,7 +518,7 @@ function attendance_exporttotableed($data, $filename, $format) {
// Sending HTTP headers. // Sending HTTP headers.
$workbook->send($filename); $workbook->send($filename);
// Creating the first worksheet. // Creating the first worksheet.
$myxls = $workbook->add_worksheet('Attendances'); $myxls = $workbook->add_worksheet(get_string('modulenameplural', 'attendance'));
// Format types. // Format types.
$formatbc = $workbook->add_format(); $formatbc = $workbook->add_format();
$formatbc->set_bold(1); $formatbc->set_bold(1);

12
renderer.php

@ -129,7 +129,11 @@ class mod_attendance_renderer extends plugin_renderer_base {
'page' => $fcontrols->pageparams->page - 1)), 'page' => $fcontrols->pageparams->page - 1)),
$this->output->larrow()); $this->output->larrow());
} }
$pagingcontrols .= html_writer::tag('span', "Page {$fcontrols->pageparams->page} of $numberofpages", $a = new stdClass();
$a->page = $fcontrols->pageparams->page;
$a->numpages = $numberofpages;
$text = get_string('pageof', 'attendance', $a);
$pagingcontrols .= html_writer::tag('span', $text,
array('class' => 'attbtn')); array('class' => 'attbtn'));
if ($fcontrols->pageparams->page < $numberofpages) { if ($fcontrols->pageparams->page < $numberofpages) {
$pagingcontrols .= html_writer::link($fcontrols->url(array('curdate' => $fcontrols->curdate, $pagingcontrols .= html_writer::link($fcontrols->url(array('curdate' => $fcontrols->curdate,
@ -532,7 +536,11 @@ class mod_attendance_renderer extends plugin_renderer_base {
$controls .= html_writer::link($takedata->url(array('page' => $takedata->pageparams->page - 1)), $controls .= html_writer::link($takedata->url(array('page' => $takedata->pageparams->page - 1)),
$this->output->larrow()); $this->output->larrow());
} }
$controls .= html_writer::tag('span', "Page {$takedata->pageparams->page} of $numberofpages", $a = new stdClass();
$a->page = $takedata->pageparams->page;
$a->numpages = $numberofpages;
$text = get_string('pageof', 'attendance', $a);
$controls .= html_writer::tag('span', $text,
array('class' => 'attbtn')); array('class' => 'attbtn'));
if ($takedata->pageparams->page < $numberofpages) { if ($takedata->pageparams->page < $numberofpages) {
$controls .= html_writer::link($takedata->url(array('page' => $takedata->pageparams->page + 1, $controls .= html_writer::link($takedata->url(array('page' => $takedata->pageparams->page + 1,

Loading…
Cancel
Save