Browse Source

Fix #357 - Added QR code icon (#376)

MOODLE_36_STABLE
maksudr 6 years ago
committed by Dan Marsden
parent
commit
29f26dca13
  1. 1
      pix/qrcode.svg
  2. 8
      renderables.php
  3. 7
      renderer.php

1
pix/qrcode.svg

@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="qrcode" class="svg-inline--fa fa-qrcode fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M0 224h192V32H0v192zM64 96h64v64H64V96zm192-64v192h192V32H256zm128 128h-64V96h64v64zM0 480h192V288H0v192zm64-128h64v64H64v-64zm352-64h32v128h-96v-32h-32v96h-64V288h96v32h64v-32zm0 160h32v32h-32v-32zm-64 0h32v32h-32v-32z"></path></svg>

After

Width:  |  Height:  |  Size: 451 B

8
renderables.php

@ -854,8 +854,14 @@ class attendance_password_icon implements renderable, templatable {
$data->heading = ''; $data->heading = '';
$data->text = $this->text; $data->text = $this->text;
if ($this->includeqrcode == 1) {
$pix = 'qrcode';
} else {
$pix = 'key';
}
$data->alt = $title; $data->alt = $title;
$data->icon = (new pix_icon('key', '', 'attendance'))->export_for_template($output); $data->icon = (new pix_icon($pix, '', 'attendance'))->export_for_template($output);
$data->linktext = ''; $data->linktext = '';
$data->title = $title; $data->title = $title;
$data->url = (new moodle_url('/mod/attendance/password.php', [ $data->url = (new moodle_url('/mod/attendance/password.php', [

7
renderer.php

@ -318,6 +318,13 @@ class mod_attendance_renderer extends plugin_renderer_base {
has_capability('mod/attendance:changeattendances', $sessdata->att->context))) { has_capability('mod/attendance:changeattendances', $sessdata->att->context))) {
$icon = new attendance_password_icon($sess->studentpassword, $sess->id); $icon = new attendance_password_icon($sess->studentpassword, $sess->id);
if ($sess->includeqrcode == 1) {
$icon->includeqrcode = 1;
} else {
$icon->includeqrcode = 0;
}
$actions .= $this->render($icon); $actions .= $this->render($icon);
} }

Loading…
Cancel
Save