MDL-54687 core_message: added userid parameter for altering contacts
[moodle.git] / lib / db / tag.php
CommitLineData
c026a28d
MG
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 * Tag area definitions
19 *
20 * File db/tag.php lists all available tag areas in core or a plugin.
21 *
22 * Each tag area may have the following attributes:
23 * - itemtype (required) - what is tagged. Must be name of the existing DB table
24 * - component - component responsible for tagging, if the tag area is inside a
25 * plugin the component must be the full frankenstyle name of the plugin
26 * - collection - name of the custom tag collection that will be used to store
27 * tags in this area. If specified aministrator will be able to neither add
28 * any other tag areas to this collection nor move this tag area elsewhere
29 * - searchable (only if collection is specified) - wether the tag collection
30 * should be searchable on /tag/search.php
4be9c7ad
MG
31 * - showstandard - default value for the "Standard tags" attribute of the area,
32 * this is only respected when new tag area is added and ignored during upgrade
c026a28d
MG
33 * - customurl (only if collection is specified) - custom url to use instead of
34 * /tag/search.php to display information about one tag
35 * - callback - name of the function that returns items tagged with this tag,
36 * see core_tag_tag::get_tag_index() and existing callbacks for more details,
37 * callback should return instance of core_tag\output\tagindex
38 * - callbackfile - file where callback is located (if not an autoloaded location)
39 *
40 * Language file must contain the human-readable names of the tag areas and
41 * collections (either in plugin language file or in component language file or
42 * lang/en/tag.php in case of core):
43 * - for item type "user":
44 * $string['tagarea_user'] = 'Users';
45 * - for tag collection "mycollection":
46 * $string['tagcollection_mycollection'] = 'My tag collection';
47 *
48 * @package core
49 * @copyright 2015 Marina Glancy
50 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
51 */
52
53defined('MOODLE_INTERNAL') || die();
54
55$tagareas = array(
56 array(
57 'itemtype' => 'user', // Users.
58 'component' => 'core',
59 'callback' => 'user_get_tagged_users',
60 'callbackfile' => '/user/lib.php',
4be9c7ad 61 'showstandard' => core_tag_tag::HIDE_STANDARD,
c026a28d
MG
62 ),
63 array(
64 'itemtype' => 'course', // Courses.
65 'component' => 'core',
66 'callback' => 'course_get_tagged_courses',
67 'callbackfile' => '/course/lib.php',
68 ),
69 array(
70 'itemtype' => 'question', // Questions.
71 'component' => 'core_question',
72 ),
73 array(
74 'itemtype' => 'post', // Blog posts.
75 'component' => 'core',
76 'callback' => 'blog_get_tagged_posts',
77 'callbackfile' => '/blog/lib.php',
78 ),
79 array(
80 'itemtype' => 'blog_external', // External blogs.
81 'component' => 'core',
82 ),
dffcf46f
NK
83 array(
84 'itemtype' => 'course_modules', // Course modules.
85 'component' => 'core',
4218ad93
MG
86 'callback' => 'course_get_tagged_course_modules',
87 'callbackfile' => '/course/lib.php',
dffcf46f 88 ),
c026a28d 89);