C:/drupal/includes/common.inc File Reference

Go to the source code of this file.


Enumerations

enum  SAVED_NEW
enum  SAVED_UPDATED
enum  SAVED_DELETED

Functions

 drupal_set_content ($region=NULL, $data=NULL)
 drupal_get_content ($region=NULL, $delimiter= ' ')
 drupal_set_breadcrumb ($breadcrumb=NULL)
 drupal_get_breadcrumb ()
 drupal_set_html_head ($data=NULL)
 drupal_get_html_head ()
 drupal_clear_path_cache ()
 drupal_set_header ($header=NULL)
 drupal_get_headers ()
 drupal_add_feed ($url=NULL, $title= '')
 drupal_get_feeds ($delimiter="\n")
 drupal_error_handler ($errno, $message, $filename, $line, $context)
 _fix_gpc_magic (&$item)
 _fix_gpc_magic_files (&$item, $key)
 fix_gpc_magic ()
 t ($string, $args=array(), $langcode=NULL)
 valid_email_address ($mail)
 valid_url ($url, $absolute=FALSE)
 flood_register_event ($name)
 flood_is_allowed ($name, $threshold)
 check_file ($filename)
 check_url ($uri)
 format_rss_channel ($title, $link, $description, $items, $langcode=NULL, $args=array())
 format_rss_item ($title, $link, $description, $args=array())
 format_xml_elements ($array)
 format_plural ($count, $singular, $plural, $args=array(), $langcode=NULL)
 parse_size ($size)
 format_size ($size, $langcode=NULL)
 format_interval ($timestamp, $granularity=2, $langcode=NULL)
 format_date ($timestamp, $type= 'medium', $format= '', $timezone=NULL, $langcode=NULL)
 url ($path=NULL, $options=array())
 drupal_attributes ($attributes=array())
 l ($text, $path, $options=array())
 drupal_page_footer ()
 drupal_map_assoc ($array, $function=NULL)
 drupal_eval ($code)
 drupal_get_path ($type, $name)
 base_path ()
 drupal_add_link ($attributes)
 drupal_add_css ($path=NULL, $type= 'module', $media= 'all', $preprocess=TRUE)
 drupal_get_css ($css=NULL)
 drupal_build_css_cache ($types, $filename)
 _drupal_build_css_path ($matches, $base=NULL)
 drupal_load_stylesheet ($file, $optimize=NULL)
 _drupal_load_stylesheet ($matches)
 drupal_clear_css_cache ()
 drupal_add_js ($data=NULL, $type= 'module', $scope= 'header', $defer=FALSE, $cache=TRUE, $preprocess=TRUE)
 drupal_get_js ($scope= 'header', $javascript=NULL)
 drupal_add_tabledrag ($table_id, $action, $relationship, $group, $subgroup=NULL, $source=NULL, $hidden=TRUE, $limit=0)
 drupal_build_js_cache ($files, $filename)
 drupal_clear_js_cache ()
 drupal_to_js ($var)
 drupal_json ($var=NULL)
 drupal_urlencode ($text)
 drupal_random_bytes ($count)
 drupal_get_private_key ()
 drupal_get_token ($value= '')
 drupal_valid_token ($token, $value= '', $skip_anonymous=FALSE)
 xmlrpc ($url)
 _drupal_bootstrap_full ()
 page_set_cache ()
 drupal_cron_run ()
 drupal_cron_cleanup ()
 drupal_system_listing ($mask, $directory, $key= 'name', $min_depth=1)
 drupal_alter ($type, &$data)
 drupal_render (&$elements)
 element_sort ($a, $b)
 element_property ($key)
 element_properties ($element)
 element_child ($key)
 element_children ($element)
 drupal_common_theme ()
 drupal_parse_info_file ($filename)
 watchdog_severity_levels ()
 drupal_explode_tags ($tags)
 drupal_implode_tags ($tags)
 drupal_flush_all_caches ()
 _drupal_flush_css_js ()
HTTP handling
Functions to properly handle HTTP responses.

 drupal_query_string_encode ($query, $exclude=array(), $parent= '')
 drupal_get_destination ()
 drupal_goto ($path= '', $query=NULL, $fragment=NULL, $http_response_code=302)
 drupal_site_offline ()
 drupal_not_found ()
 drupal_access_denied ()
 drupal_http_request ($url, $headers=array(), $method= 'GET', $data=NULL, $retry=3)
 drupal_get_schema ($table=NULL, $rebuild=FALSE)
 drupal_install_schema ($module)
 drupal_uninstall_schema ($module)
 drupal_get_schema_unprocessed ($module, $table=NULL)
 _drupal_initialize_schema ($module, &$schema)
 drupal_schema_fields_sql ($table, $prefix=NULL)
 drupal_write_record ($table, &$object, $update=array())


Detailed 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.

Definition in file common.inc.


Enumeration Type Documentation

Return status for saving which deleted an existing item.

Definition at line 25 of file common.inc.

enum SAVED_NEW

Return status for saving which involved creating a new item.

Definition at line 15 of file common.inc.

Return status for saving which involved an update to an existing item.

Definition at line 20 of file common.inc.


Function Documentation

_drupal_bootstrap_full (  ) 

Definition at line 2425 of file common.inc.

References drupal_set_header(), fix_gpc_magic(), module_invoke_all(), module_load_all(), and unicode_check().

Referenced by _drupal_bootstrap().

Here is the call graph for this function:

_drupal_build_css_path ( matches,
base = NULL 
)

Helper function for drupal_build_css_cache().

This function will prefix all paths within a CSS file.

Definition at line 1795 of file common.inc.

Referenced by drupal_build_css_cache().

_drupal_flush_css_js (  ) 

Helper function to change query-strings on css/js files.

Changes the character added to all css/js files as dummy query-string, so that all browsers are forced to reload fresh files. We keep 20 characters history (FIFO) to avoid repeats, but only the first (newest) character is actually used on urls, to keep them short. This is also called from update.php.

Definition at line 3564 of file common.inc.

References variable_get(), and variable_set().

Referenced by drupal_flush_all_caches(), install_tasks(), DrupalWebTestCase::setUp(), and update_info_page().

Here is the call graph for this function:

_drupal_load_stylesheet ( matches  ) 

Loads stylesheets recursively and returns contents with corrected paths.

This function is used for recursive loading of stylesheets and returns the stylesheet content with all url() paths corrected.

Definition at line 1874 of file common.inc.

References drupal_load_stylesheet().

Here is the call graph for this function:

_fix_gpc_magic ( &$  item  ) 

Definition at line 613 of file common.inc.

_fix_gpc_magic_files ( &$  item,
key 
)

Helper function to strip slashes from $_FILES skipping over the tmp_name keys since PHP generates single backslashes for file paths on Windows systems.

tmp_name does not have backslashes added see

Definition at line 629 of file common.inc.

base_path (  ) 

check_file ( filename  ) 

Definition at line 880 of file common.inc.

check_url ( uri  ) 

drupal_access_denied (  ) 

drupal_add_css ( path = NULL,
type = 'module',
media = 'all',
preprocess = TRUE 
)

Adds a CSS file to the stylesheet queue.

Parameters:
$path (optional) The path to the CSS file relative to the base_path(), e.g., /modules/devel/devel.css.
Modules should always prefix the names of their CSS files with the module name, for example: system-menus.css rather than simply menus.css. Themes can override module-supplied CSS files based on their filenames, and this prefixing helps prevent confusing name collisions for theme developers. See drupal_get_css where the overrides are performed.

If the direction of the current language is right-to-left (Hebrew, Arabic, etc.), the function will also look for an RTL CSS file and append it to the list. The name of this file should have an '-rtl.css' suffix. For example a CSS file called 'name.css' will have a 'name-rtl.css' file added to the list, if exists in the same directory. This CSS file should contain overrides for properties which should be reversed or otherwise different in a right-to-left display.

