MDL-52386 auth_ldap: Typo fix for suspended user
[moodle.git] / tag / lib.php
blob107a0f5d28d5224495a42b56decb19c820b29502
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.
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/>.
17 /**
18 * Functions for component core_tag
20 * To set or get item tags refer to the class {@link core_tag_tag}
22 * @package core_tag
23 * @copyright 2007 Luiz Cruz <luiz.laydner@gmail.com>
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
27 /**
28 * Return a list of page types
30 * @package core_tag
31 * @param string $pagetype current page type
32 * @param stdClass $parentcontext Block's parent context
33 * @param stdClass $currentcontext Current context of block
35 function tag_page_type_list($pagetype, $parentcontext, $currentcontext) {
36 return array(
37 'tag-*'=>get_string('page-tag-x', 'tag'),
38 'tag-index'=>get_string('page-tag-index', 'tag'),
39 'tag-search'=>get_string('page-tag-search', 'tag'),
40 'tag-manage'=>get_string('page-tag-manage', 'tag')
44 /**
45 * Implements callback inplace_editable() allowing to edit values in-place
47 * @param string $itemtype
48 * @param int $itemid
49 * @param mixed $newvalue
50 * @return \core\output\inplace_editable
52 function core_tag_inplace_editable($itemtype, $itemid, $newvalue) {
53 if ($itemtype === 'tagname') {
54 require_capability('moodle/tag:manage', context_system::instance());
55 $tag = core_tag_tag::get($itemid, '*', MUST_EXIST);
56 $tag->update(array('rawname' => $newvalue));
57 return new \core_tag\output\tagname($tag);