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

Go to the source code of this file.


Functions

 drupal_init_path ()
 drupal_lookup_path ($action, $path= '', $path_language= '')
 drupal_get_path_alias ($path, $path_language= '')
 drupal_get_normal_path ($path, $path_language= '')
 arg ($index=NULL, $path=NULL)
 drupal_get_title ()
 drupal_set_title ($title=NULL)
 drupal_is_front_page ()
 drupal_match_path ($path, $patterns)


Detailed Description

Functions to handle paths in Drupal, including path aliasing.

These functions are not loaded for cached pages, but modules that need to use them in hook_init() or hook exit() can make them available, by executing "drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH);".

Definition in file path.inc.


Function Documentation

arg ( index = NULL,
path = NULL 
)

Return a component of the current Drupal path.

When viewing a page at the path "admin/build/types", for example, arg(0) would return "admin", arg(1) would return "content", and arg(2) would return "types".

Avoid use of this function where possible, as resulting code is hard to read. Instead, attempt to use named arguments in menu callback functions. See the explanation in menu.inc for how to construct callbacks that take arguments.

Parameters:
$index The index of the component, where each component is separated by a '/' (forward-slash), and where the first component has an index of 0 (zero).
Returns:
The component specified by $index, or NULL if the specified component was not found.

Definition at line 154 of file path.inc.

Referenced by aggregator_form_category_submit(), aggregator_form_feed_submit(), aggregator_page_category(), aggregator_page_last(), aggregator_page_rss(), aggregator_page_source(), block_admin_display_form(), comment_admin(), filter_admin_delete(), filter_tips_long(), menu_get_active_help(), menu_get_item(), menu_local_tasks(), menu_set_active_trail(), openid_user_add_validate(), profile_field_form(), statistics_node_tracker(), statistics_user_tracker(), system_ip_blocking_form(), template_preprocess_page(), and user_admin_role().

drupal_get_normal_path ( path,
path_language = '' 
)

Given a path alias, return the internal path it represents.

Parameters:
$path A Drupal path alias.
$path_language An optional language code to look up the path in.
Returns:
The internal path represented by the alias, or the original alias if no internal path was found.

Definition at line 123 of file path.inc.

References $result, and drupal_lookup_path().

Referenced by _menu_site_is_offline(), drupal_access_denied(), drupal_init_path(), drupal_is_front_page(), drupal_not_found(), menu_edit_item_validate(), and system_site_information_settings_validate().

Here is the call graph for this function:

drupal_get_path_alias ( path,
path_language = '' 
)

Given an internal Drupal path, return the alias set by the administrator.

Parameters:
$path An internal Drupal path.
$path_language An optional language code to look up the path in.
Returns:
An aliased path if one was found, or the original path if no alias was found.

Definition at line 103 of file path.inc.

References $result, and drupal_lookup_path().

Referenced by url().

Here is the call graph for this function:

drupal_get_title (  ) 

Get the title of the current page, for display on the page and in the title bar.

Returns:
The current page's title.

Definition at line 177 of file path.inc.

References $title, check_plain(), drupal_set_title(), and menu_get_active_title().

Referenced by template_preprocess_maintenance_page(), and template_preprocess_page().

Here is the call graph for this function:

drupal_init_path (  ) 

Initialize the $_GET['q'] variable to the proper normal path.

Definition at line 16 of file path.inc.

References drupal_get_normal_path(), and variable_get().

Referenced by _drupal_bootstrap().

Here is the call graph for this function:

drupal_is_front_page (  ) 

Check if the current page is the front page.

Returns:
Boolean value: TRUE if the current page is the front page; FALSE if otherwise.

Definition at line 213 of file path.inc.

References drupal_get_normal_path(), and variable_get().

Referenced by l(), menu_get_active_breadcrumb(), menu_set_active_trail(), menu_tree_page_data(), template_preprocess(), template_preprocess_page(), and theme_links().

Here is the call graph for this function:

drupal_lookup_path ( action,
path = '',
path_language = '' 
)

Given an alias, return its Drupal system URL if one exists. Given a Drupal system URL return one of its aliases if such a one exists. Otherwise, return FALSE.

Parameters:
$action One of the following values:
  • wipe: delete the alias cache.
  • alias: return an alias for a given Drupal system path (if one exists).
  • source: return the Drupal system URL for a path alias (if one exists).
$path The path to investigate for corresponding aliases or system URLs.
$path_language Optional language code to search the path with. Defaults to the page language. If there's no path defined for that language it will search paths without language.
Returns:
Either a Drupal system path, an aliased path, or FALSE if no path was found.

Definition at line 46 of file path.inc.

References db_query(), db_result(), and module_exists().

Referenced by drupal_clear_path_cache(), drupal_get_normal_path(), and drupal_get_path_alias().

Here is the call graph for this function:

drupal_match_path ( path,
patterns 
)

Check if a path matches any pattern in a set of patterns.

Parameters:
$path The path to match.
$patterns String containing a set of patterns separated by
, or
.
Returns:
Boolean value: TRUE if the path matches a pattern, FALSE otherwise.

Definition at line 230 of file path.inc.

References variable_get().

Here is the call graph for this function:

drupal_set_title ( title = NULL  ) 


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