Parameters:
$type (optional) The type of stylesheet that is being added. Types are: module or theme.
$media (optional) The media type for the stylesheet, e.g., all, print, screen.
$preprocess (optional) Should this CSS file be aggregated and compressed if this feature has been turned on under the performance section?
What does this actually mean? CSS preprocessing is the process of aggregating a bunch of separate CSS files into one file that is then compressed by removing all extraneous white space.

The reason for merging the CSS files is outlined quite thoroughly here: "Load fewer external objects. Due to request overhead, one bigger file just loads faster than two smaller ones half its size."

However, you should *not* preprocess every file as this can lead to redundant caches. You should set $preprocess = FALSE when:

  • Your styles are only used rarely on the site. This could be a special admin page, the homepage, or a handful of pages that does not represent the majority of the pages on your site.

Typical candidates for caching are for example styles for nodes across the site, or used in the theme.

Returns:
An array of CSS files.

Definition at line 1632 of file common.inc.

References $type.

Referenced by _drupal_maintenance_theme(), _init_theme(), _locale_translate_language_list(), block_admin_display_form(), drupal_get_css(), DrupalReporter::DrupalReporter(), help_main(), openid_user_identities(), template_preprocess_maintenance_page(), template_preprocess_page(), theme_profile_admin_overview(), theme_taxonomy_overview_terms(), theme_taxonomy_term_page(), theme_update_report(), and tracker_page().

drupal_add_feed ( url = NULL,
title = '' 
)

Add a feed URL for the current page.

Parameters:
$url A url for the feed.
$title The title of the feed.

Definition at line 162 of file common.inc.

References $title, $url, drupal_add_link(), and theme().

Referenced by aggregator_page_category(), aggregator_page_last(), blog_page_last(), blog_page_user(), drupal_get_feeds(), and taxonomy_term_page().

Here is the call graph for this function:

drupal_add_js ( data = NULL,
type = 'module',
scope = 'header',
defer = FALSE,
cache = TRUE,
preprocess = TRUE 
)

Add a JavaScript file, setting or inline code to the page.

The behavior of this function depends on the parameters it is called with. Generally, it handles the addition of JavaScript to the page, either as reference to an existing file or as inline code. The following actions can be performed using this function:

  • Add a file ('core', 'module' and 'theme'): Adds a reference to a JavaScript file to the page. JavaScript files are placed in a certain order, from 'core' first, to 'module' and finally 'theme' so that files, that are added later, can override previously added files with ease.

  • Add inline JavaScript code ('inline'): Executes a piece of JavaScript code on the current page by placing the code directly in the page. This can, for example, be useful to tell the user that a new message arrived, by opening a pop up, alert box etc.

  • Add settings ('setting'): Adds a setting to Drupal's global storage of JavaScript settings. Per-page settings are required by some modules to function properly. The settings will be accessible at Drupal.settings.

Parameters:
$data (optional) If given, the value depends on the $type parameter:
  • 'core', 'module' or 'theme': Path to the file relative to base_path().
  • 'inline': The JavaScript code that should be placed in the given scope.
  • 'setting': An array with configuration options as associative array. The array is directly placed in Drupal.settings. You might want to wrap your actual configuration settings in another variable to prevent the pollution of the Drupal.settings namespace.
$type (optional) The type of JavaScript that should be added to the page. Allowed values are 'core', 'module', 'theme', 'inline' and 'setting'. You can, however, specify any value. It is treated as a reference to a JavaScript file. Defaults to 'module'.
$scope (optional) The location in which you want to place the script. Possible values are 'header' and 'footer' by default. If your theme implements different locations, however, you can also use these.
$defer (optional) If set to TRUE, the defer attribute is set on the <script> tag. Defaults to FALSE. This parameter is not used with $type == 'setting'.
$cache (optional) If set to FALSE, the JavaScript file is loaded anew on every page call, that means, it is not cached. Defaults to TRUE. Used only when $type references a JavaScript file.
$preprocess (optional) Should this JS file be aggregated if this feature has been turned on under the performance section?
Returns:
If the first parameter is NULL, the JavaScript array that has been built so far for $scope is returned. If the first three parameters are NULL, an array with all scopes is returned.

Definition at line 1945 of file common.inc.

References $type, and base_path().

Referenced by _batch_progress_page_js(), _init_theme(), drupal_add_tabledrag(), drupal_get_js(), form_expand_ahah(), install_tasks(), node_filter_form(), system_clean_url_settings(), system_date_time_settings(), theme_fieldset(), theme_profile_admin_overview(), theme_table(), theme_table_select_header_cell(), theme_taxonomy_overview_terms(), theme_textarea(), theme_textfield(), user_admin_settings(), and user_filter_form().

Here is the call graph for this function:

drupal_add_link ( attributes  ) 

Add a <link> tag to the page's HEAD.

Definition at line 1577 of file common.inc.

References $attributes, drupal_attributes(), and drupal_set_html_head().

Referenced by drupal_add_feed().

Here is the call graph for this function:

drupal_add_tabledrag ( table_id,
action,
relationship,
group,
subgroup = NULL,
source = NULL,
hidden = TRUE,
limit = 0 
)

Assist in adding the tableDrag JavaScript behavior to a themed table.

Draggable tables should be used wherever an outline or list of sortable items needs to be arranged by an end-user. Draggable tables are very flexible and can manipulate the value of form elements placed within individual columns.

To set up a table to use drag and drop in place of weight select-lists or in place of a form that contains parent relationships, the form must be themed into a table. The table must have an id attribute set. If using theme_table(), the id may be set as such:

 $output = theme('table', $header, $rows, array('id' => 'my-module-table'));
 return $output;

In the theme function for the form, a special class must be added to each form element within the same column, "grouping" them together.

In a situation where a single weight column is being sorted in the table, the classes could be added like this (in the theme function):

 $form['my_elements'][$delta]['weight']['#attributes']['class'] = "my-elements-weight";

Each row of the table must also have a class of "draggable" in order to enable the drag handles:

 $row = array(...);
 $rows[] = array(
   'data' => $row,
   'class' => 'draggable',
 );

When tree relationships are present, the two additional classes 'tabledrag-leaf' and 'tabledrag-root' can be used to refine the behavior:

  • Rows with the 'tabledrag-leaf' class cannot have child rows.
  • Rows with the 'tabledrag-root' class cannot be nested under a parent row.

Calling drupal_add_tabledrag() would then be written as such:

 drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight');

In a more complex case where there are several groups in one column (such as the block regions on the admin/build/block page), a separate subgroup class must also be added to differentiate the groups.

 $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = "my-elements-weight my-elements-weight-" . $region;

$group is still 'my-element-weight', and the additional $subgroup variable will be passed in as 'my-elements-weight-' . $region. This also means that you'll need to call drupal_add_tabledrag() once for every region added.

 foreach ($regions as $region) {
   drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight', 'my-elements-weight-' . $region);
 }

In a situation where tree relationships are present, adding multiple subgroups is not necessary, because the table will contain indentations that provide enough information about the sibling and parent relationships. See theme_menu_overview_form() for an example creating a table containing parent relationships.

Please note that this function should be called from the theme layer, such as in a .tpl.php file, theme_ function, or in a template_preprocess function, not in a form declartion. Though the same JavaScript could be added to the page using drupal_add_js() directly, this function helps keep template files clean and readable. It also prevents tabledrag.js from being added twice accidentally.

Parameters:
$table_id String containing the target table's id attribute. If the table does not have an id, one will need to be set, such as
$action String describing the action to be done on the form item. Either 'match' 'depth', or 'order'. Match is typically used for parent relationships. Order is typically used to set weights on other form elements with the same group. Depth updates the target element with the current indentation.
$relationship String describing where the $action variable should be performed. Either 'parent', 'sibling', 'group', or 'self'. Parent will only look for fields up the tree. Sibling will look for fields in the same group in rows above and below it. Self affects the dragged row itself. Group affects the dragged row, plus any children below it (the entire dragged group).
$group A class name applied on all related form elements for this action.
$subgroup (optional) If the group has several subgroups within it, this string should contain the class name identifying fields in the same subgroup.
$source (optional) If the $action is 'match', this string should contain the class name identifying what field will be used as the source value when matching the value in $subgroup.
$hidden (optional) The column containing the field elements may be entirely hidden from view dynamically when the JavaScript is loaded. Set to FALSE if the column should not be hidden.
$limit (optional) Limit the maximum amount of parenting in this table.
See also:
block-admin-display-form.tpl.php

