Functions
Search API
Primary tabs
Name | Location | Description |
---|---|---|
fp_re_array_files |
includes/ |
Re-order the _FILES array for multiple files, to make it easier to work with. From: http://php.net/manual/en/features.file-upload.multiple.php |
get_timezone_offset |
includes/ |
Returns the offset from the origin timezone to the remote timezone, in seconds. |
is_serialized_string |
includes/ |
From: https://stackoverflow.com/questions/1369936/check-to-see-if-a-string-is-... |
convert_time |
includes/ |
The point of this function is to convert between UTC (what we expect all times to start with.). If we're coming from the the database or a time() function, it's UTC. The "end_timezone_string" should be the user's preferred… |
get_timezones |
includes/ |
Returns an array of all timezones PHP recognizes. Inspired by code from: https://stackoverflow.com/questions/1727077/generating-a-drop-down-list-... |
_fp_error_handler |
includes/ |
This is our custom error handler, which will intercept PHP warnings, notices, etc, and let us display them, log them, etc. |
_fp_map_php_error_code |
includes/ |
Map an error code into an Error word * |
fp_mail |
includes/ |
Send an email. Drop-in replacement for PHP's mail() command, but can use SMTP protocol if enabled. |
arg |
includes/ |
Returns the component of the page's path. |
fp_url_get_contents |
includes/ |
This function uses CURL to get the simple contents of a URL, whether http or https. |
fp_http_request |
includes/ |
Send a request through the Internet and return the result as an object. |
timer_start |
includes/ |
Begin a microtime timer for later use. |
timer_read |
includes/ |
Works with the timer_start() function to return how long it has been since the start. |
fp_get_random_string |
includes/ |
Returns a random string of length len. |
fp_clear_cache |
includes/ |
Call all modules which implement hook_clear_cache |
fp_no_html_xss |
includes/ |
Remove any possiblilty of a malicious attacker trying to inject nonsense. From: https://paragonie.com/blog/2015/06/preventing-xss-vulnerabilities-in-php... |
fp_get_departments |
includes/ |
Returns an array (suitable for form api) of departments on campus which faculty/staff can be members of. |
csv_to_form_api_array |
includes/ |
Splits a basic csv but returns an array suitable for the form_api, retuns assoc array. |
fp_get_alert_count_by_type |
includes/ |
Returns back the total, read, and unread numbers previously calculated to see if we need to place a badge next to the bell icon at the top of the screen. If unset, we will call the recalculate function. |
fp_recalculate_alert_count_by_type |
includes/ |
Invokes a hook to get numbers on the total, read, and unread values from our modules, to find out if we need to place a badge on the bell icon at the top of the screen. |
base_url |
includes/ |
Shortcut for getting the base_url variable from the global system settings. |
csv_multiline_to_array |
includes/ |
From https://www.php.net/manual/en/function.str-getcsv.php#117692 |
fp_space_csv |
includes/ |
Simple function that adds spaces after commas in CSV strings. Makes them easier to read. |
module_enabled |
includes/ |
Simple function that returns TRUE if the module is enabled, FALSE otherwise. |
fp_goto |
includes/ |
Redirect the user's browser to the specified internal path + query. |
l |
includes/ |
This works like Drupal's l() function for creating links. Ex: l("Click here for course search!", "tools/course-search", "abc=xyz&hello=goodbye", array("class" => "my-class")); Do not… |
fp_url |
includes/ |
This function will take a path, ex: "admin/config/module" and a query, ex: "nid=5&whatever=yes" And join them together, respecting whether or not clean URL's are enabled. |
fp_screen_is_mobile |
includes/ |
This function will attempt to determine automatically if we are on a mobile device, and should therefor use the mobile theme and layout settings. |
modules_implement_hook |
includes/ |
Return an array of enabled modules which implement the provided hook. Do not include the preceeding "_" on the hook name! |
invoke_hook |
includes/ |
Invoke all module hooks for the supplied hook. |
fpm |
includes/ |
Uses fp_add_message, but in this case, it also adds in the filename and line number which the message came from! |
depricated_message |
includes/ |
Displays a depricated message on screen. Useful for tracking down when depricated functions are being used. |
fpmct |
includes/ |
Convenience function, will use fp_debug_ct() to display a message, and the number of miliseconds since its last call. |
fp_html_print_r |
includes/ |
Similar to print_r, this will return an HTML-friendly click-to-open system similar in design to Krumo. |
get_shorter_catalog_year_range |
includes/ |
This is used usually when being viewed by a mobile device. It will shorten a catalog year range of 2008-2009 to just "08-09" or "2008-09" or even "09-2009". |
include_module |
includes/ |
This will find and include the module in question, calling it's hook_init() function if it has one. |
include_module_install |
includes/ |
Find and include the module's .install file, if it exists. Returns TRUE or FALSE if it was able to find & include the file. |
fp_get_js_confirm_link |
includes/ |
Creates a javascript "confirm" link, so when clicked it asks the user a question, then proceeds if they select OK. The main reason I want to do this is so I can pass the $question through my t() function. (do it when you call this function) |
fp_get_js_prompt_link |
includes/ |
Creates a javascript "prompt" link, which will ask the user a question. |
fp_get_js_alert_link |
includes/ |
Creates a javascript "alert" link, which tells the user some message with javascript alert(). |
fp_reduce_whitespace |
includes/ |
Simple helper function to reduce whitespace (like double-spaces) |
user_has_role |
includes/ |
Does the user have the specified role? |
user_has_permission |
includes/ |
Returns TRUE or FALSE if the logged in user has access based on the permission supplied. |
get_modules_permissions |
includes/ |
This function will read through all the modules' permissions and return back an array. Specifically, it retrieves arrays from each modules' hook_perm() function. |
get_modules_menus |
includes/ |
Similar to get_modules_permissions, this will scan through all installed modules' hook_menu() functions, and assemble an array which is sorted by "location" and then by "weight". |
fp_number_pad |
includes/ |
Simple function to left padd numbers with 0's. 1 becomes 001 20 becomes 020 and so on. |
fp_truncate_decimals |
includes/ |
This simple function will take a number and truncate the number of decimals to the requested places. This can be used in place of number_format(), which *rounds* numbers. |
fp_query_string_encode |
includes/ |
Adapted from https://api.drupal.org/api/drupal/includes%21common.inc/function/drupal_... |
fp_debug_ct |
includes/ |
Shortcut to fp_debug_current_time_millis() |
fp_debug_current_time_millis |
includes/ |
When called repeatedly, this function will display a message along with a milisecond count out to the side. Very useful for developers to time function calls or queries, to see how long they are taking. |