Merge branch 'MDL-73993-master' of https://github.com/golenkovm/moodle
[moodle.git] / blocks / accessreview / lib.php
blob81942fe3687f07358f1003c58491bd4b11ab7b06
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 /**
19 * Lib library of functions.
21 * @package block_accessreview
22 * @copyright 2019 Karen Holland LTS.ie
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 defined('MOODLE_INTERNAL') || die();
28 /**
29 * Get icon mapping for font-awesome.
31 function block_accessreview_get_fontawesome_icon_map() {
32 return [
33 'block_accessreview:smile' => 'fa-smile-o',
34 'block_accessreview:frown' => 'fa-frown-o',
35 'block_accessreview:errorsfound' => 'fa-ban',
36 'block_accessreview:f/pdf' => 'fa-file-pdf-o',
37 'block_accessreview:f/video' => 'fa-file-video-o',
38 'block_accessreview:f/find' => 'fa-bar-chart',
39 'block_accessreview:f/form' => 'fa-pencil-square-o',
40 'block_accessreview:f/image' => 'fa-image',
41 'block_accessreview:f/layout' => 'fa-th-large',
42 'block_accessreview:f/link' => 'fa-link',
43 'block_accessreview:f/media' => 'fa-play-circle-o',
44 'block_accessreview:f/table' => 'fa-table',
45 'block_accessreview:f/text' => 'fa-font',
46 'block_accessreview:t/fail' => 'fa-ban',
47 'block_accessreview:t/pass' => 'fa-check',
51 /**
52 * Define preferences which may be set via the core_user_set_user_preferences external function.
54 * @return array
56 function block_accessreview_user_preferences(): array {
57 return [
58 'block_accessreviewtogglestate' => [
59 'type' => PARAM_INT,
60 'null' => NULL_NOT_ALLOWED,
61 'default' => 0,
62 'choices' => [0, 1],