[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/tag/ -> coursetagslib.php (summary)

coursetagslib.php

Copyright: 2007 [email protected]
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 328 lines (11 kb)
Included or required:0 times
Referenced: 6 times
Includes or requires: 0 files

Defines 9 functions

  coursetag_get_tags()
  coursetag_get_all_tags()
  coursetag_get_jscript()
  coursetag_get_jscript_links()
  coursetag_get_records()
  coursetag_store_keywords()
  coursetag_delete_keyword()
  coursetag_get_tagged_courses()
  coursetag_delete_course_tags()

Functions
Functions that are not part of a class:

coursetag_get_tags($courseid, $userid=0, $tagtype='', $numtags=0, $unused = '')   X-Ref
Returns an ordered array of tags associated with visible courses
(boosted replacement of get_all_tags() allowing association with user and tagtype).

param: int      $courseid A course id. Passing 0 will return all distinct tags for all visible courses
param: int      $userid   (optional) the user id, a default of 0 will return all users tags for the course
param: string   $tagtype  (optional) The type of tag, empty string returns all types. Currently (Moodle 2.2) there are two
param: int      $numtags  (optional) number of tags to display, default of 80 is set in the block, 0 returns all
param: string   $unused   (optional) was selected sorting, moved to tag_print_cloud()
return: array

coursetag_get_all_tags($unused='', $numtags=0)   X-Ref
Returns an ordered array of tags
(replaces popular_tags_count() allowing sorting).

param: string $unused (optional) was selected sorting - moved to tag_print_cloud()
param: int    $numtags (optional) number of tags to display, default of 20 is set in the block, 0 returns all
return: array

coursetag_get_jscript()   X-Ref
Returns javascript for use in tags block and supporting pages

return: null

coursetag_get_jscript_links($elementid, $coursetagslinks)   X-Ref
Returns javascript to create the links in the tag block footer.

param: string   $elementid       the element to attach the footer to
param: array    $coursetagslinks links arrays each consisting of 'title', 'onclick' and 'text' elements
return: string   always returns a blank string

coursetag_get_records($courseid, $userid)   X-Ref
Returns all tags created by a user for a course

param: int      $courseid tags are returned for the course that has this courseid
param: int      $userid   return tags which were created by this user

coursetag_store_keywords($tags, $courseid, $userid=0, $tagtype='official', $myurl='')   X-Ref
Stores a tag for a course for a user

param: array  $tags     simple array of keywords to be stored
param: int    $courseid the id of the course we wish to store a tag for
param: int    $userid   the id of the user we wish to store a tag for
param: string $tagtype  official or default only
param: string $myurl    (optional) for logging creation of course tags

coursetag_delete_keyword($tagid, $userid, $courseid)   X-Ref
Deletes a personal tag for a user for a course.

param: int      $tagid    the tag we wish to delete
param: int      $userid   the user that the tag is associated with
param: int      $courseid the course that the tag is associated with

coursetag_get_tagged_courses($tagid)   X-Ref
Get courses tagged with a tag

param: int $tagid
return: array of course objects

coursetag_delete_course_tags($courseid, $showfeedback=false)   X-Ref
Course tagging function used only during the deletion of a course (called by lib/moodlelib.php) to clean up associated tags

param: int      $courseid     the course we wish to delete tag instances from
param: bool     $showfeedback if we should output a notification of the delete to the end user



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1