| [ Index ] |
PHP Cross Reference of MantisBT |
[Source view] [Print] [Project Stats]
Tag API
| Author: | John Reese |
| Copyright: | Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org |
| Copyright: | Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net |
| File Size: | 798 lines (22 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
| tag_exists( $p_tag_id ) X-Ref |
| Determine if a tag exists with the given ID. param: integer Tag ID return: boolean True if tag exists |
| tag_ensure_exists( $p_tag_id ) X-Ref |
| Ensure a tag exists with the given ID. param: integer Tag ID |
| tag_is_unique( $p_name ) X-Ref |
| Determine if a given name is unique (not already used). Uses a case-insensitive search of the database for existing tags with the same name. param: string Tag name return: boolean True if name is unique |
| tag_ensure_unique( $p_name ) X-Ref |
| Ensure that a name is unique. param: string Tag name |
| tag_name_is_valid( $p_name, &$p_matches, $p_prefix = '' ) X-Ref |
| Determine if a given name is valid. Name must not begin with '+' and '-' characters (they are used for filters) and must not contain the configured tag separator. The matches parameter allows to also receive an array of regex matches, which by default only includes the valid tag name itself. The prefix parameter is optional, but allows you to prefix the regex check, which is useful for filters, etc. param: string Tag name param: array Array reference for regex matches param: string Prefix regex pattern return: boolean True if the name is valid |
| tag_ensure_name_is_valid( $p_name ) X-Ref |
| Ensure a tag name is valid. param: string Tag name |
| tag_cmp_name( $p_tag1, $p_tag2 ) X-Ref |
| Compare two tag rows based on tag name. param: array Tag row 1 param: array Tag row 2 return: integer -1 when Tag 1 < Tag 2, 1 when Tag 1 > Tag 2, 0 otherwise |
| tag_parse_string( $p_string ) X-Ref |
| Parse a form input string to extract existing and new tags. When given a string, parses for tag names separated by configured separator, then returns an array of tag rows for each tag. Existing tags get the full row of information returned. If the tag does not exist, a row is returned with id = -1 and the tag name, and if the name is invalid, a row is returned with id = -2 and the tag name. The resulting array is then sorted by tag name. param: string Input string to parse return: array Rows of tags parsed from input string |
| tag_parse_filters( $p_string ) X-Ref |
| Parse a filter string to extract existing and new tags. When given a string, parses for tag names separated by configured separator, then returns an array of tag rows for each tag. Existing tags get the full row of information returned. If the tag does not exist, a row is returned with id = -1 and the tag name, and if the name is invalid, a row is returned with id = -2 and the tag name. The resulting array is then sorted by tag name. param: string Filter string to parse return: array Rows of tags parsed from filter string |
| tag_get( $p_tag_id ) X-Ref |
| Return a tag row for the given ID. param: integer Tag ID return: array Tag row |
| tag_get_by_name( $p_name ) X-Ref |
| Return a tag row for the given name. param: string Tag name return: Tag row |
| tag_get_field( $p_tag_id, $p_field_name ) X-Ref |
| Return a single field from a tag row for the given ID. param: integer Tag ID param: string Field name return: mixed Field value |
| tag_create( $p_name, $p_user_id = null, $p_description = '' ) X-Ref |
| Create a tag with the given name, creator, and description. Defaults to the currently logged in user, and a blank description. param: string Tag name param: integer User ID param: string Description return: integer Tag ID |
| tag_update( $p_tag_id, $p_name, $p_user_id, $p_description ) X-Ref |
| Update a tag with given name, creator, and description. param: integer Tag ID param: string Tag name param: integer User ID param: string Description |
| tag_delete( $p_tag_id ) X-Ref |
| Delete a tag with the given ID. param: integer Tag ID |
| tag_get_candidates_for_bug( $p_bug_id ) X-Ref |
| Gets the candidates for the specified bug. These are existing tags that are not associated with the bug already. returns: The array of tag rows, each with id, name, and description. param: int $p_bug_id The bug id, if 0 returns all tags. |
| tag_bug_is_attached( $p_tag_id, $p_bug_id ) X-Ref |
| Determine if a tag is attached to a bug. param: integer Tag ID param: integer Bug ID return: boolean True if the tag is attached |
| tag_bug_get_row( $p_tag_id, $p_bug_id ) X-Ref |
| Return the tag attachment row. param: integer Tag ID param: integer Bug ID return: array Tag attachment row |
| tag_bug_get_attached( $p_bug_id ) X-Ref |
| Return an array of tags attached to a given bug sorted by tag name. param: Bug ID return: array Array of tag rows with attachement information |
| tag_get_bugs_attached( $p_tag_id ) X-Ref |
| Return an array of bugs that a tag is attached to. param: integer Tag ID return: array Array of bug ID's. |
| tag_bug_attach( $p_tag_id, $p_bug_id, $p_user_id = null ) X-Ref |
| Attach a tag to a bug. param: integer Tag ID param: integer Bug ID param: integer User ID |
| tag_bug_detach( $p_tag_id, $p_bug_id, $p_add_history = true, $p_user_id = null ) X-Ref |
| Detach a tag from a bug. param: integer Tag ID param: integer Bug ID param: boolean Add history entries to bug param: integer User Id (or null for current logged in user) |
| tag_bug_detach_all( $p_bug_id, $p_add_history = true, $p_user_id = null ) X-Ref |
| Detach all tags from a given bug. param: integer Bug ID param: boolean Add history entries to bug param: integer User Id (or null for current logged in user) |
| tag_display_link( $p_tag_row, $p_bug_id = 0 ) X-Ref |
| Display a tag hyperlink. If a bug ID is passed, the tag link will include a detach link if the user has appropriate privileges. param: array Tag row param: integer Bug ID |
| tag_display_attached( $p_bug_id ) X-Ref |
| Display a list of attached tag hyperlinks separated by the configured hyperlinks. param: Bug ID |
| tag_stats_attached( $p_tag_id ) X-Ref |
| Get the number of bugs a given tag is attached to. param: integer Tag ID return: integer Number of attached bugs |
| tag_stats_related( $p_tag_id, $p_limit = 5 ) X-Ref |
| Get a list of related tags. Returns a list of tags that are the most related to the given tag, based on the number of times they have been attached to the same bugs. Defaults to a list of five tags. param: integer Tag ID param: integer List size return: array Array of tag rows, with share count added |
| Generated: Thu Jul 28 15:48:31 2011 | Cross-referenced by PHPXref 0.7 |