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

Namesort iconDescription
array2objectConvert an associative array to an anonymous object.
check_file
check_urlPrepare a URL for use in an HTML attribute. Strips harmful protocols.
decode_entitiesDecode all HTML entities (including numerical ones) to regular UTF-8 bytes. Double-escaped entities will only be decoded once ("&amp;lt;" becomes "&lt;", not "<").
drupal_access_deniedGenerates a 403 error if the request is not allowed.
drupal_add_linkAdd a <link> tag to the page's HEAD.
drupal_attributesFormat an attribute string to insert in a tag.
drupal_check_tokenCheck the form token if there is POST data for an authenticated user to defend against cross site request forgeries.
drupal_convert_to_utf8Convert data to UTF-8
drupal_evalEvaluate a string of PHP code.
drupal_get_breadcrumbGet the breadcrumb trail for the current page.
drupal_get_destinationPrepare 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_headersGet the HTTP response headers for the current page.
drupal_get_html_headRetrieve output to be displayed in the head tag of the HTML page.
drupal_get_normal_pathGiven a path alias, return the internal path it represents.
drupal_get_pathReturns the path to a system item (module, theme, etc.).
drupal_get_private_keyEnsure the private key variable used to generate tokens is set.
drupal_get_tokenGenerate a token based on $value, the current user session and private key.
drupal_gotoSend the user to a different Drupal page.
drupal_http_requestPerform an HTTP request.
drupal_map_assocForm an associative array from a linear array.
drupal_not_foundGenerates a 404 error if the request can not be handled.
drupal_page_footerPerform end-of-request tasks.
drupal_rebuild_path_mapRegenerate the path map from the information in the database.
drupal_set_breadcrumbSet the breadcrumb trail for the current page.
drupal_set_headerSet an HTTP response header for the current page.
drupal_set_html_headAdd output to the head tag of the HTML page. This function can be called as long the headers aren't sent.
drupal_valid_tokenValidate a token based on $value, the current user session and private key or penultimate private key.
drupal_xml_parser_createPrepare a new XML parser.
error_handlerLog errors as defined by administrator Error levels: 1 = Log errors to database. 2 = Log errors to database and to screen.
fix_gpc_magicCorrect double-escaping problems caused by "magic quotes" in some PHP installations.
flood_is_allowedCheck 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_eventRegister an event for the current visitor (hostname/IP) to the flood control mechanism.
formGenerate a form from a set of form elements.
format_dateFormat a date with the given configured format or a custom format string.
format_intervalFormat a time interval with the requested granularity.
format_nameFormat a username.
format_pluralFormat a string containing a count of items.
format_rss_channelFormats an RSS channel.
format_rss_itemFormat a single RSS item.
format_sizeGenerate a string representation for the given byte count.
form_buttonFormat an action button.
form_checkboxFormat a checkbox.
form_checkboxesFormat a set of checkboxes.
form_fileFormat a file upload field.
form_get_errorsReturn an associative array of all errors.
form_groupFormat a group of form items.
form_hiddenStore data in a hidden form field.
form_itemFormat a general form item.
form_passwordFormat a single-line text field that does not display its contents visibly.
form_radioFormat a radio button.
form_radiosFormat a set of radio buttons.
form_selectFormat a dropdown menu or scrolling selection box.
form_set_errorFile an error against the form element with the specified name.
form_submitFormat a form submit button.
form_textareaFormat a multiple-line text field.
form_textfieldFormat a single-line text field.
form_tokenGenerate a form token based on the session and the private key to defend against cross site request forgeries.
form_weightFormat a weight selection menu.
lFormat an internal Drupal link.
locale_initializeInitialize the localization system.
message_accessReturn a string with an "access denied" message.
message_naReturn a string with a "not applicable" message.
mime_header_encodeEncodes MIME/HTTP header values that contain non-ASCII, UTF-8 encoded characters.
object2arrayConvert an object to an associative array.
string_lengthCount the amount of characters in a UTF-8 string. This is less than or equal to the byte count.
tTranslate strings to the current locale.
truncate_utf8Truncate a UTF-8-encoded string safely.
urlGenerate an internal Drupal URL.
valid_email_addressVerify the syntax of the given e-mail address.
valid_urlVerify the syntax of the given URL.
_decode_entitiesHelper function for decode_entities
_fix_gpc_magic
_form_get_class
_form_get_errorReturn the error message filed against the form with the specified name.
 
 

Drupal is a registered trademark of Dries Buytaert.