Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 311 and 402]

   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.
  13  //
  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/>.
  16  
  17  
  18  /**
  19   * Lib library of functions.
  20   *
  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
  24   */
  25  
  26  defined('MOODLE_INTERNAL') || die();
  27  
  28  /**
  29   * Get icon mapping for font-awesome.
  30   */
  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',
  48      ];
  49  }
  50  
  51  /**
  52   * Define preferences which may be set via the core_user_set_user_preferences external function.
  53   *
  54   * @uses core_user::is_current_user
  55   *
  56   * @return array[]
  57   */
  58  function block_accessreview_user_preferences(): array {
  59      return [
  60          'block_accessreviewtogglestate' => [
  61              'type' => PARAM_INT,
  62              'null' => NULL_NOT_ALLOWED,
  63              'default' => 0,
  64              'choices' => [0, 1],
  65              'permissioncallback' => [core_user::class, 'is_current_user'],
  66          ],
  67      ];
  68  }