Common functions that many Backdrop modules will need to reference.

The functions that are critical and need to be available even when serving a cached page are instead located in bootstrap.inc.

File

core/includes/common.inc

Functions

Namesort descending Description
archiver_get_archiver Creates the appropriate archiver for the specified file.
archiver_get_extensions Returns a string of supported archive extensions.
archiver_get_info Retrieves a list of all available archivers.
backdrop_access_denied Delivers an "access denied" error to the browser.
backdrop_add_css Adds a cascading stylesheet to the stylesheet queue.
backdrop_add_feed Adds a feed URL for the current page.
backdrop_add_html_head Adds output to the HEAD tag of the HTML page.
backdrop_add_html_head_link Adds a LINK tag with a distinct 'rel' attribute to the page's HEAD.
backdrop_add_js Adds a JavaScript file, setting, or inline code to the page.
backdrop_add_library Adds multiple JavaScript or CSS files at the same time.
backdrop_add_tabledrag Assists in adding the tableDrag JavaScript behavior to a themed table.
backdrop_aggregate_css Aggregation callback: Aggregates CSS files and inline content.
backdrop_aggregate_js Default callback to aggregate JavaScript files.
backdrop_array_diff_assoc_recursive Recursively computes the difference of arrays with additional index check.
backdrop_array_get_nested_value Retrieves a value from a nested array with variable depth.
backdrop_array_nested_key_exists Determines whether a nested array contains the requested keys.
backdrop_array_set_nested_value Sets a value in a nested array with variable depth.
backdrop_array_unset_nested_value Unsets a value in a nested array with variable depth.
backdrop_attributes Converts an associative array to an XML/HTML tag attribute string.
backdrop_build_css_cache Aggregates and optimizes CSS files into a cache file in the files directory.
backdrop_build_js_cache Aggregates JavaScript files into a cache file in the files directory.
backdrop_check_incompatibility Checks whether a version is compatible with a given dependency.
backdrop_clean_css_identifier Prepares a string for use as a CSS identifier (element, class, or ID name).
backdrop_clear_css_cache Deletes old cached CSS files.
backdrop_clear_js_cache Deletes old cached JavaScript files and variables.
backdrop_common_theme Provides theme registration for themes across .inc files.
backdrop_cron_run Executes a cron run when called.
backdrop_css_defaults Constructs an array of the defaults that are used for styles items.
backdrop_delete_file_if_stale Deletes files modified more than a set time ago.
backdrop_deliver_html_page Packages and sends the result of a page callback to the browser as HTML.
backdrop_deliver_page Delivers a page callback result to the browser in the appropriate format.
backdrop_encode_path Encodes a Backdrop path for use in a URL.
backdrop_exit Performs end-of-request tasks.
backdrop_explode_tags Explodes a string of tags into an array.
backdrop_flush_all_caches Flushes all cached data on the site.
backdrop_get_bare_domain Take a full URL and return only the bare domain, with sub-domains removed.
backdrop_get_breadcrumb Gets the breadcrumb trail for the current page.
backdrop_get_css Returns a themed representation of all stylesheets to attach to the page.
backdrop_get_destination Prepares a 'destination' URL query parameter for use with backdrop_goto().
backdrop_get_favicon Gets the file location and mime type for site favicon.
backdrop_get_feeds Gets the feed URLs for the current page.
backdrop_get_filetransfer_info Assembles the Backdrop FileTransfer registry.
backdrop_get_hash_salt Gets a salt useful for hardening against SQL injection.
backdrop_get_html_head Retrieves output to be displayed in the HEAD tag of the HTML page.
backdrop_get_js Returns a themed presentation of all JavaScript code for the current page.
backdrop_get_library Retrieves information for a JavaScript/CSS library.
backdrop_get_logo Gets the site logo.
backdrop_get_logo_info Gets the path and dimensions of the site wide logo.
backdrop_get_path Returns the path to a system item (module, theme, etc.).
backdrop_get_private_key Ensures the private key variable used to generate tokens is set.
backdrop_get_profile Gets the name of the currently active installation profile.
backdrop_get_query_array Splits a URL-encoded query string into an array.
backdrop_get_query_parameters Processes a URL query parameter array to remove unwanted elements.
backdrop_get_schema_unprocessed Returns the unprocessed and unaltered version of a module's schema.
backdrop_get_token Generates a token based on $value, the user session, and the private key.
backdrop_get_updaters Assembles the Backdrop Updater registry.
backdrop_goto Sends the user to a different page.
backdrop_goto_deprecated Wraps backdrop_goto() to include a deprecated log message.
backdrop_group_css Grouping callback: Groups CSS items by their types, media, and browsers.
backdrop_group_js Default callback to group JavaScript items.
backdrop_html_class Prepares a string for use as a valid class name.
backdrop_html_id Prepares a string for use as a valid HTML ID and guarantees uniqueness.
backdrop_http_build_query Parses an array into a valid, rawurlencoded query string.
backdrop_http_header_attributes Formats an attribute string for an HTTP header.
backdrop_http_request Performs an HTTP request.
backdrop_implode_tags Implodes an array of tags into a string.
backdrop_install_schema Creates all tables defined in a module's hook_schema().
backdrop_json_decode Converts an HTML-safe JSON string into its PHP equivalent.
backdrop_json_decode_unicode Deprecated Decode Unicode characters in JSON strings.
backdrop_json_deliver Packages and sends the result of a page callback to the browser as JSON.
backdrop_json_encode Converts a PHP variable into its JavaScript equivalent.
backdrop_json_format Deprecated Format a string of JSON for older versions of PHP.
backdrop_json_output Returns data in JSON format.
backdrop_js_defaults Constructs an array of the defaults that are used for JavaScript items.
backdrop_load_stylesheet Loads the stylesheet and resolves all @import commands.
backdrop_load_stylesheet_content Processes the contents of a stylesheet for aggregation.
backdrop_map_assoc Forms an associative array from a linear array.
backdrop_not_found Delivers a "page not found" error to the browser.
backdrop_page_create_cache Create a page cache object for a page request.
backdrop_page_footer Performs end-of-request tasks.
backdrop_page_save_cache Save a page cache entry to the cache.
backdrop_page_set_cache Deprecated Stores the current page in the cache.
backdrop_parse_dependency Parses a dependency for comparison by backdrop_check_incompatibility().
backdrop_parse_info_file Parses Backdrop module and theme .info files.
backdrop_parse_info_format Parses data in Backdrop's .info format.
backdrop_parse_url Parses a system URL string into an associative array suitable for url().
backdrop_pre_render_conditional_comments Deprecated Pre-render callback: Provides backwards-compatibility for #browsers property.
backdrop_pre_render_dropbutton Pre-render callback: Attaches the dropbutton library and required markup.
backdrop_pre_render_link Pre-render callback: Renders a link into #markup.
backdrop_pre_render_links Pre-render callback: Collects child links into a single array.
backdrop_pre_render_markup Pre-render callback: Appends contents in #markup to #children.
backdrop_pre_render_scripts #pre_render callback to add the elements needed for JavaScript tags to be rendered.
backdrop_pre_render_styles Pre-render callback: Adds the elements needed for CSS tags to be rendered.
backdrop_process_attached Adds attachments to a render() structure.
backdrop_process_states Adds JavaScript to change the state of an element based on another element.
backdrop_region_class Provides a standard HTML class name that identifies a page region.
backdrop_render Renders HTML given a structured array tree.
backdrop_render_cache_by_query Prepares an element for caching based on a query.
backdrop_render_cache_get Gets the rendered output of a renderable element from the cache.
backdrop_render_cache_set Caches the rendered output of a renderable element.
backdrop_render_children Renders children of an element and concatenates them.
backdrop_render_cid_create Creates the cache ID for a renderable element.
backdrop_render_cid_parts Returns cache ID parts for building a cache ID.
backdrop_render_collect_attached Collects #attached for an element and its children into a single array.
backdrop_render_page Renders the page, including the HTML, HEAD, and BODY tags.
backdrop_schema_fields_sql Retrieves a list of fields from a table schema.
backdrop_set_breadcrumb Sets the breadcrumb trail for the current page.
backdrop_set_time_limit Attempts to set the PHP maximum execution time.
backdrop_site_offline Delivers a "site is under maintenance" message to the browser.
backdrop_sort Sort an array based on user-provided keys within that array.
backdrop_strip_dangerous_protocols Strips dangerous protocols (e.g. 'javascript:') from a URI.
backdrop_system_listing Returns information about system object files (modules, themes, etc.).
backdrop_uninstall_schema Removes all tables defined in a module's hook_schema().
backdrop_valid_token Validates a token based on $value, the user session, and the private key.
backdrop_write_record Saves (inserts or updates) a record to the database based upon the schema.
base_path Returns the base path (i.e., directory) of the Backdrop installation.
check_url Strips dangerous protocols from a URI and encodes it for output to HTML.
debug Outputs debug information.
element_child Checks if the key is a child.
element_children Identifies the children of an element array, optionally sorted by weight.
element_get_visible_children Returns the visible children of an element.
element_info Retrieves the default properties for the defined element type.
element_info_property Retrieves a single property for the defined element type.
element_properties Gets properties of a structured array element (keys beginning with '#').
element_property Checks if the key is a property.
element_set_attributes Sets HTML attributes based on element properties.
filter_xss Filters HTML to prevent cross-site-scripting (XSS) vulnerabilities.
filter_xss_admin Applies a very permissive XSS/HTML filter for admin-only use.
filter_xss_bad_protocol Processes an HTML attribute value and strips dangerous protocols from URLs.
fix_gpc_magic Fixes double-escaping caused by "magic quotes" in some PHP installations.
flood_clear_event Makes the flood control mechanism forget an event for the current visitor.
flood_is_allowed Checks whether a user is allowed to proceed with the specified event.
flood_register_event Registers an event for the current visitor to the flood control mechanism.
format_date Formats a date, using a date type or a custom date format string.
format_interval Formats a time interval with the requested granularity.
format_plural Formats a string containing a count of items.
format_rss_channel Formats an RSS channel.
format_rss_item Formats a single RSS item.
format_size Generates a string representation for the given byte count.
format_xml_elements Recursively formats nested XML array elements as a string.
hide Hides an element from later rendering.
l Formats an internal or external URL link as an HTML anchor tag.
parse_size Parses a given byte count.
render Renders an element.
show Shows a hidden element for later rendering.
tempstore_clear Removes an object from the semi-persistent key-value store.
tempstore_clear_all Removes an entire group of objects from the semi-persistent key-value store.
tempstore_get Gets an object from the temp store.
tempstore_set Stores an object in the semi-persistent key-value store.
url Generates an internal or external URL.
url_is_external Returns TRUE if a path is external to Backdrop (e.g. http://example.com).
valid_email_address Verifies the syntax of the given email address.
valid_number_step Verifies that a number is a multiple of a given step.
valid_url Verifies the syntax of the given URL.
watchdog_severity_levels Returns a list of severity levels, as defined in RFC 3164.
_backdrop_bootstrap_full
_backdrop_build_css_path Prefixes all paths within a CSS file for backdrop_build_css_cache().
_backdrop_default_html_head Returns elements that are always displayed in the HEAD tag of the HTML page.
_backdrop_flush_css_js Changes the dummy query string added to all CSS and JavaScript files.
_backdrop_http_use_proxy Helper function for determining hosts excluded from needing a proxy.
_backdrop_load_stylesheet Loads stylesheets recursively and returns contents with corrected paths.
_backdrop_parse_response_status Split an HTTP response status line into components.
_backdrop_schema_initialize Fills in required default values for table definitions from hook_schema().
_backdrop_version_compare_convert Converts a Backdrop version string into numeric-only version string.
_filter_xss_allowed_tags List of the default tags allowed by filter_xss().
_filter_xss_attributes Processes a string of HTML attributes.
_filter_xss_display_allowed_tags Human-readable list of the default tags allowed by filter_xss(), for display in help texts.
_filter_xss_split Processes an HTML tag.
_fix_gpc_magic Strips slashes from a string or array of strings.
_fix_gpc_magic_files Strips slashes from $_FILES items.
_format_date_callback Translates a formatted date string.

Constants

Namesort descending Description
BACKDROP_CACHE_CUSTOM The block is handling its own caching in its hook_block_view().
BACKDROP_CACHE_GLOBAL The block or element is the same for every user and page that it is visible.
BACKDROP_CACHE_PER_PAGE The block or element can change depending on the page being viewed.
BACKDROP_CACHE_PER_ROLE The block or element can change depending on the user's roles.
BACKDROP_CACHE_PER_USER The block or element can change depending on the user.
BACKDROP_NO_CACHE The block should not get cached.
CSS_DEFAULT The default group for module CSS files added to the page.
CSS_SYSTEM The default group for system CSS files added to the page.
CSS_THEME The default group for theme CSS files added to the page.
HTTP_REQUEST_TIMEOUT Error code indicating that the request exceeded the specified timeout.
JS_DEFAULT The default group for module JavaScript code added to the page.
JS_LIBRARY The default group for JavaScript and jQuery libraries added to the page.
JS_SETTING The default group for JavaScript settings added to the page.
JS_THEME The default group for theme JavaScript code added to the page.
SAVED_DELETED Return status for saving which deleted an existing item.
SAVED_NEW Return status for saving which involved creating a new item.
SAVED_UPDATED Return status for saving which involved an update to an existing item.