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()) |
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.
enum SAVED_DELETED |
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.
enum SAVED_UPDATED |
Return status for saving which involved an update to an existing item.
Definition at line 20 of file common.inc.
_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().
_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().
_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().
_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 | ( | ) |
Returns the base URL path of the Drupal installation. At the very least, this will always default to /.
Definition at line 1570 of file common.inc.
Referenced by drupal_add_js(), drupal_build_css_cache(), drupal_get_css(), drupal_get_js(), garland_get_ie_styles(), DrupalWebTestCase::getAbsoluteUrl(), system_clean_url_settings(), template_preprocess_maintenance_page(), template_preprocess_page(), theme_get_setting(), theme_image(), theme_image_button(), update_info_page(), update_results_page(), and url().
check_file | ( | $ | filename | ) |
Definition at line 880 of file common.inc.
check_url | ( | $ | uri | ) |
Prepare a URL for use in an HTML attribute. Strips harmful protocols.
Definition at line 887 of file common.inc.
Referenced by format_rss_channel(), format_rss_item(), l(), template_preprocess_aggregator_feed_source(), template_preprocess_aggregator_item(), template_preprocess_aggregator_summary_item(), template_preprocess_maintenance_page(), template_preprocess_page(), template_preprocess_search_result(), theme_aggregator_page_opml(), theme_aggregator_page_rss(), theme_feed_icon(), theme_form(), theme_image(), theme_more_help_link(), theme_more_link(), theme_textfield(), and theme_xml_icon().
drupal_access_denied | ( | ) |
Generates a 403 error if the request is not allowed.
Definition at line 371 of file common.inc.
References $return, check_plain(), drupal_get_normal_path(), drupal_set_header(), drupal_set_title(), menu_execute_active_handler(), menu_set_active_item(), print, t(), theme(), variable_get(), and watchdog().
Referenced by book_export_html(), comment_edit(), file_download(), menu_delete_menu_page(), menu_item_delete_page(), profile_browse(), system_batch_page(), and user_pass_reset().
drupal_add_css | ( | $ | path = NULL , |
|
$ | type = 'module' , |
|||
$ | media = 'all' , |
|||
$ | preprocess = TRUE | |||
) |
Adds a CSS file to the stylesheet queue.
$path | (optional) The path to the CSS file relative to the base_path(), e.g., /modules/devel/devel.css. |
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.
$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? |
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:
Typical candidates for caching are for example styles for nodes across the site, or used in the theme.
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.
$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().
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:
$data | (optional) If given, the value depends on the $type parameter:
| |
$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? |
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().
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().
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:
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:
When tree relationships are present, the two additional classes 'tabledrag-leaf' and 'tabledrag-root' can be used to refine the behavior:
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.
$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. |
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().
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.
$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().
drupal_attributes | ( | $ | attributes = array() |
) |
Format an attribute string to insert in a tag.
$attributes | An associative array of HTML attributes. |
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().
drupal_build_css_cache | ( | $ | types, | |
$ | filename | |||
) |
Aggregate and optimize CSS files, putting them in the files directory.
$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. |
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().
drupal_build_js_cache | ( | $ | files, | |
$ | filename | |||
) |
Aggregate JS files, putting them in the files directory.
$files | An array of JS files to aggregate and compress into one file. | |
$filename | The name of the aggregate 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().
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().
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().
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().
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().
drupal_cron_run | ( | ) |
Executes a cron run when called
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().
drupal_error_handler | ( | $ | errno, | |
$ | message, | |||
$ | filename, | |||
$ | line, | |||
$ | context | |||
) |
End of "HTTP handling". Log errors as defined by administrator.
Error levels:
Definition at line 573 of file common.inc.
References drupal_set_message(), variable_get(), and watchdog().
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.
$code | The code to evaluate. |
Definition at line 1524 of file common.inc.
References $output, drupal_get_path(), and print.
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().
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().
drupal_get_content | ( | $ | region = NULL , |
|
$ | delimiter = ' ' | |||
) |
Get assigned content.
$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().
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.
$css | (optional) An array of CSS files. If no array is provided, the default stylesheets array is used instead. |
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().
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.
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().
drupal_get_feeds | ( | $ | delimiter = "\n" |
) |
Get the feed URLs for the current page.
$delimiter | A delimiter to split feeds by. |
Definition at line 182 of file common.inc.
References drupal_add_feed().
Referenced by template_preprocess_page().
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().
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().
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.
$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. |
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().
drupal_get_path | ( | $ | type, | |
$ | name | |||
) |
Returns the path to a system item (module, theme, etc.).
$type | The type of the item (i.e. theme, theme_engine, module). | |
$name | The name of the item for which the path is requested. |
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().
drupal_get_private_key | ( | ) |
Ensure the private key variable used to generate tokens is set.
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().
drupal_get_token | ( | $ | value = '' |
) |
Generate a token based on $value, the current user session and private key.
$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().
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.
$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:
|
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().
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.
$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. |
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().
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.
$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().
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.
$file | Name of the stylesheet to be processed. | |
$optimize | Defines if CSS contents should be compressed or not. |
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.
$array | A linear array. | |
$function | A name of a function to apply to all values before output. |
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 | ( | ) |
Generates a 404 error if the request can not be handled.
Definition at line 341 of file common.inc.
References $return, check_plain(), drupal_get_normal_path(), drupal_set_header(), drupal_set_title(), menu_execute_active_handler(), menu_set_active_item(), print, t(), theme(), variable_get(), and watchdog().
Referenced by book_export(), file_download(), file_transfer(), filter_admin_delete(), locale_languages_delete_form(), locale_languages_edit_form(), profile_browse(), profile_field_delete(), profile_field_form(), statistics_access_log(), statistics_node_tracker(), statistics_user_tracker(), system_main_admin_page(), taxonomy_admin_term_edit(), and taxonomy_term_page().
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().
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:
Example of .info file:
* name = Forum * description = Enables threaded discussions about general topics. * dependencies[] = taxonomy * dependencies[] = comment * package = Core - optional * version = VERSION *
$filename | The file we are parsing. Accepts file with relative or absolute path. |
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.
$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. |
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().
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.
$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 | ) |
Renders HTML given a structured array tree.
Recursively iterates over each of the array elements, generating HTML code. This function is usually called from within a another function, like drupal_get_form() or node_view().
$elements | The structured array describing the data to be rendered. |
Definition at line 2690 of file common.inc.
References $children, $content, _element_info(), drupal_function_exists(), element_children(), and theme().
Referenced by book_form_update(), drupal_render_form(), template_preprocess_block_admin_display_form(), template_preprocess_user_profile(), theme_aggregator_categorize_items(), theme_book_admin_table(), theme_comment_admin_overview(), theme_filter_admin_order(), theme_filter_admin_overview(), theme_locale_languages_overview_form(), theme_menu_overview_form(), theme_node_admin_nodes(), theme_node_filter_form(), theme_node_filters(), theme_node_form(), theme_profile_admin_overview(), theme_system_modules(), theme_system_modules_uninstall(), theme_system_theme_select_form(), theme_system_themes_form(), theme_taxonomy_overview_terms(), theme_taxonomy_overview_vocabularies(), theme_trigger_display(), theme_user_admin_account(), theme_user_admin_new_role(), theme_user_admin_perm(), theme_user_filter_form(), and theme_user_filters().
drupal_set_breadcrumb | ( | $ | breadcrumb = NULL |
) |
Set the breadcrumb trail for the current page.
$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.
$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().
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.
$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. |
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().
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:
$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().
drupal_valid_token | ( | $ | token, | |
$ | value = '' , |
|||
$ | skip_anonymous = FALSE | |||
) |
Validate a token based on $value, the current user session and private key.
$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. |
Definition at line 2392 of file common.inc.
References $value, and variable_get().
Referenced by drupal_validate_form().
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 | ) |
Get keys of a structured array tree element that are not properties (i.e., do not begin with '#').
Definition at line 2817 of file common.inc.
Referenced by _form_validate(), book_admin_edit_submit(), drupal_render(), form_builder(), forum_overview(), menu_overview_form(), menu_overview_form_submit(), profile_admin_overview_submit(), system_theme_settings(), taxonomy_term_confirm_parents(), template_preprocess_block_admin_display_form(), template_preprocess_user_profile(), theme_aggregator_categorize_items(), theme_book_admin_table(), theme_comment_admin_overview(), theme_filter_admin_order(), theme_menu_overview_form(), theme_node_admin_nodes(), theme_node_filters(), theme_profile_admin_overview(), theme_system_modules_uninstall(), theme_system_theme_select_form(), theme_system_themes_form(), theme_taxonomy_overview_terms(), theme_taxonomy_overview_vocabularies(), theme_user_admin_account(), theme_user_admin_perm(), and theme_user_filters().
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.
$name | The name of the event. | |
$number | The maximum number of the specified event per hour (per visitor). |
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().
flood_register_event | ( | $ | name | ) |
End of "defgroup validation". Register an event for the current visitor (hostname/IP) to the flood control mechanism.
$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().
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.
$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.
| |
$options | An associative array of additional options, with the following keys:
|
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().
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.
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().
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:
drupal_set_title($title = t("@name's blog", array('@name' => $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:
Correct:
$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:
| |
$langcode | Optional language code to translate to a language other than what is used to display the page. |
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().
url | ( | $ | path = NULL , |
|
$ | options = array() | |||
) |
End of "defgroup format". Generate a URL from a Drupal menu path. Will also pass-through existing URLs.
$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. |
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().
watchdog_severity_levels | ( | ) |
Severity levels, as defined in RFC 3164:
Definition at line 3475 of file common.inc.
References t().
Referenced by dblog_event(), and dblog_filters().
xmlrpc | ( | $ | url | ) |
Performs one or more XML-RPC request(s).
$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. |
Definition at line 2419 of file common.inc.