common.inc
Version
1.434.2.22 (checked in on 2006/10/18 at 20:14:08 by killes)
Description
Common functions that many Drupal 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.
Functions
| Name | Description |
|---|---|
| array2object | Convert an associative array to an anonymous object. |
| check_file | |
| check_url | Prepare a URL for use in an HTML attribute. Strips harmful protocols. |
| decode_entities | Decode all HTML entities (including numerical ones) to regular UTF-8 bytes. Double-escaped entities will only be decoded once ("&lt;" becomes "<", not "<"). |
| drupal_access_denied | Generates a 403 error if the request is not allowed. |
| drupal_add_link | Add a <link> tag to the page's HEAD. |
| drupal_attributes | Format an attribute string to insert in a tag. |
| drupal_check_token | Check the form token if there is POST data for an authenticated user to defend against cross site request forgeries. |
| drupal_convert_to_utf8 | Convert data to UTF-8 |
| drupal_eval | Evaluate a string of PHP code. |
| drupal_get_breadcrumb | Get the breadcrumb trail for the current page. |
| drupal_get_destination | Prepare a destination query string for use in combination with drupal_goto(). Used to direct the user back to the referring page after completing a form. See alsodrupal_goto() |
| drupal_get_headers | Get the HTTP response headers for the current page. |
| drupal_get_html_head | Retrieve output to be displayed in the head tag of the HTML page. |
| drupal_get_normal_path | Given a path alias, return the internal path it represents. |
| drupal_get_path | Returns the path to a system item (module, theme, etc.). |
| drupal_get_private_key | Ensure the private key variable used to generate tokens is set. |
| drupal_get_token | Generate a token based on $value, the current user session and private key. |
| drupal_goto | Send the user to a different Drupal page. |
| drupal_http_request | Perform an HTTP request. |
| drupal_map_assoc | Form an associative array from a linear array. |
| drupal_not_found | Generates a 404 error if the request can not be handled. |
| drupal_page_footer | Perform end-of-request tasks. |
| drupal_rebuild_path_map | Regenerate the path map from the information in the database. |
| drupal_set_breadcrumb | Set the breadcrumb trail for the current page. |
| drupal_set_header | Set an HTTP response header for the current page. |
| drupal_set_html_head | Add output to the head tag of the HTML page. This function can be called as long the headers aren't sent. |
| drupal_valid_token | Validate a token based on $value, the current user session and private key or penultimate private key. |
| drupal_xml_parser_create | Prepare a new XML parser. |
| error_handler | Log errors as defined by administrator Error levels: 1 = Log errors to database. 2 = Log errors to database and to screen. |
| fix_gpc_magic | Correct double-escaping problems caused by "magic quotes" in some PHP installations. |
| flood_is_allowed | Check if the current visitor (hostname/IP) is allowed to proceed with the specified event. The user is allowed to proceed if he did not trigger the specified event more than $threshold times per hour. |
| flood_register_event | Register an event for the current visitor (hostname/IP) to the flood control mechanism. |
| form | Generate a form from a set of form elements. |
| format_date | Format a date with the given configured format or a custom format string. |
| format_interval | Format a time interval with the requested granularity. |
| format_name | Format a username. |
| format_plural | Format a string containing a count of items. |
| format_rss_channel | Formats an RSS channel. |
| format_rss_item | Format a single RSS item. |
| format_size | Generate a string representation for the given byte count. |
| form_button | Format an action button. |
| form_checkbox | Format a checkbox. |
| form_checkboxes | Format a set of checkboxes. |
| form_file | Format a file upload field. |
| form_get_errors | Return an associative array of all errors. |
| form_group | Format a group of form items. |
| form_hidden | Store data in a hidden form field. |
| form_item | Format a general form item. |
| form_password | Format a single-line text field that does not display its contents visibly. |
| form_radio | Format a radio button. |
| form_radios | Format a set of radio buttons. |
| form_select | Format a dropdown menu or scrolling selection box. |
| form_set_error | File an error against the form element with the specified name. |
| form_submit | Format a form submit button. |
| form_textarea | Format a multiple-line text field. |
| form_textfield | Format a single-line text field. |
| form_token | Generate a form token based on the session and the private key to defend against cross site request forgeries. |
| form_weight | Format a weight selection menu. |
| l | Format an internal Drupal link. |
| locale_initialize | Initialize the localization system. |
| message_access | Return a string with an "access denied" message. |
| message_na | Return a string with a "not applicable" message. |
| mime_header_encode | Encodes MIME/HTTP header values that contain non-ASCII, UTF-8 encoded characters. |
| object2array | Convert an object to an associative array. |
| string_length | Count the amount of characters in a UTF-8 string. This is less than or equal to the byte count. |
| t | Translate strings to the current locale. |
| truncate_utf8 | Truncate a UTF-8-encoded string safely. |
| url | Generate an internal Drupal URL. |
| valid_email_address | Verify the syntax of the given e-mail address. |
| valid_url | Verify the syntax of the given URL. |
| _decode_entities | Helper function for decode_entities |
| _fix_gpc_magic | |
| _form_get_class | |
| _form_get_error | Return the error message filed against the form with the specified name. |
