1 |
efrain |
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 |
namespace core_adminpresets\local\setting;
|
|
|
18 |
|
|
|
19 |
/**
|
|
|
20 |
* Reimplementation to allow human friendly view of the selected regexps.
|
|
|
21 |
*
|
|
|
22 |
* @deprecated Moodle 4.3 MDL-78468 - No longer used since the devicedetectregex was removed.
|
|
|
23 |
* @todo Final deprecation on Moodle 4.7 MDL-79052
|
|
|
24 |
* @package core_adminpresets
|
|
|
25 |
* @copyright 2021 Pimenko <support@pimenko.com><pimenko.com>
|
|
|
26 |
* @author Jordan Kesraoui | Sylvain Revenu | Pimenko based on David Monllaó <david.monllao@urv.cat> code
|
|
|
27 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
28 |
*/
|
|
|
29 |
class adminpresets_admin_setting_devicedetectregex extends adminpresets_admin_setting_configtext {
|
|
|
30 |
|
|
|
31 |
/**
|
|
|
32 |
* @deprecated Moodle 4.3 MDL-78468 - No longer used since the devicedetectregex was removed.
|
|
|
33 |
* @todo Final deprecation on Moodle 4.7 MDL-79052
|
|
|
34 |
*/
|
|
|
35 |
public function set_visiblevalue() {
|
|
|
36 |
debugging(
|
|
|
37 |
__FUNCTION__ . '() is deprecated.' .
|
|
|
38 |
'All functions associated with devicedetectregex theme setting are being removed.',
|
|
|
39 |
DEBUG_DEVELOPER
|
|
|
40 |
);
|
|
|
41 |
$values = json_decode($this->get_value());
|
|
|
42 |
|
|
|
43 |
if (!$values) {
|
|
|
44 |
parent::set_visiblevalue();
|
|
|
45 |
return;
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
$this->visiblevalue = '';
|
|
|
49 |
foreach ($values as $key => $value) {
|
|
|
50 |
$this->visiblevalue .= $key . ' = ' . $value . ', ';
|
|
|
51 |
}
|
|
|
52 |
$this->visiblevalue = rtrim($this->visiblevalue, ', ');
|
|
|
53 |
}
|
|
|
54 |
}
|