$options->smiley = false; $options->filter = false; // convert and remove any XSS $tag->description = format_text($tag->description, $tag->descriptionformat, $options); $tag->descriptionformat = FORMAT_HTML; } $tagform = new tag_edit_form(); $tagform->set_data($tag); // if new data has been sent, update the tag record if ($tagnew = $tagform->get_data()) { $tagnew->timemodified = time(); if (!update_record('tag', $tagnew)) { error('Error updating tag record'); } //updated related tags update_item_tags('tag', $tagnew->id, $tagnew->relatedtags); redirect($CFG->wwwroot . '/tag/index.php?id=' . $tagnew->id); } $navlinks = array(); $navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => ''); $navlinks[] = array('name' => $tagname, 'link' => '', 'type' => ''); $navigation = build_navigation($navlinks); print_header_simple(get_string('tag', 'tag') . ' - ' . $tagname, '', $navigation); print_heading($tagname, '', 2); $tagform->display(); if (ajaxenabled()) { ?> <script type="text/javascript"> // An XHR DataSource
function useredit_update_interests($user, $cvs_tag_names) { update_item_tags('user', $user->id, $cvs_tag_names); }