[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/core/ -> helper_api.php (summary)

Helper 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: 636 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 24 functions

  helper_alternate_colors()
  helper_alternate_class()
  helper_alternate_class_no_attribute()
  get_status_color()
  get_percentage_by_status()
  get_enum_element()
  check_selected()
  check_checked()
  helper_begin_long_process()
  helper_get_current_project()
  helper_get_current_project_trace()
  helper_set_current_project()
  helper_clear_pref_cookies()
  helper_ensure_confirmed()
  helper_call_custom_function()
  helper_project_specific_where()
  helper_get_columns_to_view()
  helper_get_default_export_filename()
  helper_get_tab_index_value()
  helper_get_tab_index()
  helper_log_to_page()
  helper_show_query_count()
  helper_mantis_url()
  helper_duration_to_minutes()

Functions
Functions that are not part of a class:

helper_alternate_colors( $p_index, $p_odd_color, $p_even_color )   X-Ref
alternate color function
If no index is given, continue alternating based on the last index given

param: int $p_index
param: string $p_odd_color
param: string $p_even_color
return: string

helper_alternate_class( $p_index = null, $p_odd_class = 'row-1', $p_even_class = 'row-2' )   X-Ref
alternate classes for table rows
If no index is given, continue alternating based on the last index given

param: int $p_index
param: string $p_odd_class default: row-1
param: string $p_even_class default: row-2
return: string

helper_alternate_class_no_attribute( $p_index = null, $p_odd_class = 'odd', $p_even_class = 'even' )   X-Ref
return alternate classes for rows, no attribute
If no index is given, continue alternating based on the last index given

param: int $p_index
param: string $p_odd_class default: odd
param: string $p_even_class default: even
return: string

get_status_color( $p_status )   X-Ref
get the color string for the given status

param: int $p_status
return: string

get_percentage_by_status()   X-Ref
get the status percentages

return: array key is the status value, value is the percentage of bugs for the status

get_enum_element( $p_enum_name, $p_val )   X-Ref
Given a enum string and num, return the appropriate string

param: string $p_enum_name
param: int $p_val
return: string

check_selected( $p_var, $p_val = true )   X-Ref
If $p_var is not an array and is equal to $p_val then we PRINT SELECTED.
If $p_var is an array, then if any member is equal to $p_val we PRINT SELECTED.
This is used when we want to know if a variable indicated a certain
option element is selected

If the second parameter is not given, the first parameter is compared
to the boolean value true
param: mixed $p_var
param: mixed $p_val
return: null

check_checked( $p_var, $p_val = true )   X-Ref
If $p_var is not an array and is equal to $p_val then we PRINT CHECKED.
If $p_var is an array, then if any member is equal to $p_val we PRINT CHECKED.
This is used when we want to know if a variable indicated a certain
option element is selected

If the second parameter is not given, the first parameter is compared
to the boolean value true
param: mixed $p_var
param: mixed $p_val
return: null

helper_begin_long_process( $p_ignore_abort = false )   X-Ref
Set up PHP for a long process execution
The script timeout is set based on the value of the long_process_timeout config option.
$p_ignore_abort specified whether to ignore user aborts by hitting
the Stop button (the default is not to ignore user aborts)

param: bool $p_ignore_abort
return: int

helper_get_current_project()   X-Ref
Return the current project id as stored in a cookie
If no cookie exists, the user's default project is returned

return: int

helper_get_current_project_trace()   X-Ref
Return the current project id as stored in a cookie, in an Array
If no cookie exists, the user's default project is returned
If the current project is a subproject, the return value will include
any parent projects

return: array

helper_set_current_project( $p_project_id )   X-Ref
Set the current project id (stored in a cookie)

param: int $p_project_id
return: bool always true

helper_clear_pref_cookies()   X-Ref
Clear all known user preference cookies

return: null

helper_ensure_confirmed( $p_message, $p_button_label )   X-Ref
Check whether the user has confirmed this action.

If the user has not confirmed the action, generate a page which asks
the user to confirm and then submits a form back to the current page
with all the GET and POST data and an additional field called _confirmed
to indicate that confirmation has been done.
param: string $p_message
param: string $p_button_label
return: bool

helper_call_custom_function( $p_function, $p_args_array )   X-Ref
Call custom function.

$p_function - Name of function to call (eg: do_stuff).  The function will call custom_function_override_do_stuff()
if found, otherwise, will call custom_function_default_do_stuff().
$p_args_array - Parameters to function as an array
param: string $p_function
param: array $p_args_array
return: mixed

helper_project_specific_where( $p_project_id, $p_user_id = null )   X-Ref
return string to use in db queries containing projects of given user

param: int $p_project_id
param: int $p_user_id
return: string

helper_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAGE, $p_viewable_only = true, $p_user_id = null )   X-Ref

param: int $p_columns_target
param: bool $p_viewable_only
param: int $p_user_id
return: array

helper_get_default_export_filename( $p_extension_with_dot, $p_prefix = '', $p_suffix = '' )   X-Ref
if all projects selected, default to <prefix><username><suffix><extension>, otherwise default to
<prefix><projectname><suffix><extension>.

param: string $p_extension_with_dot
param: string $p_prefix
param: string $p_suffix
return: string

helper_get_tab_index_value()   X-Ref
returns a tab index value and increments it by one.  This is used to give sequential tab index on a form.

return: int

helper_get_tab_index()   X-Ref
returns a tab index and increments internal state by 1.  This is used to give sequential tab index on
a form.  For example, this function returns: tabindex="1"

return: string

helper_log_to_page()   X-Ref
returns a boolean indicating whether SQL queries executed should be shown or not.

return: bool

helper_show_query_count()   X-Ref
returns a boolean indicating whether SQL queries executed should be shown or not.

return: bool

helper_mantis_url( $p_url )   X-Ref
Return a URL relative to the web root, compatible with other applications

param: string $p_url
return: string

helper_duration_to_minutes( $p_hhmm )   X-Ref
convert a duration string in "[h]h:mm" to an integer (minutes)

param: string $p_hhmm
return: int



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