Search moodle.org's
Developer Documentation


/tag/ -> locallib.php (summary)

Moodle tag local library - output functions

Copyright: 2007 Luiz Cruz <luiz.laydner@gmail.com>
License: http://www.gnu.org/copyleft/gpl.html GNU Public License
File Size: 443 lines (16 kb)
Included or required: 2 times
Referenced: 1 time
Includes or requires: 0 files

Defines 9 functions


Functions that are not part of a class:

tag_print_cloud($tagset=null, $nr_of_tags=150, $return=false, $sort='')   X-Ref
Prints or returns a HTML tag cloud with varying classes styles depending on the popularity and type of each tag.

return: string|null a HTML string or null if this function does the output
param: array     $tagset Array of tags to display
param: int       $nr_of_tags Limit for the number of tags to return/display, used if $tagset is null
param: bool      $return     if true the function will return the generated tag cloud instead of displaying it.
param: string    $sort (optional) selected sorting, default is alpha sort (name) also timemodified or popularity

tag_cloud_sort($a, $b)   X-Ref
This function is used by print_tag_cloud, to usort() the tags in the cloud. See php.net/usort for the parameters documentation.
This was originally in blocks/blog_tags/block_blog_tags.php, named blog_tags_sort().

return: int    The result of the comparison/validation 1, 0 or -1
param: string $a Tag name to compare against $b
param: string $b Tag name to compare against $a

tag_print_description_box($tag_object, $return=false)   X-Ref
Prints a box with the description of a tag and its related tags

return: string/null a HTML box showing a description of the tag object and it's relationsips or null if output is done directly
param: stdClass    $tag_object
param: bool        $return     if true the function will return the generated tag cloud instead of displaying it.

tag_print_management_box($tag_object, $return=false)   X-Ref
Prints a box that contains the management links of a tag

return: string|null a HTML string or null if this function does the output
param: stdClass    $tag_object
param: bool        $return     if true the function will return the generated tag cloud instead of displaying it.

tag_print_search_box($return=false)   X-Ref
Prints the tag search box

return: string|null a HTML string or null if this function does the output
param: bool        $return if true return html string

tag_print_search_results($query, $page, $perpage, $return=false)   X-Ref
Prints the tag search results

return: string|null a HTML string or null if this function does the output
param: string       $query text that tag names will be matched against
param: int          $page current page
param: int          $perpage nr of users displayed per page
param: bool         $return if true return html string

tag_print_tagged_users_table($tag_object, $limitfrom='', $limitnum='', $return=false)   X-Ref
Prints a table of the users tagged with the tag passed as argument

return: string|null a HTML string or null if this function does the output
param: int         $tag_object the tag we wish to return data for
param: int         $limitfrom (optional, required if $limitnum is set) prints users starting at this point.
param: int         $limitnum (optional, required if $limitfrom is set) prints this many users.
param: bool        $return if true return html string

tag_print_user_box($user, $return=false)   X-Ref
Prints an individual user box

return: string|null a HTML string or null if this function does the output
param: user_object  $user  (contains the following fields: id, firstname, lastname and picture)
param: bool         $return if true return html string

tag_print_user_list($userlist, $return=false)   X-Ref
Prints a list of users

return: string|null a HTML string or null if this function does the output
param: array       $userlist an array of user objects
param: bool        $return if true return html string, otherwise output the result

Search This Site: