common.inc
Version 1.537.2.25 (checked in on 2007/10/17 at 21:35:41 by goba)
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.
Constants
| Name | Description |
|---|---|
| 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. |
Functions
| Name | Description |
|---|---|
| base_path | Returns the base URL path of the Drupal installation. At the very least, this will always default to /. |
| check_file | |
| check_url | Prepare a URL for use in an HTML attribute. Strips harmful protocols. |
| drupal_access_denied | Generates a 403 error if the request is not allowed. |
| drupal_add_js | Add a JavaScript file to the output. |
| drupal_add_link | Add a <link> tag to the page's HEAD. |
| drupal_attributes | Format an attribute string to insert in a tag. |
| drupal_call_js | Generates a Javascript call, while importing the arguments as is. PHP arrays are turned into JS objects to preserve keys. This means the array keys must conform to JS's member naming rules. |
| drupal_clear_path_cache | Reset the static variable which holds the aliases mapped for this request. |
| drupal_clone | Provide a substitute clone() function for PHP4. |
| drupal_eval | Evaluate a string of PHP code. |
| drupal_get_breadcrumb | Get the breadcrumb trail for the current page. |
| drupal_get_content | Get assigned content. |
| 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. By default the current URL is returned. If a destination exists in the previous request, that... |
| 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_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_query_string_encode | Parse an array into a valid urlencoded query string. |
| drupal_set_breadcrumb | Set the breadcrumb trail for the current page. |
| drupal_set_content | Set content for a specified region. |
| 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_site_offline | Generates a site off-line message |
| drupal_to_js | Converts a PHP variable into its Javascript equivalent. |
| drupal_urlencode | Wrapper around urlencode() which avoids Apache quirks. |
| drupal_valid_token | Validate a token based on $value, the current user session and private key. |
| error_handler | Log errors as defined by administrator Error levels: 0 = Log errors to database. 1 = 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. |
| 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_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. |
| format_xml_elements | Format XML elements. |
| l | Format an internal Drupal link. |
| locale_initialize | Initialize the localization system. |
| message_na | Return a string with a "not applicable" message. |
| page_set_cache | Store the current page in the cache. |
| t | Translate strings to the current locale. |
| url | Generate a URL from a Drupal menu path. Will also pass-through existing URLs. |
| valid_email_address | Verify the syntax of the given e-mail address. |
| valid_url | Verify the syntax of the given URL. |
| xmlrpc | Performs one or more XML-RPC request(s). |
| _drupal_bootstrap_full | |
| _fix_gpc_magic | |
| _fix_gpc_magic_files | Helper function to strip slashes from $_FILES skipping over the tmp_name keys since PHP generates single backslashes for file paths on Windows systems. |
