[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/core/ -> string_api.php (summary)

String Processing API

Copyright: Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
Copyright: Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
File Size: 884 lines (28 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 41 functions

  string_preserve_spaces_at_bol()
  string_no_break()
  string_nl2br()
  string_display()
  string_display_line()
  string_display_links()
  string_display_line_links()
  string_rss_links()
  string_email()
  string_email_links()
  string_textarea()
  string_attribute()
  string_url()
  string_sanitize_url()
  string_process_bug_link()
  string_process_bugnote_link()
  string_insert_hrefs()
  string_strip_hrefs()
  string_restore_valid_html_tags()
  string_get_bug_page()
  string_get_bug_view_link()
  string_get_bugnote_view_link()
  string_get_bug_view_url()
  string_get_bugnote_view_url()
  string_get_bugnote_view_url_with_fqdn()
  string_get_bug_view_url_with_fqdn()
  string_get_bug_view_page()
  string_get_bug_update_link()
  string_get_bug_update_url()
  string_get_bug_update_page()
  string_get_bug_report_link()
  string_get_bug_report_url()
  string_get_bug_report_page()
  string_get_confirm_hash_url()
  string_format_complete_date()
  string_shorten()
  string_normalize()
  string_get_field_name()
  string_html_entities()
  string_html_specialchars()
  string_prepare_header()

Functions
Functions that are not part of a class:

string_preserve_spaces_at_bol( $p_string )   X-Ref
Preserve spaces at beginning of lines.
Lines must be separated by \n rather than <br />

param: string $p_string
return: string

string_no_break( $p_string )   X-Ref
Prepare a string to be printed without being broken into multiple lines

param: string $p_string
return: string

string_nl2br( $p_string, $p_wrap = 100 )   X-Ref
Similar to nl2br, but fixes up a problem where new lines are doubled between
html pre tags.
additionally, wrap the text an $p_wrap character intervals if the config is set

param: string $p_string
param: int $p_wrap
return: string

string_display( $p_string )   X-Ref
Prepare a multiple line string for display to HTML

param: string $p_string
return: string

string_display_line( $p_string )   X-Ref
Prepare a single line string for display to HTML

param: string $p_string
return: string

string_display_links( $p_string )   X-Ref
Prepare a string for display to HTML and add href anchors for URLs, emails
and bug references

param: string $p_string
return: string

string_display_line_links( $p_string )   X-Ref
Prepare a single line string for display to HTML and add href anchors for
URLs, emails and bug references

param: string $p_string
return: string

string_rss_links( $p_string )   X-Ref
Prepare a string for display in rss

param: string
return: string

string_email( $p_string )   X-Ref
Prepare a string for plain text display in email

param: string $p_string
return: string

string_email_links( $p_string )   X-Ref
Prepare a string for plain text display in email and add URLs for bug
links

param: string
return: string

string_textarea( $p_string )   X-Ref

param: string
return: string

string_attribute( $p_string )   X-Ref
Process a string for display in a text box

param: string
return: string

string_url( $p_string )   X-Ref
Process a string for inclusion in a URL as a GET parameter

param: string $p_string
return: string

string_sanitize_url( $p_url, $p_return_absolute = false )   X-Ref
validate the url as part of this site before continuing

param: string $p_url
param: bool $p_return_absolute
return: string

string_process_bug_link( $p_string, $p_include_anchor = true, $p_detail_info = true, $p_fqdn = false )   X-Ref
Process $p_string, looking for bug ID references and creating bug view
links for them.

Returns the processed string.

If $p_include_anchor is true, include the href tag, otherwise just insert
the URL

The bug tag ('#' by default) must be at the beginning of the string or
preceeded by a character that is not a letter, a number or an underscore

if $p_include_anchor = false, $p_fqdn is ignored and assumed to true.
param: string $p_string
param: bool $p_include_anchor
param: bool $p_detail_info
param: bool $p_fqdn
return: string

string_process_bugnote_link( $p_string, $p_include_anchor = true, $p_detail_info = true, $p_fqdn = false )   X-Ref
Process $p_string, looking for bugnote ID references and creating bug view
links for them.

Returns the processed string.

If $p_include_anchor is true, include the href tag, otherwise just insert
the URL

The bugnote tag ('~' by default) must be at the beginning of the string or
preceeded by a character that is not a letter, a number or an underscore

if $p_include_anchor = false, $p_fqdn is ignored and assumed to true.
param: string $p_string
param: bool $p_include_anchor
param: bool $p_detail_info
param: bool $p_fqdn
return: string

string_insert_hrefs( $p_string )   X-Ref
Detect URLs and email addresses in the string and replace them with href anchors

param: string $p_string
return: string

string_strip_hrefs( $p_string )   X-Ref
Detect href anchors in the string and replace them with URLs and email addresses

param: string $p_string
return: string

string_restore_valid_html_tags( $p_string, $p_multiline = true )   X-Ref
This function looks for text with htmlentities
like &lt;b&gt; and converts is into corresponding
html < b > tag based on the configuration presets

param: string $p_string
param: bool $p_multiline
return: string

string_get_bug_page( $p_action, $p_user_id = null )   X-Ref
return the name of a bug page for the user
account for the user preference and site override
$p_action should be something like 'view', 'update', or 'report'
If $p_user_id is null or not specified, use the current user * @param string $p_action

param: string $p_action
param: int $p_user_id
return: string

string_get_bug_view_link( $p_bug_id, $p_user_id = null, $p_detail_info = true, $p_fqdn = false )   X-Ref
return an href anchor that links to a bug VIEW page for the given bug
account for the user preference and site override

param: int $p_bug_id
param: int $p_user_id
param: bool $p_detail_info
param: bool $p_fqdn
return: string

string_get_bugnote_view_link( $p_bug_id, $p_bugnote_id, $p_user_id = null, $p_detail_info = true, $p_fqdn = false )   X-Ref
return an href anchor that links to a bug VIEW page for the given bug
account for the user preference and site override

param: int $p_bug_id
param: int $p_bugnote_id
param: int $p_user_id
param: bool $p_detail_info
param: bool $p_fqdn
return: string

string_get_bug_view_url( $p_bug_id )   X-Ref
return the name and GET parameters of a bug VIEW page for the given bug

param: int $p_bug_id
return: string

string_get_bugnote_view_url( $p_bug_id, $p_bugnote_id )   X-Ref
return the name and GET parameters of a bug VIEW page for the given bug

param: int $p_bug_id
param: int $p_bugnote_id
return: string

string_get_bugnote_view_url_with_fqdn( $p_bug_id, $p_bugnote_id, $p_user_id = null )   X-Ref
return the name and GET parameters of a bug VIEW page for the given bug
account for the user preference and site override
The returned url includes the fully qualified domain, hence it is suitable to be included
in emails.

param: int $p_bug_id
param: int $p_bugnote_id
param: int $p_user_id
return: string

string_get_bug_view_url_with_fqdn( $p_bug_id, $p_user_id = null )   X-Ref
return the name and GET parameters of a bug VIEW page for the given bug
account for the user preference and site override
The returned url includes the fully qualified domain, hence it is suitable to be included in emails.

param: int $p_bug_id
param: int $p_user_id
return: string

string_get_bug_view_page( $p_user_id = null )   X-Ref
return the name of a bug VIEW page for the user
account for the user preference and site override

param: int $p_user_id
return: string

string_get_bug_update_link( $p_bug_id, $p_user_id = null )   X-Ref
return an href anchor that links to a bug UPDATE page for the given bug
account for the user preference and site override

param: int $p_bug_id
param: int $p_user_id
return: string

string_get_bug_update_url( $p_bug_id, $p_user_id = null )   X-Ref
return the name and GET parameters of a bug UPDATE page for the given bug
account for the user preference and site override

param: int $p_bug_id
param: int $p_user_id
return: string

string_get_bug_update_page( $p_user_id = null )   X-Ref
return the name of a bug UPDATE page for the user
account for the user preference and site override

param: int $p_user_id
return: string

string_get_bug_report_link( $p_user_id = null )   X-Ref
return an href anchor that links to a bug REPORT page for the given bug
account for the user preference and site override

param: int $p_user_id
return: string

string_get_bug_report_url( $p_user_id = null )   X-Ref
return the name and GET parameters of a bug REPORT page for the given bug
account for the user preference and site override

param: int $p_user_id
return: string

string_get_bug_report_page( $p_user_id = null )   X-Ref
return the name of a bug REPORT page for the user
account for the user preference and site override

param: int $p_user_id
return: string

string_get_confirm_hash_url( $p_user_id, $p_confirm_hash )   X-Ref
return the complete url link to checkin using the confirm_hash

param: int $p_user_id
param: string $p_confirm_hash
return: string

string_format_complete_date( $p_date )   X-Ref
Format date for display

param: int $p_date
return: string

string_shorten( $p_string, $p_max = null )   X-Ref
Shorten a string for display on a dropdown to prevent the page rendering too wide
ref issues #4630, #5072, #5131

param: string $p_string
param: int $p_max
return: string

string_normalize( $p_string )   X-Ref
Normalize a string by removing leading, trailing and excessive internal spaces
note a space is used as the pattern instead of '\s' to make it work with UTF-8 strings

param: string $p_string
return: string

string_get_field_name( $p_string )   X-Ref
remap a field name to a string name (for sort filter)

param: string $p_string
return: string

string_html_entities( $p_string )   X-Ref
Calls htmlentities on the specified string, passing along
the current charset.

param: string $p_string
return: string

string_html_specialchars( $p_string )   X-Ref
Calls htmlspecialchars on the specified string, handling utf8

param: string $p_string
return: string

string_prepare_header( $p_string )   X-Ref
Prepares a string to be used as part of header().

param: string $p_string
return: string



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7