theme_menu_overview_form()

Definition at line 2196 of file common.inc.

References drupal_add_js().

Referenced by theme_book_admin_table(), theme_filter_admin_order(), theme_filter_admin_overview(), theme_menu_overview_form(), theme_profile_admin_overview(), theme_taxonomy_overview_terms(), and theme_taxonomy_overview_vocabularies().

Here is the call graph for this function:

drupal_alter ( type,
&$  data 
)

This dispatch function hands off structured Drupal arrays to type-specific *_alter implementations. It ensures a consistent interface for all altering operations.

Parameters:
$type The data type of the structured array. 'form', 'links', 'node_content', and so on are several examples.
$data The structured array to be altered.
... Any additional params will be passed on to the called hook_$type_alter functions.

Definition at line 2643 of file common.inc.

References $type, and module_implements().

Referenced by _menu_link_translate(), _theme_build_registry(), actions_list(), drupal_get_schema(), drupal_mail(), drupal_prepare_form(), menu_link_save(), menu_router_build(), module_rebuild_cache(), and update_calculate_project_data().

Here is the call graph for this function:

drupal_attributes ( attributes = array()  ) 

Format an attribute string to insert in a tag.

Parameters:
$attributes An associative array of HTML attributes.
Returns:
An HTML string ready for insertion in a tag.

Definition at line 1377 of file common.inc.

References $attributes, $value, and check_plain().

Referenced by _theme_table_cell(), drupal_add_link(), format_xml_elements(), l(), template_preprocess_user_profile_category(), template_preprocess_user_profile_item(), theme_button(), theme_checkbox(), theme_fieldset(), theme_file(), theme_form(), theme_hidden(), theme_image(), theme_image_button(), theme_item_list(), theme_links(), theme_password(), theme_radio(), theme_select(), theme_table(), theme_textarea(), and theme_textfield().

Here is the call graph for this function:

drupal_build_css_cache ( types,
filename 
)

Aggregate and optimize CSS files, putting them in the files directory.

Parameters:
$types An array of types of CSS files (e.g., screen, print) to aggregate and compress into one file.
$filename The name of the aggregate CSS file.
Returns:
The name of the CSS file.

Definition at line 1755 of file common.inc.

References $type, _drupal_build_css_path(), base_path(), drupal_load_stylesheet(), file_check_directory(), file_create_path(), and file_save_data().

Referenced by drupal_get_css().

Here is the call graph for this function:

drupal_build_js_cache ( files,
filename 
)

Aggregate JS files, putting them in the files directory.

Parameters:
$files An array of JS files to aggregate and compress into one file.
$filename The name of the aggregate JS file.
Returns:
The name of the JS file.

Definition at line 2227 of file common.inc.

References file_check_directory(), file_create_path(), and file_save_data().

Referenced by drupal_get_js().

Here is the call graph for this function:

drupal_clear_css_cache (  ) 

Delete all cached CSS files.

Definition at line 1885 of file common.inc.

References file_create_path(), and file_scan_directory().

Referenced by drupal_flush_all_caches(), system_modules_submit(), and system_themes_form().

Here is the call graph for this function:

drupal_clear_js_cache (  ) 

Delete all cached JS files.

Definition at line 2253 of file common.inc.

References file_create_path(), file_scan_directory(), and variable_set().

Referenced by drupal_flush_all_caches(), and system_modules_submit().

Here is the call graph for this function:

drupal_clear_path_cache (  ) 

Reset the static variable which holds the aliases mapped for this request.

Definition at line 124 of file common.inc.

References drupal_lookup_path().

Here is the call graph for this function:

drupal_common_theme (  ) 

Provide theme registration for themes across .inc files.

Definition at line 2824 of file common.inc.

drupal_cron_cleanup (  ) 

Shutdown function for cron cleanup.

Definition at line 2553 of file common.inc.

References variable_del(), variable_get(), and watchdog().

Here is the call graph for this function:

drupal_cron_run (  ) 

Executes a cron run when called

Returns:
Returns TRUE if ran successfully

Definition at line 2504 of file common.inc.

References module_invoke_all(), variable_del(), variable_get(), variable_set(), and watchdog().

Referenced by system_run_cron().

Here is the call graph for this function:

drupal_error_handler ( errno,
message,
filename,
line,
context 
)

End of "HTTP handling". Log errors as defined by administrator.

Error levels:

  • 0 = Log errors to database.
  • 1 = Log errors to database and to screen.

Definition at line 573 of file common.inc.

References drupal_set_message(), variable_get(), and watchdog().

Here is the call graph for this function:

drupal_eval ( code  ) 

Evaluate a string of PHP code.

This is a wrapper around PHP's eval(). It uses output buffering to capture both returned and printed text. Unlike eval(), we require code to be surrounded by <?php ?> tags; in other words, we evaluate the code as if it were a stand-alone PHP file.

Using this wrapper also ensures that the PHP code which is evaluated can not overwrite any variables in the calling code, unlike a regular eval() call.

Parameters:
$code The code to evaluate.
Returns:
A string containing the printed output of the code, followed by the returned output of the code.

Definition at line 1524 of file common.inc.

References $output, drupal_get_path(), and print.

Here is the call graph for this function:

drupal_explode_tags ( tags  ) 

Explode a string of given tags into an array.

Definition at line 3492 of file common.inc.

Referenced by taxonomy_autocomplete().

drupal_flush_all_caches (  ) 

Flush all cached data on the site.

Empties cache tables, rebuilds the menu cache and theme registries, and exposes a hook for other modules to clear their own cache data as well.

Definition at line 3535 of file common.inc.

References _drupal_flush_css_js(), cache_clear_all(), drupal_clear_css_cache(), drupal_clear_js_cache(), drupal_rebuild_code_registry(), drupal_rebuild_theme_registry(), menu_rebuild(), and module_invoke_all().

Referenced by system_clear_cache_submit(), and update_finished().

Here is the call graph for this function:

drupal_get_breadcrumb (  ) 

Get the breadcrumb trail for the current page.

Definition at line 89 of file common.inc.

References drupal_set_breadcrumb(), and menu_get_active_breadcrumb().

Referenced by aggregator_page_category(), and template_preprocess_page().

Here is the call graph for this function:

drupal_get_content ( region = NULL,
delimiter = ' ' 
)

Get assigned content.

Parameters:
$region A specified region to fetch content for. If NULL, all regions will be returned.
$delimiter Content to be inserted between exploded array elements.

Definition at line 53 of file common.inc.

References $content, and drupal_set_content().

Referenced by template_preprocess_maintenance_page(), and theme_blocks().

Here is the call graph for this function:

drupal_get_css ( css = NULL  ) 

Returns a themed representation of all stylesheets that should be attached to the page.

It loads the CSS in order, with 'module' first, then 'theme' afterwards. This ensures proper cascading of styles so themes can easily override module styles through CSS selectors.

Themes may replace module-defined CSS files by adding a stylesheet with the same filename. For example, themes/garland/system-menus.css would replace modules/system/system-menus.css. This allows themes to override complete CSS files, rather than specific selectors, when necessary.

If the original CSS file is being overridden by a theme, the theme is responsible for supplying an accompanying RTL CSS file to replace the module's.

Parameters:
$css (optional) An array of CSS files. If no array is provided, the default stylesheets array is used instead.
Returns:
A string of XHTML CSS tags.

Definition at line 1679 of file common.inc.

References $output, $type, base_path(), drupal_add_css(), drupal_build_css_cache(), file_directory_path(), and variable_get().

Referenced by template_preprocess_maintenance_page(), and template_preprocess_page().

Here is the call graph for this function:

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 destination is returned. As such, a destination can persist across multiple pages.

