mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-51802 core: new template for quick editing a title
convert editing tag name to use new template
This commit is contained in:
parent
2f45a11ac4
commit
cdc5f9785b
23 changed files with 636 additions and 171 deletions
17
tag/lib.php
17
tag/lib.php
|
@ -40,3 +40,20 @@ function tag_page_type_list($pagetype, $parentcontext, $currentcontext) {
|
|||
'tag-manage'=>get_string('page-tag-manage', 'tag')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements callback inplace_editable() allowing to edit values in-place
|
||||
*
|
||||
* @param string $itemtype
|
||||
* @param int $itemid
|
||||
* @param mixed $newvalue
|
||||
* @return \core\output\inplace_editable
|
||||
*/
|
||||
function core_tag_inplace_editable($itemtype, $itemid, $newvalue) {
|
||||
if ($itemtype === 'tagname') {
|
||||
require_capability('moodle/tag:manage', context_system::instance());
|
||||
$tag = core_tag_tag::get($itemid, '*', MUST_EXIST);
|
||||
$tag->update(array('rawname' => $newvalue));
|
||||
return new \core_tag\output\tagname($tag);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue