The bombplates module includes several general-use functions that other modules may wish to reference
bombplates_include_custom_css
Params:
None
Returns:
Boolean
Description:
Determine if a module should add its custom CSS to the currently-rendering page. Returns FALSE if notheme is enabled or the current page is an admin-type page
bombplates_get_us_states
Params:
None
Returns:
array( 'AL' => 'Alabama' ...)
Description:
return an array of all US states and their abbreviations
bombplates_get_countries
Param:
$include_code => bool - should the keys be ISO country codes or ints
Return:
array('US' => "United States"...) OR array(0 => "United States")
Description
Retreive an array of countries.
bombplates_set_message
Param:
$message => string - "I can't do that Dave"
$code => string - see Error Codes for valid options
$level => string - error|warning|message
$email => bool - Should an email be sent to the dev team to investigate
Return:
none
Description:
Display an error to the user, log it to watchdog, and potentially email the dev team. This function should be triggered in situations where the developer knows something is very wrong. The user is prompted to contact support with an error code which maps to a specific error condition in a specific file within a specific module on a specific server.
bombplates_filter_xss
Param
$string => string - "string to filter"
$convert_urls => bool - should urls be converted to <a href> tags
Return:
string => "sanitized and tag balanced HTML string"
Description:
This is a very permissive wrapper function for drupal's built-in filter_url. It basically allows all HTML tags. Only designated content generators (e.g. the band) should ever generate text that goes through this filter
bombplates_base_url
Param:
none
Return:
string - "http://SOMEBAND.bombplates.com"
Description
Each band site can be legitimately reached through both their own SOMEBAND.com url and our assigned SOMEBAND.bombplates.com url. The global $base_url will always contain one of those. This function finds and returns the other.
bombplates_user_access
Param:
$perms => array - array of permission name strings
$account => mixed - per user_access function
$reset => bool - per user_access function
Return:
boolean - does the current|specified user have at leas one of the supplied permissions
Description:
Invoke user_access multiple times with a single function call to determine if a user has at least one of several supplied permissions
bombplates_api_access
Param:
$api_key => string - alphanumeric API key passed via $_GET or $_POST
Return:
boolean - does the passed $api_key match the api key on file?
Description:
This function should be used as the access_callback for Bombplates API functions
bombplates_api_form
Param:
$callback_path => string - internal path of the callback URL the 3rd-party API will access
$using_post => boolean - should the callback url exclude the API key as a GET parameter?
Return:
array - per the drupal API API. Including read-only callback URL and api key fields and a checkbox to reset the API key
Description:
Generate the default form fields for another form to include API info.
bombplates_url_outbound_alter
Param:
&$path => string - per url()
&$options => array - per url()
$original_path => string - per $path argument to url() but without modifications
Return:
None
Description:
Allow modules to hook into invocations of url() and modify links. This will be invoked many times, so KEEP IT LIGHT!
bombplates_url_outbound_alter
Param:
&$result => string - an internal path
$path => string - the original path that was invoked
$path_language => string - a language code
Return:
None
Description:
Allow modules to modify incoming links before the page loads.