See also:
drupal_goto()

Definition at line 240 of file common.inc.

References drupal_query_string_encode().

Referenced by comment_admin_overview(), contact_user_page(), node_admin_nodes(), node_form_delete_submit(), path_admin_overview(), statistics_top_visitors(), taxonomy_overview_terms(), taxonomy_term_confirm_parents(), theme_book_admin_table(), user_admin_account(), and user_edit_delete_submit().

Here is the call graph for this function:

drupal_get_feeds ( delimiter = "\n"  ) 

Get the feed URLs for the current page.

Parameters:
$delimiter A delimiter to split feeds by.

Definition at line 182 of file common.inc.

References drupal_add_feed().

Referenced by template_preprocess_page().

Here is the call graph for this function:

drupal_get_headers (  ) 

Get the HTTP response headers for the current page.

Definition at line 150 of file common.inc.

References drupal_set_header().

Referenced by page_set_cache().

Here is the call graph for this function:

drupal_get_html_head (  ) 

Retrieve output to be displayed in the head tag of the HTML page.

Definition at line 116 of file common.inc.

References $output, and drupal_set_html_head().

Referenced by template_preprocess_maintenance_page(), and template_preprocess_page().

Here is the call graph for this function:

drupal_get_js ( scope = 'header',
javascript = NULL 
)

Returns a themed presentation of all JavaScript code for the current page.

References to JavaScript files are placed in a certain order: first, all 'core' files, then all 'module' and finally all 'theme' JavaScript files are added to the page. Then, all settings are output, followed by 'inline' JavaScript code. If running update.php, all preprocessing is disabled.

Parameters:
$scope (optional) The scope for which the JavaScript rules should be returned. Defaults to 'header'.
$javascript (optional) An array with all JavaScript code. Defaults to the default JavaScript array for the given scope.
Returns:
All JavaScript code segments and includes for the scope as HTML tags.

Definition at line 2019 of file common.inc.

References $output, $type, base_path(), drupal_add_js(), drupal_build_js_cache(), drupal_to_js(), file_directory_path(), and variable_get().

Referenced by template_preprocess_maintenance_page(), template_preprocess_page(), and theme_closure().

Here is the call graph for this function:

drupal_get_path ( type,
name 
)

Returns the path to a system item (module, theme, etc.).

Parameters:
$type The type of the item (i.e. theme, theme_engine, module).
$name The name of the item for which the path is requested.
Returns:
The path to the requested item.

Definition at line 1562 of file common.inc.

References $name, $type, and drupal_get_filename().

Referenced by _drupal_maintenance_theme(), _locale_translate_language_list(), _menu_site_is_offline(), _theme_build_registry(), block_admin_display_form(), drupal_eval(), DrupalReporter::DrupalReporter(), DrupalTests::getFiles(), help_main(), help_page(), install_tasks(), module_load_include(), node_mass_update(), openid_user_identities(), system_clean_url_settings(), system_date_time_settings(), theme_profile_admin_overview(), theme_taxonomy_overview_terms(), theme_taxonomy_term_page(), theme_update_report(), tracker_page(), and user_admin_settings().

Here is the call graph for this function:

drupal_get_private_key (  ) 

Ensure the private key variable used to generate tokens is set.

Returns:
The private key.

Definition at line 2360 of file common.inc.

References drupal_random_bytes(), variable_get(), and variable_set().

Referenced by _update_refresh(), and drupal_get_token().

Here is the call graph for this function:

drupal_get_token ( value = ''  ) 

Generate a token based on $value, the current user session and private key.

Parameters:
$value An additional value to base the token on.

Definition at line 2374 of file common.inc.

References $value, and drupal_get_private_key().

Referenced by _batch_page(), batch_process(), and drupal_prepare_form().

Here is the call graph for this function:

drupal_goto ( path = '',
query = NULL,
fragment = NULL,
http_response_code = 302 
)

Send the user to a different Drupal page.

This issues an on-site HTTP redirect. The function makes sure the redirected URL is formatted correctly.

Usually the redirected URL is constructed from this function's input parameters. However you may override that behavior by setting a destination in either the $_REQUEST-array (i.e. by using the query string of an URI) or the $_REQUEST['edit']-array (i.e. by using a hidden form field). This is used to direct the user back to the proper page after completing a form. For example, after editing a post on the 'admin/content/node'-page or after having logged on using the 'user login'-block in a sidebar. The function drupal_get_destination() can be used to help set the destination URL.

Drupal will ensure that messages set by drupal_set_message() and other session data are written to the database before the user is redirected.

This function ends the request; use it rather than a print theme('page') statement in your menu callback.

Parameters:
$path A Drupal path or a full URL.
$query A query string component, if any.
$fragment A destination fragment identifier (named anchor).
$http_response_code Valid values for an actual "goto" as per RFC 2616 section 10.3 are:
  • 301 Moved Permanently (the recommended value for most redirects)
  • 302 Found (default in Drupal and PHP, sometimes used for spamming search engines)
  • 303 See Other
  • 304 Not Modified
  • 305 Use Proxy
  • 307 Temporary Redirect (alternative to "503 Site Down for Maintenance") Note: Other values are defined by RFC 2616, but are rarely used and poorly supported.
See also:
drupal_get_destination()

Definition at line 296 of file common.inc.

References $url, exit, module_invoke_all(), and url().

Referenced by _batch_finished(), aggregator_admin_refresh_feed(), batch_process(), comment_admin_overview_validate(), comment_multiple_delete_confirm(), comment_reply(), drupal_redirect_form(), filter_admin_delete(), locale_languages_delete_form(), locale_translate_delete(), locale_translate_edit_form(), node_configure_validate(), openid_authentication_page(), openid_user_delete(), search_admin_settings_validate(), search_view(), system_modules_uninstall_validate(), system_run_cron(), trigger_assign(), trigger_unassign(), trigger_unassign_submit(), update_manual_status(), user_admin_role(), user_logout(), and user_pass_reset().

Here is the call graph for this function:

drupal_http_request ( url,
headers = array(),
method = 'GET',
data = NULL,
retry = 3 
)

Perform an HTTP request.

This is a flexible and powerful HTTP client implementation. Correctly handles GET, POST, PUT or any other HTTP requests. Handles redirects.

Parameters:
$url A string containing a fully qualified URI.
$headers An array containing an HTTP header => value pair.
$method A string defining the HTTP request to use.
$data A string containing data to include in the request.
$retry An integer representing how many times to retry the request in case of a redirect.
Returns:
An object containing the HTTP request headers, response code, headers, data and redirect status.

Definition at line 416 of file common.inc.

References $header, $result, $url, $value, module_invoke(), t(), and variable_get().

Referenced by _update_refresh(), and _xmlrpc().

Here is the call graph for this function:

drupal_implode_tags ( tags  ) 

Implode an array of tags into a string.

Definition at line 3516 of file common.inc.

drupal_json ( var = NULL  ) 

Return data in JSON format.

This function should be used for JavaScript callback functions returning data in JSON format. It sets the header for JavaScript output.

Parameters:
$var (optional) If set, the variable will be converted to JSON and output.

Definition at line 2277 of file common.inc.

References drupal_set_header(), and drupal_to_js().

Referenced by _batch_do(), book_form_update(), profile_autocomplete(), taxonomy_autocomplete(), and user_autocomplete().

Here is the call graph for this function:

drupal_load_stylesheet ( file,
optimize = NULL 
)

Loads the stylesheet and resolves all commands.

Loads a stylesheet and replaces commands with the contents of the imported file. Use this instead of file_get_contents when processing stylesheets.

The returned contents are compressed removing white space and comments only when CSS aggregation is enabled. This optimization will not apply for color.module enabled themes with CSS aggregation turned off.

Parameters:
$file Name of the stylesheet to be processed.
$optimize Defines if CSS contents should be compressed or not.
Returns:
Contents of the stylesheet including the imported stylesheets.

Definition at line 1830 of file common.inc.

Referenced by _drupal_load_stylesheet(), and drupal_build_css_cache().

drupal_map_assoc ( array,
function = NULL 
)

Form an associative array from a linear array.

This function walks through the provided array and constructs an associative array out of it. The keys of the resulting array will be the values of the input array. The values will be the same as the keys unless a function is specified, in which case the output of the function is used for the values instead.

Parameters:
$array A linear array.
$function A name of a function to apply to all values before output.
Returns:
An associative array.

Definition at line 1490 of file common.inc.

References $result, and $value.

Referenced by aggregator_admin_settings(), aggregator_form_feed(), contact_admin_settings(), dblog_admin_settings(), expand_date(), form_type_select_value(), forum_admin_settings(), node_configure(), node_type_form(), search_admin_settings(), DrupalWebTestCase::setUp(), statistics_access_logging_settings(), system_performance_settings(), system_rss_feeds_settings(), system_themes_form(), taxonomy_form_term(), and update_script_selection_form().

drupal_not_found (  ) 

drupal_page_footer (  ) 

Perform end-of-request tasks.

This function sets the page cache if appropriate, and allows modules to react to the closing of the page by calling hook_exit().

Definition at line 1462 of file common.inc.

References module_invoke_all(), page_set_cache(), registry_cache_hook_implementations(), registry_cache_path_files(), and variable_get().

Here is the call graph for this function:

drupal_parse_info_file ( filename  ) 

End of "ingroup schemaapi". Parse Drupal info file format.

Files should use an ini-like format to specify values. White-space generally doesn't matter, except inside values. e.g.

 *   key = value
 *   key = "value"
 *   key = 'value'
 *   key = "multi-line
 *
 *   value"
 *   key = 'multi-line
 *
 *   value'
 *   key
 *   =
 *   'value'
 * 

Arrays are created using a GET-like syntax:

 *   key[] = "numeric array"
 *   key[index] = "associative array"
 *   key[index][] = "nested numeric array"
 *   key[index][index] = "nested associative array"
 * 

PHP constants are substituted in, but only when used as the entire value:

Comments should start with a semi-colon at the beginning of a line.

This function is NOT for placing arbitrary module-specific settings. Use variable_get() and variable_set() for that.

Information stored in the module.info file:

  • name: The real name of the module for display purposes.
  • description: A brief description of the module.
  • dependencies: An array of shortnames of other modules this module depends on.
  • package: The name of the package of modules this module belongs to.

Example of .info file:

 *   name = Forum
 *   description = Enables threaded discussions about general topics.
 *   dependencies[] = taxonomy
 *   dependencies[] = comment
 *   package = Core - optional
 *   version = VERSION
 * 

Parameters:
$filename The file we are parsing. Accepts file with relative or absolute path.
Returns:
The info array.

Definition at line 3406 of file common.inc.

References $value.

Referenced by help_page(), module_rebuild_cache(), and system_modules_uninstall_confirm_form().

drupal_query_string_encode ( query,
exclude = array(),
parent = '' 
)

Parse an array into a valid urlencoded query string.

Parameters:
$query The array to be processed e.g. $_GET.
$exclude The array filled with keys to be excluded. Use parent[child] to exclude nested items.
$parent Should not be passed, only used in recursive calls.
Returns:
An urlencoded string which can be appended to/as the URL query string.

Definition at line 206 of file common.inc.

References $value, and drupal_urlencode().

Referenced by drupal_get_destination(), pager_get_querystring(), tablesort_get_querystring(), theme_pager_link(), and url().

Here is the call graph for this function:

drupal_random_bytes ( count  ) 

Returns a string of highly randomized bytes (over the full 8-bit range).

This function is better than simply calling mt_rand() or any other built-in PHP function because it can return a long string of bytes (compared to < 4 bytes normally from mt_rand()) and uses the best available pseudo-random source.

Parameters:
$count The number of characters (bytes) to return in the string.

Definition at line 2326 of file common.inc.

References $output.

Referenced by _password_generate_salt(), and drupal_get_private_key().

drupal_render ( &$  elements  ) 

drupal_set_breadcrumb ( breadcrumb = NULL  ) 

Set the breadcrumb trail for the current page.

Parameters:
$breadcrumb Array of links, starting with "home" and proceeding up to but not including the current page.

Definition at line 77 of file common.inc.

Referenced by aggregator_page_category(), comment_reply(), drupal_get_breadcrumb(), and taxonomy_term_page().

drupal_set_content ( region = NULL,
data = NULL 
)

Set content for a specified region.

Parameters:
$region Page region the content is assigned to.
$data Content to be set.

Definition at line 35 of file common.inc.

References $content.

Referenced by drupal_get_content(), install_task_list(), template_preprocess_block_admin_display_form(), and update_task_list().

drupal_set_header ( header = NULL  ) 

Set an HTTP response header for the current page.

Note: When sending a Content-Type header, always include a 'charset' type, too. This is necessary to avoid security bugs (e.g. UTF-7 XSS).

Definition at line 134 of file common.inc.

References $header.

Referenced by _db_error_page(), _drupal_bootstrap_full(), drupal_access_denied(), drupal_get_headers(), drupal_json(), drupal_not_found(), drupal_site_offline(), file_transfer(), theme_aggregator_page_opml(), theme_aggregator_page_rss(), theme_install_page(), and theme_update_page().

drupal_set_html_head ( data = NULL  ) 

Add output to the head tag of the HTML page.

This function can be called as long the headers aren't sent.

Definition at line 104 of file common.inc.

Referenced by _batch_progress_page_nojs(), drupal_add_link(), drupal_get_html_head(), template_preprocess_maintenance_page(), and template_preprocess_page().

drupal_site_offline (  ) 

Generates a site off-line message.

Definition at line 330 of file common.inc.

References drupal_maintenance_theme(), drupal_set_header(), drupal_set_title(), print, t(), theme(), and variable_get().

Here is the call graph for this function:

drupal_system_listing ( mask,
directory,
key = 'name',
min_depth = 1 
)

Return an array of system file objects.

Returns an array of file objects of the given type from the site-wide directory (i.e. modules/), the all-sites directory (i.e. sites/all/modules/), the profiles directory, and site-specific directory (i.e. sites/somesite/modules/). The returned array will be keyed using the key specified (name, basename, filename). Using name or basename will cause site-specific files to be prioritized over similar files in the default directories. That is, if a file with the same name appears in both the site-wide directory and site-specific directory, only the site-specific version will be included.

Parameters:
$mask The regular expression of the files to find.
$directory The subdirectory name in which the files are found. For example, 'modules' will search in both modules/ and sites/somesite/modules/.
$key The key to be passed to file_scan_directory().
$min_depth Minimum depth of directories to return files from.
Returns:
An array of file objects of the specified type.

Definition at line 2590 of file common.inc.

References conf_path(), file_scan_directory(), and variable_get().

Referenced by drupal_find_theme_templates(), drupal_get_install_files(), drupal_verify_profile(), and module_rebuild_cache().

Here is the call graph for this function:

drupal_to_js ( var  ) 

Converts a PHP variable into its Javascript equivalent.

We use HTML-safe strings, i.e. with <, > and & escaped.

Definition at line 2263 of file common.inc.

Referenced by _locale_rebuild_js(), drupal_get_js(), drupal_json(), profile_admin_settings_autocomplete(), and system_date_time_lookup().

drupal_urlencode ( text  ) 

Wrapper around urlencode() which avoids Apache quirks.

Should be used when placing arbitrary data in an URL. Note that Drupal paths are urlencoded() when passed through url() and do not require urlencoding() of individual components.

Notes:

  • For esthetic reasons, we do not escape slashes. This also avoids a 'feature' in Apache where it 404s on any path containing '2F'.
  • mod_rewrite unescapes -encoded ampersands, hashes, and slashes when clean URLs are used, which are interpreted as delimiters by PHP. These characters are double escaped so PHP will still see the encoded version.
  • With clean URLs, Apache changes '//' to '/', so every second slash is double escaped.

Parameters:
$text String to encode

Definition at line 2305 of file common.inc.

References variable_get().

Referenced by _update_build_fetch_url(), drupal_query_string_encode(), and url().

Here is the call graph for this function:

drupal_valid_token ( token,
value = '',
skip_anonymous = FALSE 
)

Validate a token based on $value, the current user session and private key.

Parameters:
$token The token to be validated.
$value An additional value to base the token on.
$skip_anonymous Set to true to skip token validation for anonymous users.
Returns:
True for a valid token, false for an invalid token. When $skip_anonymous is true, the return value will always be true for anonymous users.

Definition at line 2392 of file common.inc.

References $value, and variable_get().

Referenced by drupal_validate_form().

Here is the call graph for this function:

element_child ( key  ) 

Check if the key is a child.

Definition at line 2810 of file common.inc.

Referenced by theme_locale_languages_overview_form().

element_children ( element  ) 

element_properties ( element  ) 

Get properties of a structured array element. Properties begin with '#'.

Definition at line 2803 of file common.inc.

element_property ( key  ) 

Check if the key is a property.

Definition at line 2796 of file common.inc.

element_sort ( a,
b 
)

Function used by uasort to sort structured arrays by weight.

Definition at line 2784 of file common.inc.

fix_gpc_magic (  ) 

Fix double-escaping problems caused by "magic quotes" in some PHP installations.

Definition at line 643 of file common.inc.

Referenced by _drupal_bootstrap_full().

flood_is_allowed ( name,
threshold 
)

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.

Parameters:
$name The name of the event.
$number The maximum number of the specified event per hour (per visitor).
Returns:
True if the user did not exceed the hourly threshold. False otherwise.

Definition at line 875 of file common.inc.

References $name, db_query(), db_result(), and ip_address().

Referenced by contact_site_page(), and contact_user_page().

Here is the call graph for this function:

flood_register_event ( name  ) 

End of "defgroup validation". Register an event for the current visitor (hostname/IP) to the flood control mechanism.

Parameters:
$name The name of an event.

Definition at line 858 of file common.inc.

References $name, db_query(), and ip_address().

Referenced by contact_mail_page_submit(), and contact_mail_user_submit().

Here is the call graph for this function:

l ( text,
path,
options = array() 
)

Format an internal Drupal link.

This function correctly handles aliased paths, and allows themes to highlight links to the current page correctly, so all internal links output by modules should be generated by this function if possible.

Parameters:
$text The text to be enclosed with the anchor tag.
$path The Drupal path being linked to, such as "admin/content/node". Can be an external or internal URL.
  • If you provide the full URL, it will be considered an external URL.
  • If you provide only the path (e.g. "admin/content/node"), it is considered an internal link. In this case, it must be a system URL as the url() function will generate the alias.
  • If you provide '<front>', it generates a link to the site's base URL (again via the url() function).
  • If you provide a path, and 'alias' is set to TRUE (see below), it is used as is.
$options An associative array of additional options, with the following keys:
  • 'attributes' An associative array of HTML attributes to apply to the anchor tag.
  • 'query' A query string to append to the link, or an array of query key/value properties.
  • 'fragment' A fragment identifier (named anchor) to append to the link. Do not include the '#' character.
  • 'absolute' (default FALSE) Whether to force the output to be an absolute link (beginning with http:). Useful for links that will be displayed outside the site, such as in an RSS feed.
  • 'html' (default FALSE) Whether the title is HTML, or just plain-text. For example for making an image a link, this must be set to TRUE, or else you will see the escaped HTML.
  • 'alias' (default FALSE) Whether the given path is an alias already.
Returns:
an HTML string containing a link to the given path.

Definition at line 1430 of file common.inc.

References check_plain(), check_url(), drupal_attributes(), drupal_is_front_page(), and url().

Referenced by _locale_translate_seek(), _menu_overview_tree_form(), _node_mass_update_batch_process(), _update_refresh(), actions_synchronize(), aggregator_form_category_submit(), aggregator_form_feed_submit(), aggregator_page_category(), aggregator_view(), block_admin_display_form(), blog_page_last(), blog_page_user(), book_admin_edit_submit(), book_admin_overview(), book_render(), comment_admin_overview(), comment_admin_overview_submit(), comment_reply(), contact_admin_categories(), contact_admin_edit_submit(), db_status_report(), dblog_event(), dblog_overview(), filter_admin_format_form(), filter_admin_overview(), forum_overview(), help_links_as_list(), menu_edit_item(), menu_get_active_breadcrumb(), node_admin_nodes(), node_form_submit(), node_overview_types(), node_revision_overview(), node_type_form_submit(), openid_user_identities(), path_admin_overview(), poll_page(), profile_admin_overview(), profile_field_delete_submit(), profile_field_form_submit(), search_view(), statistics_access_log(), statistics_node_tracker(), statistics_recent_hits(), statistics_top_visitors(), statistics_user_tracker(), system_admin_by_module(), system_ip_blocking(), system_themes_form(), tablesort_header(), taxonomy_form_term_submit(), taxonomy_form_vocabulary_submit(), taxonomy_overview_terms(), taxonomy_overview_vocabularies(), taxonomy_term_page(), template_preprocess_aggregator_feed_source(), template_preprocess_aggregator_item(), theme_admin_block_content(), theme_book_admin_table(), theme_links(), theme_locale_languages_overview_form(), theme_menu_item_link(), theme_node_add_list(), theme_pager_link(), theme_update_report(), theme_update_version(), theme_user_admin_new_role(), theme_username(), tracker_page(), translation_node_overview(), trigger_assign_form(), and user_admin_account().

Here is the call graph for this function:

page_set_cache (  ) 

Store the current page in the cache.

We try to store a gzipped version of the cache. This requires the PHP zlib extension (). Presence of the extension is checked by testing for the function gzencode. There are two compression algorithms: gzip and deflate. The majority of all modern browsers support gzip or both of them. We thus only deal with the gzip variant and unzip the cache in case the browser does not accept gzip encoding.

See also:
drupal_page_header

Definition at line 2472 of file common.inc.

References cache_set(), drupal_get_headers(), drupal_get_messages(), request_uri(), and variable_get().

Referenced by drupal_page_footer().

Here is the call graph for this function:

t ( string,
args = array(),
langcode = NULL 
)

Translate strings to the page language or a given language.

All human-readable text that will be displayed somewhere within a page should be run through the t() function.

Examples:

   if (!$info || !$info['extension']) {
     form_set_error('picture_upload', t('The uploaded file was not an image.'));
   }

   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Log in'),
   );

Any text within t() can be extracted by translators and changed into the equivalent text in their native language.

Special variables called "placeholders" are used to signal dynamic information in a string which should not be translated. Placeholders can also be used for text that may change from time to time (such as link paths) to be changed without requiring updates to translations.

For example:

   $output = t('There are currently %members and %visitors online.', array(
     '%members' => format_plural($total_users, '1 user', '@count users'),
     '%visitors' => format_plural($guests->count, '1 guest', '@count guests')));

There are three styles of placeholders:

  • !variable, which indicates that the text should be inserted as-is. This is useful for inserting variables into things like e-mail.
         $message[] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE))));
    

  • , which indicates that the text should be run through check_plain, to escape HTML characters. Use this for any output that's displayed within a Drupal page.
         drupal_set_title($title = t("@name's blog", array('@name' => $account->name)));
    

  • variable, which indicates that the string should be HTML escaped and highlighted with theme_placeholder() which shows up by default as emphasized.
         $message = t('%name-from sent %name-to an e-mail.', array('%name-from' => $user->name, '%name-to' => $account->name));
    

When using t(), try to put entire sentences and strings in one t() call. This makes it easier for translators, as it provides context as to what each word refers to. HTML markup within translation strings is allowed, but should be avoided if possible. The exception are embedded links; link titles add a context for translators, so should be kept in the main string.

Here is an example of incorrect usage of t():

   $output .= t('<p>Go to the @contact-page.</p>', array('@contact-page' => l(t('contact page'), 'contact')));

