Differences Between: [Versions 311 and 402] [Versions 311 and 403]
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 * Role view matrix. 19 * 20 * @package core_role 21 * @copyright 2016 onwards Andrew Hancox <andrewdchancox@googlemail.com> 22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 */ 24 25 defined('MOODLE_INTERNAL') || die(); 26 27 /** 28 * Subclass of role_allow_role_page for the Allow views tab. 29 * 30 * @package core_role 31 * @copyright 2016 onwards Andrew Hancox <andrewdchancox@googlemail.com> 32 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 33 */ 34 class core_role_allow_view_page extends core_role_allow_role_page { 35 /** @var array */ 36 protected $allowedtargetroles; 37 38 /** 39 * core_role_allow_view_page constructor. 40 */ 41 public function __construct() { 42 parent::__construct('role_allow_view', 'allowview'); 43 } 44 45 46 /** 47 * Allow from role to view target role. 48 * @param int $fromroleid 49 * @param int $targetroleid 50 */ 51 protected function set_allow($fromroleid, $targetroleid) { 52 core_role_set_view_allowed($fromroleid, $targetroleid); 53 } 54 55 /** 56 * Get tool tip for cell. 57 * @param string $fromrole 58 * @param string $targetrole 59 * @return string 60 * @throws \coding_exception 61 */ 62 protected function get_cell_tooltip($fromrole, $targetrole) { 63 $a = new stdClass; 64 $a->fromrole = $fromrole->localname; 65 $a->targetrole = $targetrole->localname; 66 return get_string('allowroletoview', 'core_role', $a); 67 } 68 69 /** 70 * Get intro text for role allow view page. 71 * @return string 72 * @throws \coding_exception 73 */ 74 public function get_intro_text() { 75 return get_string('configallowview', 'core_admin'); 76 } 77 78 protected function get_eventclass() { 79 return \core\event\role_allow_view_updated::class; 80 } 81 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body