Procedural File: helper_api.php
Source Location: /core/helper_api.php
Page Details:
Misc. Helper Functions
Tags:
check_checked [line 153]
null check_checked(
mixed $p_var, [mixed $p_val = true])
|
|
If $p_var and $p_val are equal to each other then we PRINT CHECKED This is used when we want to know if a variable indicated a certain element is checked If the second parameter is not given, the first parameter is compared to the boolean value true
Parameters
mixed |
$p_var |
|
mixed |
$p_val |
|
check_selected [line 112]
null check_selected(
mixed $p_var, [mixed $p_val = true])
|
|
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
Parameters
mixed |
$p_var |
|
mixed |
$p_val |
|
get_enum_element [line 93]
string get_enum_element(
string $p_enum_name, int $p_val)
|
|
Given a enum string and num, return the appropriate string
Parameters
string |
$p_enum_name |
|
int |
$p_val |
|
get_status_color [line 75]
string get_status_color(
int $p_status)
|
|
get the color string for the given status
Parameters
helper_alternate_class [line 56]
string helper_alternate_class(
[int $p_index = null], [string $p_odd_class = 'row-1'], [string $p_even_class = 'row-2'])
|
|
alternate classes for table rows If no index is given, continue alternating based on the last index given
Parameters
int |
$p_index |
|
string |
$p_odd_class |
default: row-1 |
string |
$p_even_class |
default: row-2 |
helper_alternate_colors [line 34]
string helper_alternate_colors(
int $p_index, string $p_odd_color, string $p_even_color)
|
|
alternate color function If no index is given, continue alternating based on the last index given
Parameters
int |
$p_index |
|
string |
$p_odd_color |
|
string |
$p_even_color |
|
helper_begin_long_process [line 167]
int helper_begin_long_process(
[bool $p_ignore_abort = false])
|
|
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)
Parameters
helper_call_custom_function [line 318]
mixed helper_call_custom_function(
string $p_function, array $p_args_array)
|
|
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
Parameters
string |
$p_function |
|
array |
$p_args_array |
|
helper_clear_pref_cookies [line 264]
null helper_clear_pref_cookies(
)
|
|
Clear all known user preference cookies
helper_duration_to_minutes [line 489]
int helper_duration_to_minutes(
string $p_hhmm)
|
|
convert a duration string in "[h]h:mm" to an integer (minutes)
Parameters
helper_ensure_confirmed [line 281]
bool helper_ensure_confirmed(
string $p_message, string $p_button_label)
|
|
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.
Tags:
Parameters
string |
$p_message |
|
string |
$p_button_label |
|
helper_get_columns_to_view [line 359]
array helper_get_columns_to_view(
[int $p_columns_target = COLUMNS_TARGET_VIEW_PAGE], [bool $p_viewable_only = true], [int $p_user_id = null])
|
|
Parameters
int |
$p_columns_target |
|
bool |
$p_viewable_only |
|
int |
$p_user_id |
|
helper_get_current_project [line 188]
int helper_get_current_project(
)
|
|
Return the current project id as stored in a cookie If no cookie exists, the user's default project is returned
helper_get_current_project_trace [line 223]
array helper_get_current_project_trace(
)
|
|
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
helper_get_default_export_filename [line 430]
string helper_get_default_export_filename(
string $p_extension_with_dot, [string $p_prefix = ''], [string $p_suffix = ''])
|
|
if all projects selected, default to <prefix><username><suffix><extension>, otherwise default to <prefix><projectname><suffix><extension>.
Parameters
string |
$p_extension_with_dot |
|
string |
$p_prefix |
|
string |
$p_suffix |
|
helper_get_tab_index [line 458]
string helper_get_tab_index(
)
|
|
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"
helper_get_tab_index_value [line 448]
int helper_get_tab_index_value(
)
|
|
returns a tab index value and increments it by one. This is used to give sequential tab index on a form.
helper_mantis_url [line 477]
string helper_mantis_url(
string $p_url)
|
|
Return a URL relative to the web root, compatible with other applications
Parameters
helper_project_specific_where [line 334]
string helper_project_specific_where(
int $p_project_id, [int $p_user_id = null])
|
|
return string to use in db queries containing projects of given user
Parameters
int |
$p_project_id |
|
int |
$p_user_id |
|
helper_set_current_project [line 252]
bool helper_set_current_project(
int $p_project_id)
|
|
Set the current project id (stored in a cookie)
Tags:
Parameters
helper_show_queries [line 466]
bool helper_show_queries(
)
|
|
returns a boolean indicating whether SQL queries executed should be shown or not.
|