Here is an example of t() used correctly:

   $output .= '<p>' . t('Go to the <a href="@contact-page">contact page</a>.', array('@contact-page' => url('contact'))) . '</p>';

Also avoid escaping quotation marks wherever possible.

Incorrect:

   $output .= t('Don\'t click me.');

Correct:

   $output .= t("Don't click me.");

Parameters:
$string A string containing the English string to translate.
$args An associative array of replacements to make after translation. Incidences of any key in this array are replaced with the corresponding value. Based on the first character of the key, the value is escaped and/or themed:
  • !variable: inserted as is
  • : escape plain text to HTML (check_plain)
  • variable: escape text and theme as a placeholder for user-submitted content (check_plain + theme_placeholder)
$langcode Optional language code to translate to a language other than what is used to display the page.
Returns:
The translated string.

Definition at line 753 of file common.inc.

References $value, check_plain(), theme(), and variable_get().

Referenced by _batch_do(), _dblog_format_message(), DrupalWebTestCase::_drupalCreateRole(), _forum_parent_select(), _locale_import_parse_plural_forms(), _locale_import_po(), _locale_languages_common_controls(), _locale_prepare_predefined_list(), _locale_rebuild_js(), _locale_translate_seek(), _menu_item_localize(), _menu_overview_tree_form(), _menu_site_is_offline(), _module_build_dependencies(), _node_mass_update_batch_finished(), _system_sql(), _update_refresh(), _xmlrpc(), actions_synchronize(), aggregator_admin_remove_feed(), aggregator_admin_settings(), aggregator_categorize_items(), aggregator_categorize_items_submit(), aggregator_categorize_items_validate(), aggregator_form_category(), aggregator_form_category_submit(), aggregator_form_category_validate(), aggregator_form_feed(), aggregator_form_feed_submit(), aggregator_form_feed_validate(), aggregator_page_category(), aggregator_page_last(), aggregator_page_sources(), aggregator_view(), DrupalWebTestCase::assertFieldById(), DrupalWebTestCase::assertFieldByName(), DrupalWebTestCase::assertNoFieldById(), DrupalWebTestCase::assertNoFieldByName(), DrupalWebTestCase::assertResponse(), block_add_block_form_submit(), block_add_block_form_validate(), block_admin_configure(), block_admin_configure_submit(), block_admin_configure_validate(), block_admin_display_form(), block_admin_display_form_submit(), block_box_delete(), block_box_delete_submit(), blog_page_last(), blog_page_user(), book_admin_edit(), book_admin_edit_submit(), book_admin_overview(), book_admin_settings(), book_admin_settings_validate(), book_export(), book_outline_form(), book_outline_form_submit(), book_remove_form(), book_remove_form_submit(), DrupalWebTestCase::clickLink(), comment_admin_overview(), comment_admin_overview_submit(), comment_admin_overview_validate(), comment_confirm_delete(), comment_confirm_delete_submit(), comment_delete(), comment_multiple_delete_confirm(), comment_multiple_delete_confirm_submit(), comment_reply(), contact_admin_categories(), contact_admin_delete(), contact_admin_delete_submit(), contact_admin_edit(), contact_admin_edit_submit(), contact_admin_edit_validate(), contact_admin_settings(), contact_mail_page(), contact_mail_page_submit(), contact_mail_page_validate(), contact_mail_user(), contact_mail_user_submit(), contact_site_page(), contact_user_page(), DrupalWebTestCase::curlExec(), date_validate(), dblog_admin_settings(), dblog_event(), dblog_filter_form(), dblog_filter_form_submit(), dblog_filter_form_validate(), dblog_filters(), dblog_overview(), dblog_top(), drupal_access_denied(), drupal_check_module(), drupal_http_request(), drupal_mail(), drupal_not_found(), drupal_site_offline(), drupal_validate_form(), DrupalWebTestCase::drupalCreateUser(), DrupalWebTestCase::drupalLogin(), DrupalWebTestCase::drupalLogout(), DrupalWebTestCase::drupalModuleDisable(), DrupalWebTestCase::drupalModuleEnable(), DrupalWebTestCase::drupalPost(), expand_password_confirm(), file_check_directory(), file_copy(), file_destination(), file_move(), file_munge_filename(), file_save_data(), file_save_upload(), file_validate_extensions(), file_validate_image_resolution(), file_validate_is_image(), file_validate_name_length(), file_validate_size(), filter_admin_configure(), filter_admin_configure_page(), filter_admin_delete(), filter_admin_delete_submit(), filter_admin_format_form(), filter_admin_format_form_submit(), filter_admin_format_form_validate(), filter_admin_format_page(), filter_admin_order(), filter_admin_order_page(), filter_admin_order_submit(), filter_admin_overview(), filter_admin_overview_submit(), format_date(), format_interval(), format_plural(), format_size(), forum_admin_settings(), forum_confirm_delete(), forum_confirm_delete_submit(), forum_form_container(), forum_form_forum(), forum_form_main(), forum_form_submit(), forum_overview(), garland_comment_wrapper(), garland_node_submitted(), help_main(), help_page(), image_gd_info(), image_gd_settings(), image_gd_settings_validate(), locale_languages_configure_form(), locale_languages_configure_form_submit(), locale_languages_custom_form(), locale_languages_delete_form(), locale_languages_delete_form_submit(), locale_languages_edit_form(), locale_languages_edit_form_validate(), locale_languages_overview_form(), locale_languages_overview_form_submit(), locale_languages_predefined_form(), locale_languages_predefined_form_submit(), locale_languages_predefined_form_validate(), locale_translate_delete(), locale_translate_edit_form(), locale_translate_edit_form_submit(), locale_translate_export_po_form(), locale_translate_export_pot_form(), locale_translate_import_form(), locale_translate_import_form_submit(), locale_translate_overview_screen(), locale_translate_seek_form(), menu_configure(), menu_delete_menu_confirm(), menu_delete_menu_confirm_submit(), menu_edit_item(), menu_edit_item_submit(), menu_edit_item_validate(), menu_edit_menu(), menu_edit_menu_validate(), menu_item_delete_form(), menu_item_delete_form_submit(), menu_overview_form(), menu_reset_item_confirm(), menu_reset_item_confirm_submit(), menu_set_active_trail(), node_add(), node_admin_nodes(), node_admin_nodes_validate(), node_body_field(), node_configure(), node_configure_rebuild_confirm(), node_configure_validate(), node_delete_confirm(), node_filter_form(), node_filter_form_submit(), node_filters(), node_form(), node_form_submit(), node_mass_update(), node_multiple_delete_confirm(), node_multiple_delete_confirm_submit(), node_node_operations(), node_overview_types(), node_preview(), node_revision_delete_confirm(), node_revision_delete_confirm_submit(), node_revision_overview(), node_revision_revert_confirm(), node_revision_revert_confirm_submit(), node_type_delete_confirm(), node_type_delete_confirm_submit(), node_type_form(), node_type_form_submit(), node_type_form_validate(), openid_authentication_page(), openid_redirect(), openid_redirect_form(), openid_user_add(), openid_user_add_validate(), openid_user_delete(), openid_user_identities(), DrupalReporter::paintError(), DrupalReporter::paintFail(), DrupalReporter::paintPass(), DrupalWebTestCase::parse(), password_confirm_validate(), path_admin_delete_confirm(), path_admin_filter_form(), path_admin_form(), path_admin_form_submit(), path_admin_form_validate(), path_admin_overview(), phptemplate_comment_submitted(), poll_page(), poll_votes(), profile_admin_overview(), profile_admin_overview_submit(), profile_browse(), profile_field_delete(), profile_field_delete_submit(), profile_field_form(), profile_field_form_submit(), profile_field_form_validate(), search_admin_settings(), search_admin_settings_validate(), search_form_submit(), search_view(), search_wipe_confirm(), search_wipe_confirm_submit(), statistics_access_log(), statistics_access_logging_settings(), statistics_node_tracker(), statistics_recent_hits(), statistics_top_pages(), statistics_top_referrers(), statistics_top_visitors(), statistics_user_tracker(), system_admin_by_module(), system_admin_menu_block_page(), system_admin_theme_settings(), system_clean_url_settings(), system_clear_cache_submit(), system_date_time_settings(), system_error_reporting_settings(), system_file_system_settings(), system_image_toolkit_settings(), system_ip_blocking(), system_ip_blocking_delete(), system_ip_blocking_delete_submit(), system_ip_blocking_form(), system_ip_blocking_form_submit(), system_ip_blocking_form_validate(), system_main_admin_page(), system_modules(), system_modules_confirm_form(), system_modules_submit(), system_modules_uninstall(), system_modules_uninstall_confirm_form(), system_modules_uninstall_submit(), system_modules_uninstall_validate(), system_performance_settings(), system_rss_feeds_settings(), system_run_cron(), system_site_information_settings(), system_site_information_settings_validate(), system_site_maintenance_settings(), system_sql(), system_theme_settings(), system_theme_settings_submit(), system_themes_form(), system_themes_form_submit(), tablesort_header(), taxonomy_add_term_page(), taxonomy_form_term(), taxonomy_form_term_submit(), taxonomy_form_term_validate(), taxonomy_form_vocabulary(), taxonomy_form_vocabulary_submit(), taxonomy_overview_terms(), taxonomy_overview_terms_submit(), taxonomy_overview_vocabularies(), taxonomy_term_confirm_delete(), taxonomy_term_confirm_delete_submit(), taxonomy_term_confirm_parents(), taxonomy_term_page(), taxonomy_vocabulary_confirm_delete(), taxonomy_vocabulary_confirm_delete_submit(), taxonomy_vocabulary_confirm_reset_alphabetical(), taxonomy_vocabulary_confirm_reset_alphabetical_submit(), template_preprocess_aggregator_feed_source(), template_preprocess_aggregator_item(), template_preprocess_aggregator_summary_item(), template_preprocess_block_admin_display_form(), theme_aggregator_categorize_items(), theme_aggregator_page_rss(), theme_book_admin_table(), theme_comment_admin_overview(), theme_feed_icon(), theme_filter_admin_order(), theme_filter_admin_overview(), theme_filter_tips(), theme_locale_languages_overview_form(), theme_mark(), theme_menu_overview_form(), theme_more_help_link(), theme_more_link(), theme_node_admin_nodes(), theme_node_filters(), theme_node_preview(), theme_pager(), theme_pager_link(), theme_profile_admin_overview(), theme_system_admin_by_module(), theme_system_modules(), theme_system_modules_uninstall(), theme_system_theme_select_form(), theme_system_themes_form(), theme_tablesort_indicator(), theme_taxonomy_overview_terms(), theme_taxonomy_overview_vocabularies(), theme_trigger_display(), theme_update_report(), theme_update_version(), theme_user_admin_account(), theme_user_admin_new_role(), theme_user_admin_perm(), theme_user_filters(), theme_username(), theme_xml_icon(), tracker_page(), translation_node_overview(), trigger_assign_form(), trigger_assign_form_submit(), trigger_assign_form_validate(), trigger_unassign(), trigger_unassign_submit(), update_calculate_project_data(), update_manual_status(), update_process_project_info(), update_settings(), update_settings_submit(), update_settings_validate(), upload_admin_settings(), upload_admin_settings_validate(), user_admin(), user_admin_account(), user_admin_account_submit(), user_admin_account_validate(), user_admin_perm(), user_admin_perm_submit(), user_admin_role(), user_admin_role_submit(), user_admin_role_validate(), user_admin_settings(), user_confirm_delete(), user_confirm_delete_submit(), user_edit_submit(), user_edit_validate(), user_filter_form(), user_filter_form_submit(), user_pass(), user_pass_reset(), user_pass_submit(), user_pass_validate(), user_profile_form(), user_profile_form_submit(), user_profile_form_validate(), watchdog_severity_levels(), xmlrpc_server(), xmlrpc_server_call(), xmlrpc_server_method_signature(), and xmlrpc_server_multicall().

