4 * @author j.beedell@open.ac.uk June07
7 require_once('../config.php');
11 $systemcontext = get_context_instance(CONTEXT_SYSTEM
);
12 require_capability('moodle/tag:create', $systemcontext);
14 if (empty($CFG->usetags
)) {
15 print_error('tagsaredisabled', 'tag');
18 $returnurl = optional_param('returnurl', null, PARAM_TEXT
);
19 $keyword = optional_param('coursetag_new_tag', '', PARAM_TEXT
);
20 $courseid = optional_param('entryid', 0, PARAM_INT
);
21 $userid = optional_param('userid', 0, PARAM_INT
);
23 $keyword = trim(strip_tags($keyword));
24 if ($keyword and confirm_sesskey()) {
26 require_once($CFG->dirroot
.'/tag/coursetagslib.php');
28 if ($courseid > 0 and $userid > 0) {
29 $myurl = 'tag/search.php';
30 $keywords = explode(',', $keyword);
31 coursetag_store_keywords($keywords, $courseid, $userid, 'default', $myurl);
35 // send back to originating page, where the new tag will be visible in the block
39 $myurl = $CFG->wwwroot
.'/';