2 // This file is part of Moodle - http://moodle.org/
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.
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 * Contains related class for displaying information of a tag area.
21 * @copyright 2019 Juan Leyva <juan@moodle.com>
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 namespace core_tag\external
;
27 defined('MOODLE_INTERNAL') ||
die();
29 use core\external\exporter
;
33 * Contains related class for displaying information of a tag area.
36 * @copyright 2019 Juan Leyva <juan@moodle.com>
37 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
39 class tag_area_exporter
extends exporter
{
42 * Return the list of properties.
46 protected static function define_properties() {
50 'description' => 'Area id.',
53 'type' => PARAM_COMPONENT
,
54 'description' => 'Component the area is related to.',
57 'type' => PARAM_ALPHANUMEXT
,
58 'description' => 'Type of item in the component.',
62 'description' => 'Whether this area is enabled.',
67 'description' => 'The tag collection this are belongs to.',
71 'description' => 'Component callback for processing tags.',
72 'null' => NULL_ALLOWED
,
76 'description' => 'Component callback file.',
77 'null' => NULL_ALLOWED
,
81 'description' => 'Return whether to display only standard, only non-standard or both tags.',
84 'multiplecontexts' => [
86 'description' => 'Whether the tag area allows tag instances to be created in multiple contexts. ',
92 protected static function define_related() {
98 protected static function define_other_properties() {
101 'type' => PARAM_BOOL
,
102 'description' => 'Whether the area is locked.',
103 'null' => NULL_ALLOWED
,
110 protected function get_other_values(renderer_base
$output) {
112 $values['locked'] = $this->related
['locked'] ?
true : false;