Here is the call graph for this function:

url ( path = NULL,
options = array() 
)

End of "defgroup format". Generate a URL from a Drupal menu path. Will also pass-through existing URLs.

Parameters:
$path The Drupal path being linked to, such as "admin/content/node", or an existing URL like "http://drupal.org/". The special path '<front>' may also be given and will generate the site's base URL.
$options An associative array of additional options, with the following keys: 'query' A query string to append to the link, or an array of query key/value properties. 'fragment' A fragment identifier (or named anchor) to append to the link. Do not include the '#' character. 'absolute' (default FALSE) Whether to force the output to be an absolute link (beginning with http:). Useful for links that will be displayed outside the site, such as in an RSS feed. 'alias' (default FALSE) Whether the given path is an alias already. 'external' Whether the given path is an external URL. 'language' An optional language object. Used to build the URL to link to and look up the proper alias for the link. 'base_url' Only used internally, to modify the base URL when a language dependent URL requires so. 'prefix' Only used internally, to modify the path when a language dependent URL requires so.
Returns:
A string containing a URL to the given path.
When creating links in modules, consider whether l() could be a better alternative than url().

Definition at line 1257 of file common.inc.

References $base_url, base_path(), check_plain(), drupal_get_path_alias(), drupal_query_string_encode(), drupal_urlencode(), language, language_url_rewrite(), and variable_get().

Referenced by _batch_progress_page_js(), _batch_progress_page_nojs(), aggregator_admin_settings(), aggregator_form_feed(), aggregator_form_feed_validate(), aggregator_page_categories(), aggregator_page_category(), aggregator_page_last(), aggregator_page_sources(), batch_process(), block_admin_display_form(), blog_feed_last(), blog_feed_user(), blog_page_last(), blog_page_user(), contact_admin_settings(), contact_mail_page(), contact_user_page(), dblog_admin_settings(), drupal_goto(), DrupalWebTestCase::drupalGet(), file_create_url(), form_expand_ahah(), forum_confirm_delete(), forum_overview(), DrupalWebTestCase::getAbsoluteUrl(), install_tasks(), l(), locale_languages_predefined_form_submit(), menu_get_active_help(), openid_user_add_validate(), path_admin_form(), profile_field_delete(), search_admin_settings(), statistics_access_log(), statistics_access_logging_settings(), statistics_node_tracker(), statistics_top_referrers(), system_date_time_settings(), system_error_reporting_settings(), system_main_admin_page(), system_modules(), system_modules_uninstall(), system_site_information_settings(), system_site_maintenance_settings(), system_themes_form_submit(), taxonomy_term_page(), template_preprocess_aggregator_feed_source(), template_preprocess_aggregator_item(), template_preprocess_maintenance_page(), template_preprocess_node(), template_preprocess_page(), theme_aggregator_page_opml(), theme_aggregator_page_rss(), theme_image(), theme_textfield(), update_settings(), upload_admin_settings(), and user_pass_reset().

Here is the call graph for this function:

watchdog_severity_levels (  ) 

Severity levels, as defined in RFC 3164:

Returns:
Array of the possible severity levels for log messages.
See also:
watchdog()

Definition at line 3475 of file common.inc.

References t().

Referenced by dblog_event(), and dblog_filters().

Here is the call graph for this function:

xmlrpc ( url  ) 

Performs one or more XML-RPC request(s).

Parameters:
$url An absolute URL of the XML-RPC endpoint. Example:
... For one request: The method name followed by a variable number of arguments to the method. For multiple requests (system.multicall): An array of call arrays. Each call array follows the pattern of the single request: method name followed by the arguments to the method.
Returns:
For one request: Either the return value of the method on success, or FALSE. If FALSE is returned, see xmlrpc_errno() and xmlrpc_error_msg(). For multiple requests: An array of results. Each result will either be the result returned by the method called, or an xmlrpc_error object if the call failed. See xmlrpc_error().

Definition at line 2419 of file common.inc.


Generated on Mon Jun 2 15:08:03 2008 for SimpleTest by  1.5.5