url

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE)
6 url($path = NULL, $options = array())
8 – 7 url($path = NULL, array $options = array())

Generates an internal or external URL.

When creating links in modules, consider whether l() could be a better alternative than url().

Parameters

$path The internal path or external URL being linked to, such as "node/34" or "http://example.com/foo". A few notes:

  • If you provide a full URL, it will be considered an external URL.
  • If you provide only the path (e.g. "node/34"), it will be considered an internal link. In this case, it should be a system URL, and it will be replaced with the alias, if one exists. Additional query arguments for internal paths must be supplied in $options['query'], not included in $path.
  • If you provide an internal path and $options['alias'] is set to TRUE, the path is assumed already to be the correct path alias, and the alias is not looked up.
  • The special string '<front>' generates a link to the site's base URL.
  • If your external URL contains a query (e.g. http://example.com/foo?a=b), then you can either URL encode the query keys and values yourself and include them in $path, or use $options['query'] to let this function URL encode them.

$options An associative array of additional options, with the following elements:

  • 'query': An array of query key/value-pairs (without any URL-encoding) to append to the URL.
  • 'fragment': A fragment identifier (named anchor) to append to the URL. Do not include the leading '#' character.
  • 'absolute': Defaults to 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': Defaults to FALSE. Whether the given path is a URL alias already.
  • 'external': Whether the given path is an external URL.
  • 'language': An optional language object. If the path being linked to is internal to the site, $options['language'] is used to look up the alias for the URL. If $options['language'] is omitted, the global $language_url will be used.
  • 'https': Whether this URL should point to a secure location. If not defined, the current scheme is used, so the user stays on http or https respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can only be enforced when the variable 'https' is set to TRUE.
  • '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.
  • 'script': The script filename in Drupal's root directory to use when clean URLs are disabled, such as 'index.php'. Defaults to an empty string, as most modern web servers automatically find 'index.php'. If clean URLs are disabled, the value of $path is appended as query parameter 'q' to $options['script'] in the returned URL. When deploying Drupal on a web server that cannot be configured to automatically find index.php, then hook_url_outbound_alter() can be implemented to force this value to 'index.php'.
  • 'entity_type': The entity type of the object that called url(). Only set if url() is invoked by entity_uri().
  • 'entity': The entity object (such as a node) for which the URL is being generated. Only set if url() is invoked by entity_uri().

Return value

A string containing a URL to the given path.

▾ 299 functions call url()

AddFeedTestCase::testAddFeed in modules/aggregator/aggregator.test
Create a feed, ensure that it is unique, check the source, and delete the feed.
AggregatorRenderingTestCase::testBlockLinks in modules/aggregator/aggregator.test
Add a feed block to the page and checks its links.
AggregatorTestCase::getFeedEditArray in modules/aggregator/aggregator.test
Return a randomly generated feed edit array.
aggregator_form_aggregator_admin_form_alter in modules/aggregator/aggregator.processor.inc
Implements hook_form_aggregator_admin_form_alter().
aggregator_form_feed in modules/aggregator/aggregator.admin.inc
Form builder; Generate a form to add/edit feed sources.
aggregator_form_opml in modules/aggregator/aggregator.admin.inc
Form builder; Generate a form to import feeds from OPML.
aggregator_help in modules/aggregator/aggregator.module
Implements hook_help().
aggregator_page_categories in modules/aggregator/aggregator.pages.inc
Menu callback; displays all the categories used by the aggregator.
aggregator_page_sources in modules/aggregator/aggregator.pages.inc
Menu callback; displays all the feeds used by the aggregator.
aggregator_view in modules/aggregator/aggregator.admin.inc
Displays the aggregator administration page.
AJAXFrameworkTestCase::testAJAXRender in modules/simpletest/tests/ajax.test
Test that ajax_render() returns JavaScript settings generated during the page request.
ajax_example_add_more in examples/ajax_example/ajax_example_graceful_degradation.inc
This example shows a button to "add more" - add another textfield, and the corresponding "remove" button.
ajax_example_dynamic_sections in examples/ajax_example/ajax_example_graceful_degradation.inc
Example of a form with portions dynamically enabled or disabled, but with graceful degradation in the case of no javascript.
ajax_example_wizard in examples/ajax_example/ajax_example_graceful_degradation.inc
This example is a classic wizard, where a different and sequential form is presented on each step of the form.
ajax_pre_render_element in includes/ajax.inc
Add Ajax information about an element to the page to communicate with JavaScript.
BasicUpgradePath::testBasicUpgrade in modules/simpletest/tests/upgrade/upgrade.test
Test a successful upgrade.
batch_process in includes/form.inc
Processes the batch.
block_custom_block_form in modules/block/block.module
Define the custom block form.
block_example_page in examples/block_example/block_example.module
Simple page function to explain what the block example is about.
block_help in modules/block/block.module
Implements hook_help().
block_update_7004 in modules/block/block.install
Add new blocks to new regions, migrate custom variables to blocks.
blog_feed_last in modules/blog/blog.pages.inc
Menu callback; displays an RSS feed containing recent blog entries of all users.
blog_feed_user in modules/blog/blog.pages.inc
Menu callback; displays an RSS feed containing recent blog entries of a given user.
blog_help in modules/blog/blog.module
Implements hook_help().
BookTestCase::checkBookNode in modules/book/book.test
Check the outline of sub-pages; previous, up, and next; and printer friendly version.
book_help in modules/book/book.module
Implements hook_help().
color_help in modules/color/color.module
Implements hook_help().
color_update_7001 in modules/color/color.install
Warn site administrator if unsafe CSS color codes are found in the database.
CommentRSSUnitTest::testCommentRSS in modules/comment/comment.test
Test comments as part of an RSS feed.
CommentTokenReplaceTestCase::testCommentTokenReplacement in modules/comment/comment.test
Creates a comment, then tests the tokens generated from it.
comment_form in modules/comment/comment.module
Generate the basic commenting form, for appending to a node or display on a separate page.
comment_help in modules/comment/comment.module
Implements hook_help().
comment_node_view in modules/comment/comment.module
Implements hook_node_view().
comment_tokens in modules/comment/comment.tokens.inc
Implements hook_tokens().
CommonURLUnitTest::testExternalUrls in modules/simpletest/tests/common.test
Test external URL handling.
CommonURLUnitTest::testLXSS in modules/simpletest/tests/common.test
Confirm that invalid text given as $path is filtered.
CommonURLUnitTest::testUrl in modules/simpletest/tests/common.test
Test url() with/without query, with/without fragment, absolute on/off and assert all that works when clean URLs are on and off.
contact_form_user_profile_form_alter in modules/contact/contact.module
Implements hook_form_FORM_ID_alter().
contact_help in modules/contact/contact.module
Implements hook_help().
contact_mail in modules/contact/contact.module
Implements hook_mail().
contact_site_form in modules/contact/contact.pages.inc
Form builder; the site-wide contact form.
dashboard_admin in modules/dashboard/dashboard.module
Dashboard page callback.
dashboard_help in modules/dashboard/dashboard.module
Implements hook_help().
DateTimeFunctionalTest::testDateFormatConfiguration in modules/system/system.test
Test date format configuration.
DateTimeFunctionalTest::testDateTypeConfiguration in modules/system/system.test
Test date type configuration.
dblog_form_system_logging_settings_alter in modules/dblog/dblog.module
Implements hook_form_FORM_ID_alter().
dblog_help in modules/dblog/dblog.module
Implements hook_help().
DrupalAddFeedTestCase::testBasicFeedAddNoTitle in modules/simpletest/tests/common.test
Test drupal_add_feed() with paths, URLs, and titles.
DrupalGotoTest::testDrupalGoto in modules/simpletest/tests/common.test
Test drupal_goto().
DrupalHTTPRequestTestCase::testDrupalHTTPRequest in modules/simpletest/tests/common.test
DrupalHTTPRequestTestCase::testDrupalHTTPRequestBasicAuth in modules/simpletest/tests/common.test
DrupalHTTPRequestTestCase::testDrupalHTTPRequestRedirect in modules/simpletest/tests/common.test
DrupalPrivateStreamWrapper::getExternalUrl in includes/stream_wrappers.inc
Overrides getExternalUrl().
DrupalRenderTestCase::testDrupalRenderFormElements in modules/simpletest/tests/common.test
Test rendering form elements without passing through form_builder().
DrupalTemporaryStreamWrapper::getExternalUrl in includes/stream_wrappers.inc
Overrides getExternalUrl().
DrupalWebTestCase::assertUrl in modules/simpletest/drupal_web_test_case.php
Pass if the internal browser's URL matches the given path.
DrupalWebTestCase::drupalGet in modules/simpletest/drupal_web_test_case.php
Retrieves a Drupal path or an absolute path.
DrupalWebTestCase::drupalHead in modules/simpletest/drupal_web_test_case.php
Retrieves only the headers for a Drupal path or an absolute path.
drupal_add_feed in includes/common.inc
Add a feed URL for the current page.
drupal_add_js in includes/common.inc
Adds a JavaScript file, setting, or inline code to the page.
drupal_goto in includes/common.inc
Send the user to a different Drupal page.
drupal_validate_form in includes/form.inc
Validates user-submitted form data from the $form_state using the validate functions defined in a structured form array.
field_help in modules/field/field.module
Implements hook_help().
field_sql_storage_help in modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_help().
field_ui_display_overview_form in modules/field_ui/field_ui.admin.inc
Menu callback; presents field display settings for a given view mode.
field_ui_display_overview_form_submit in modules/field_ui/field_ui.admin.inc
Submit handler for the display overview form.
field_ui_help in modules/field_ui/field_ui.module
Implements hook_help().
FileExampleSessionStreamWrapper::getExternalUrl in examples/file_example/file_example_session_streams.inc
Overrides getExternalUrl().
file_help in modules/file/file.module
Implements hook_help().
filter_help in modules/filter/filter.module
Implements hook_help().
filter_update_7005 in modules/filter/filter.install
Integrate text formats with the user permissions system.
FormsRebuildTestCase::testPreserveFormActionAfterAJAX in modules/simpletest/tests/form.test
Tests that a form's action is retained after an Ajax submission.
forum_confirm_delete in modules/forum/forum.admin.inc
Returns a confirmation page for deleting a forum taxonomy term.
forum_help in modules/forum/forum.module
Implements hook_help().
forum_menu_local_tasks_alter in modules/forum/forum.module
Implements hook_menu_local_tasks_alter().
forum_overview in modules/forum/forum.admin.inc
Returns an overview list of existing forums and containers
help_help in modules/help/help.module
Implements hook_help().
HookBootExitTestCase::testHookBootExit in modules/simpletest/tests/bootstrap.test
Test calling of hook_boot() and hook_exit().
hook_help in modules/help/help.api.php
Provide online user help.
hook_mail in modules/system/system.api.php
Prepare a message based on parameters; called from drupal_mail().
hook_requirements in modules/system/system.api.php
Check installation requirements and do status reporting.
hook_search_execute in modules/search/search.api.php
Execute a search for a set of key words.
hook_tokens in modules/system/system.api.php
Provide replacement values for placeholder tokens.
hook_user_login in modules/user/user.api.php
The user just logged in.
image_help in modules/image/image.module
Implement of hook_help().
image_style_url in modules/image/image.module
Return the URL for an image derivative given a style and image path.
install_finished in includes/install.core.inc
Installation task; perform final steps and display a 'finished' page.
JavaScriptTestCase::testAddFile in modules/simpletest/tests/common.test
Test adding a JavaScript file.
l in includes/common.inc
Formats an internal or external URL link as an HTML anchor tag.
list_help in modules/field/modules/list/list.module
Implements hook_help().
LocaleConfigurationTest::testLanguageConfiguration in modules/locale/locale.test
Functional tests for adding, editing and deleting languages.
LocaleImportFunctionalTest::testStandalonePoFile in modules/locale/locale.test
Test import of standalone .po files.
LocaleTranslationFunctionalTest::testStringTranslation in modules/locale/locale.test
Adds a language and tests string translation by users with the appropriate permissions.
LocaleUrlRewritingTest::checkUrl in modules/locale/locale.test
Check URL rewriting for the given language.
LocaleUserCreationTest::testLocalUserCreation in modules/locale/locale.test
Functional test for language handling during user creation.
locale_form_node_type_form_alter in modules/locale/locale.module
Implements hook_form_FORM_ID_alter().
locale_help in modules/locale/locale.module
Implements hook_help().
locale_languages_predefined_form_submit in modules/locale/locale.admin.inc
Process the language addition form submission.
MenuBreadcrumbTestCase::testBreadCrumbs in modules/simpletest/tests/menu.test
Tests breadcrumbs on node and administrative paths.
MenuRouterTestCase::testAuthUserUserLogin in modules/simpletest/tests/menu.test
Test that an authenticated user hitting 'user/login' gets redirected to 'user' and 'user/register' gets redirected to the user edit page.
MenuWebTestCase::assertBreadcrumb in modules/simpletest/tests/menu.test
Assert that a given path shows certain breadcrumb links.
menu_configure in modules/menu/menu.admin.inc
Menu callback; Build the form presenting menu configuration options.
menu_example_menu in examples/menu_example/menu_example.module
Implements hook_menu().
menu_help in modules/menu/menu.module
Implements hook_help().
menu_overview_form in modules/menu/menu.admin.inc
Form for editing an entire menu tree at once.
NodeTokenReplaceTestCase::testNodeTokenReplacement in modules/node/node.test
Creates a node, then tests the tokens generated from it.
NodeTypeTestCase::testNodeTypeEditing in modules/node/node.test
Test editing a node type using the UI.
node_example_help in examples/node_example/node_example.module
Implements hook_help().
node_feed in modules/node/node.module
Generates and prints an RSS feed.
node_help in modules/node/node.module
Implements hook_help().
node_overview_types in modules/node/content_types.inc
Displays the content type admin overview page.
node_page_view in modules/node/node.module
Menu callback; view a single node.
node_search_execute in modules/node/node.module
Implements hook_search_execute().
node_tokens in modules/node/node.tokens.inc
Implements hook_tokens().
number_help in modules/field/modules/number/number.module
Implements hook_help().
OpenIDFunctionalTestCase::addRedirectedIdentity in modules/openid/openid.test
Add OpenID identity, changed by the following redirects, to user's profile.
OpenIDFunctionalTestCase::testBlockedUserLogin in modules/openid/openid.test
Test that a blocked user cannot log in.
OpenIDFunctionalTestCase::testDelete in modules/openid/openid.test
Test deleting an OpenID identity from a user's profile.
OpenIDFunctionalTestCase::testDiscovery in modules/openid/openid.test
Test discovery of OpenID Provider Endpoint via Yadis and HTML.
OpenIDFunctionalTestCase::testLogin in modules/openid/openid.test
Test login using OpenID.
OpenIDFunctionalTestCase::testLoginMaintenanceMode in modules/openid/openid.test
Test login using OpenID during maintenance mode.
OpenIDFunctionalTestCase::testSignatureValidation in modules/openid/openid.test
Tests that openid.signed is verified.
OpenIDInvalidIdentifierTransitionTestCase::testStrippedFragmentAccountAutoUpdateSreg in modules/openid/openid.test
Test OpenID auto transition with e-mail.
OpenIDInvalidIdentifierTransitionTestCase::testStrippedFragmentAccountEmailMismatch in modules/openid/openid.test
Test OpenID transition with e-mail mismatch.
OpenIDRegistrationTestCase::testRegisterUserWithAXButNoSREG in modules/openid/openid.test
Test OpenID auto-registration with a provider that supplies AX information, but no SREG.
OpenIDRegistrationTestCase::testRegisterUserWithEmailVerification in modules/openid/openid.test
Test OpenID auto-registration with e-mail verification enabled.
OpenIDRegistrationTestCase::testRegisterUserWithInvalidSreg in modules/openid/openid.test
Test OpenID auto-registration with a provider that supplies invalid SREG information (a username that is already taken, and no e-mail address).
OpenIDRegistrationTestCase::testRegisterUserWithoutEmailVerification in modules/openid/openid.test
Test OpenID auto-registration with e-mail verification disabled.
OpenIDRegistrationTestCase::testRegisterUserWithoutSreg in modules/openid/openid.test
Test OpenID auto-registration with a provider that does not supply SREG information (i.e. no username or e-mail address).
openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
openid_login_validate in modules/openid/openid.module
Login form _validate hook
openid_test_html_openid1 in modules/openid/tests/openid_test.module
Menu callback; regular HTML page with OpenID 1.0 <link> element.
openid_test_html_openid2 in modules/openid/tests/openid_test.module
Menu callback; regular HTML page with OpenID 2.0 <link> element.
openid_test_redirect in modules/openid/tests/openid_test.module
Menu callback; redirect during Normalization/Discovery.
openid_test_yadis_http_equiv in modules/openid/tests/openid_test.module
Menu callback; regular HTML page with <meta> element.
openid_test_yadis_xrds in modules/openid/tests/openid_test.module
Menu callback; XRDS document that references the OP Endpoint URL.
openid_test_yadis_x_xrds_location in modules/openid/tests/openid_test.module
Menu callback; regular HTML page with an X-XRDS-Location HTTP header.
openid_user_add_submit in modules/openid/openid.pages.inc
options_help in modules/field/modules/options/options.module
Implements hook_help().
overlay_close_dialog in modules/overlay/overlay.module
Callback to request that the overlay close as soon as the page is displayed.
PageEditTestCase::testPageEdit in modules/node/node.test
Check node edit functionality.
page_example_description in examples/page_example/page_example.module
Constructs a descriptive page.
PathLanguageTestCase::testAliasTranslation in modules/path/path.test
Test alias functionality through the admin interfaces.
path_admin_form in modules/path/path.admin.inc
Return a form for editing or creating an individual URL alias.
path_admin_overview in modules/path/path.admin.inc
Return a listing of all defined URL aliases.
path_help in modules/path/path.module
Implements hook_help().
php_enable in modules/php/php.install
Implements hook_enable().
php_help in modules/php/php.module
Implements hook_help().
poll_help in modules/poll/poll.module
Implements hook_help().
ProfileBlockTestCase::testAuthorInformationBlock in modules/profile/profile.test
ProfileTestAutocomplete::testAutocomplete in modules/profile/profile.test
Tests profile field autocompletion and access.
profile_block_configure in modules/profile/profile.module
Implements hook_block_configure().
profile_field_delete in modules/profile/profile.admin.inc
Menu callback; deletes a field from all user profiles.
profile_help in modules/profile/profile.module
Implements hook_help().
RdfCommentAttributesTestCase::testCommentReplyOfRdfaMarkup in modules/rdf/rdf.test
Test RDF comment replies.
RdfCommentAttributesTestCase::testNumberOfCommentsRdfaMarkup in modules/rdf/rdf.test
Tests the presence of the RDFa markup for the number of comments.
RdfMappingDefinitionTestCase::testAttributesInMarkup1 in modules/rdf/rdf.test
Create a node of type blog and test whether the RDF mapping defined for this node type in rdf_test.module is used in the node page.
RdfMappingDefinitionTestCase::testAttributesInMarkup2 in modules/rdf/rdf.test
Create a content type and a node of type test_bundle_hook_install and test whether the RDF mapping defined in rdf_test.install is used.
RdfMappingDefinitionTestCase::testAttributesInMarkup3 in modules/rdf/rdf.test
Create a random content type and node and ensure the default mapping for node is used.
RdfMappingDefinitionTestCase::testTaxonomyTermRdfaAttributes in modules/rdf/rdf.test
Creates a random term and ensures the right RDFa markup is used.
RdfMappingDefinitionTestCase::testUserAttributesInMarkup in modules/rdf/rdf.test
Create a random user and ensure the default mapping for user is used.
RdfRdfaMarkupTestCase::testAttributesInMarkupFile in modules/rdf/rdf.test
Ensure that file fields have the correct resource as the object in RDFa when displayed as a teaser.
RdfTrackerAttributesTestCase::_testBasicTrackerRdfaMarkup in modules/rdf/rdf.test
Helper function for testAttributesInTracker().
rdf_comment_load in modules/rdf/rdf.module
Implements hook_comment_load().
rdf_preprocess_comment in modules/rdf/rdf.module
Implements MODULE_preprocess_HOOK().
rdf_preprocess_taxonomy_term in modules/rdf/rdf.module
Implements MODULE_preprocess_HOOK().
rdf_preprocess_username in modules/rdf/rdf.module
Implements MODULE_preprocess_HOOK().
rdf_preprocess_user_profile in modules/rdf/rdf.module
Implements MODULE_preprocess_HOOK().
RemoveFeedItemTestCase::testRemoveFeedItem in modules/aggregator/aggregator.test
Test running "remove items" from the 'admin/config/services/aggregator' page.
render_example_info in examples/render_example/render_example.module
Simple basic information about the module; an entry point.
SearchBlockTestCase::testBlock in modules/search/search.test
Test that the search block form works correctly.
SearchConfigSettingsForm::testSearchModuleDisabling in modules/search/search.test
Verify that you can disable individual search modules.
SearchLanguageTestCase::testLanguages in modules/search/search.test
search_admin_settings in modules/search/search.admin.inc
Menu callback: displays the search module settings page.
search_extra_type_search_execute in modules/search/tests/search_extra_type.module
Implements hook_search_execute().
search_form in modules/search/search.module
Builds a search form.
search_help in modules/search/search.module
Implements hook_help().
seven_node_add_list in themes/seven/template.php
Display the list of available node types for node creation.
shortcut_help in modules/shortcut/shortcut.module
Implements hook_help().
shortcut_set_switch_submit in modules/shortcut/shortcut.admin.inc
Submit handler for shortcut_set_switch().
SimpleTestBrowserTestCase::testGetAbsoluteUrl in modules/simpletest/simpletest.test
Test DrupalWebTestCase::getAbsoluteUrl().
simpletest_help in modules/simpletest/simpletest.module
Implements hook_help().
simpletest_requirements in modules/simpletest/simpletest.install
Implements hook_requirements().
simpletest_result_form in modules/simpletest/simpletest.pages.inc
Test results form for $test_id.
SiteMaintenanceTestCase::testSiteMaintenance in modules/system/system.test
Verify site maintenance mode functionality.
statistics_access_log in modules/statistics/statistics.admin.inc
Menu callback; Displays recent page accesses.
statistics_help in modules/statistics/statistics.module
Implements hook_help().
statistics_settings_form in modules/statistics/statistics.admin.inc
Form builder; Configure access logging.
system_admin_config_page in modules/system/system.admin.inc
Menu callback; Provide the administration overview page.
system_authorized_get_url in modules/system/system.module
Return the URL for the authorize.php script.
system_check_http_request in modules/system/system.module
Checks whether the server is capable of issuing HTTP requests.
system_clean_url_settings in modules/system/system.admin.inc
Form builder; Configure clean URL settings.
system_configure_date_formats_form in modules/system/system.admin.inc
Allow users to add additional date formats.
system_date_time_formats in modules/system/system.admin.inc
Displays the date format strings overview page.
system_date_time_settings in modules/system/system.admin.inc
Form builder; Configure the site date and time settings.
system_help in modules/system/system.module
Implements hook_help().
system_image_toolkit_settings in modules/system/system.admin.inc
Form builder; Configure site image toolkit usage.
system_modules in modules/system/system.admin.inc
Menu callback; provides module enable/disable interface.
system_modules_uninstall in modules/system/system.admin.inc
Builds a form of currently disabled modules.
system_performance_settings in modules/system/system.admin.inc
Form builder; Configure site performance settings.
system_permission in modules/system/system.module
Implements hook_permission().
system_requirements in modules/system/system.install
Test and report Drupal installation requirements.
system_site_information_settings in modules/system/system.admin.inc
Form builder; The general site information form.
system_site_maintenance_mode in modules/system/system.admin.inc
Form builder; Configure the site's maintenance status.
system_test_multiple_redirects in modules/simpletest/tests/system_test.module
Menu callback; sends a redirect header to itself until $count argument is 0.
system_test_redirect in modules/simpletest/tests/system_test.module
system_tokens in modules/system/system.tokens.inc
Implements hook_tokens().
system_update_7067 in modules/system/system.install
Grant administrators permission to view the administration theme.
system_user_login in modules/system/system.module
Implements hook_user_login().
TaxonomyTokenReplaceTestCase::testTaxonomyTokenReplacement in modules/taxonomy/taxonomy.test
Creates some terms and a node, then tests the tokens generated from them.
taxonomy_help in modules/taxonomy/taxonomy.module
Implements hook_help().
taxonomy_overview_terms in modules/taxonomy/taxonomy.admin.inc
Form builder for the taxonomy terms overview.
taxonomy_term_feed in modules/taxonomy/taxonomy.pages.inc
Generate the content feed for a taxonomy term.
taxonomy_tokens in modules/taxonomy/taxonomy.tokens.inc
Implements hook_tokens().
template_preprocess_aggregator_feed_source in modules/aggregator/aggregator.pages.inc
Process variables for aggregator-feed-source.tpl.php.
template_preprocess_aggregator_item in modules/aggregator/aggregator.pages.inc
Process variables for aggregator-item.tpl.php.
template_preprocess_book_navigation in modules/book/book.module
Process variables for book-navigation.tpl.php.
template_preprocess_forum_list in modules/forum/forum.module
Process variables to format a forum listing.
template_preprocess_forum_topic_list in modules/forum/forum.module
Preprocess variables to format the topic listing.
template_preprocess_maintenance_page in includes/theme.inc
The variables array generated here is a mirror of template_preprocess_page(). This preprocessor will run its course when theme_maintenance_page() is invoked.
template_preprocess_node in modules/node/node.module
Process variables for node.tpl.php
template_preprocess_page in includes/theme.inc
Preprocess variables for page.tpl.php
template_preprocess_taxonomy_term in modules/taxonomy/taxonomy.module
Process variables for taxonomy-term.tpl.php.
text_help in modules/field/modules/text/text.module
Implements hook_help().
theme_aggregator_page_rss in modules/aggregator/aggregator.pages.inc
Prints the RSS page for a feed.
theme_comment_post_forbidden in modules/comment/comment.module
Returns HTML for a "you can't post comments" notice.
theme_dashboard_disabled_blocks in modules/dashboard/dashboard.module
Returns HTML for a set of disabled blocks, for display in dashboard customization mode.
theme_image_style_list in modules/image/image.admin.inc
Returns HTML for the page containing the list of image styles.
theme_link in includes/theme.inc
Returns HTML for a link.
theme_node_add_list in modules/node/node.pages.inc
Returns HTML for a list of available node types for node creation.
theme_shortcut_set_customize in modules/shortcut/shortcut.admin.inc
Returns HTML for a shortcut set customization form.
theme_taxonomy_overview_vocabularies in modules/taxonomy/taxonomy.admin.inc
Returns HTML for the vocabulary overview form as a sortable list of vocabularies.
theme_textfield in includes/form.inc
Returns HTML for a textfield form element.
TokenReplaceTestCase::testSystemSiteTokenReplacement in modules/system/system.test
Tests the generation of all system site information tokens.
toolbar_help in modules/toolbar/toolbar.module
Implements hook_help().
tracker_help in modules/tracker/tracker.module
Implements hook_help().
tracker_page in modules/tracker/tracker.pages.inc
Menu callback; prints a listing of active nodes on the site.
TranslationTestCase::addLanguage in modules/translation/translation.test
Install a the specified language if it has not been already. Otherwise make sure that the language is enabled.
TranslationTestCase::assertLanguageSwitchLinks in modules/translation/translation.test
Check that the specified language switch links are found/not found.
translation_form_node_type_form_alter in modules/translation/translation.module
Implements hook_form_FORM_ID_alter().
translation_help in modules/translation/translation.module
Implements hook_help().
TriggerActionTestCase::generateTokenExpandedComparison in modules/trigger/trigger.test
Generates a comparison message to match the pre-token-replaced message.
trigger_assign_form in modules/trigger/trigger.admin.inc
Returns the form for assigning an action to a trigger.
trigger_example_help in examples/trigger_example/trigger_example.module
Implements hook_help().
trigger_help in modules/trigger/trigger.module
Implements hook_help().
UpdateCoreTestCase::testModulePageRegularUpdate in modules/update/update.test
Check the messages at admin/modules when missing an update.
UpdateCoreTestCase::testModulePageRunCron in modules/update/update.test
Check that running cron updates the list of available updates.
UpdateCoreTestCase::testModulePageSecurityUpdate in modules/update/update.test
Check the messages at admin/modules when missing a security update.
UpdateCoreTestCase::testModulePageUpToDate in modules/update/update.test
Check the messages at admin/modules when the site is up to date.
UpdateFeedTestCase::testUpdateFeed in modules/aggregator/aggregator.test
Create a feed and attempt to update it.
UpdateTestHelper::refreshUpdateStatus in modules/update/update.test
Refresh the update status based on the desired available update scenario.
UpdateTestUploadCase::testUpdateManagerCoreSecurityUpdateMessages in modules/update/update.test
Check the messages on Update manager pages when missing a security update.
update_help in modules/update/update.module
Implements hook_help().
update_mail in modules/update/update.module
Implements hook_mail().
update_manager_update_ready_form in modules/update/update.manager.inc
Build the form when the site is ready to update (after downloading).
update_settings in modules/update/update.settings.inc
Form builder for the update settings tab.
UpgradePathTaxonomyTestCase::testTaxonomyUpgrade in modules/simpletest/tests/upgrade/upgrade.taxonomy.test
Basic tests for the taxonomy upgrade.
UrlAlterFunctionalTest::assertUrlOutboundAlter in modules/simpletest/tests/path.test
Assert that an outbound path is altered to an expected value.
UserBlocksUnitTests::testUserLoginBlock in modules/user/user.test
Test the user login block.
UserLoginTestCase::assertFailedLogin in modules/user/user.test
Make an unsuccessful login attempt.
UserTokenReplaceTestCase::testUserTokenReplacement in modules/user/user.test
Creates a user, then tests the tokens generated from it.
user_account_form_validate in modules/user/user.module
Form validation handler for user_account_form().
user_admin_settings in modules/user/user.admin.inc
Form builder; Configure user settings for this site.
user_cancel_url in modules/user/user.module
Generates a URL to confirm an account cancellation request.
user_help in modules/user/user.module
Implement hook_help().
user_login_block in modules/user/user.module
user_login_final_validate in modules/user/user.module
The final validation handler on the login form.
user_pass_reset in modules/user/user.pages.inc
Menu callback; process one time login link and redirects to the user page on success.
user_pass_reset_url in modules/user/user.module
Generates a unique URL for a user to login and reset their password.
user_permission in modules/user/user.module
Implements hook_permission().
user_register_submit in modules/user/user.module
Submit handler for the user registration form.
user_search_execute in modules/user/user.module
Implements hook_search_execute().
user_tokens in modules/user/user.tokens.inc
Implements hook_tokens().
user_update_7017 in modules/user/user.install
Update email templates to use new tokens.
XMLRPCBasicTestCase::testListMethods in modules/simpletest/tests/xmlrpc.test
Ensure that a basic XML-RPC call with no parameters works.
XMLRPCBasicTestCase::testMethodSignature in modules/simpletest/tests/xmlrpc.test
Ensure that system.methodSignature returns an array of signatures.
XmlrpcExampleTestCase::setUp in examples/xmlrpc_example/xmlrpc_example.test
Enable module.
XMLRPCMessagesTestCase::testAlterListMethods in modules/simpletest/tests/xmlrpc.test
Ensure that hook_xmlrpc_alter() can hide even builtin methods.
XMLRPCMessagesTestCase::testSizedMessages in modules/simpletest/tests/xmlrpc.test
Make sure that XML-RPC can transfer large messages.
XMLRPCValidator1IncTestCase::testValidator1 in modules/simpletest/tests/xmlrpc.test
Run validator1 tests.
xmlrpc_example_alter_form in examples/xmlrpc_example/xmlrpc_example.module
Present a form to enable or disable the code implemented in hook_xmlrpc_alter.
xmlrpc_example_client_add_submit in examples/xmlrpc_example/xmlrpc_example.module
Submit: query the XML-RPC endpoint for the method xmlrpc_example.add and report the result as a Drupal message.
xmlrpc_example_client_form in examples/xmlrpc_example/xmlrpc_example.module
Present a form to get two arguments, and make a call to an XML-RPC server using these arguments as input, showing the result in a message.
xmlrpc_example_client_multicall_submit in examples/xmlrpc_example/xmlrpc_example.module
Submit a multicall request: query the XML-RPC endpoint for the methods xmlrpc_example.add and xmlrpc_example.subtract and report the result as a Drupal message. Drupal's XML-RPC client builds the system.multicall request automatically when there…
xmlrpc_example_client_request_methods_submit in examples/xmlrpc_example/xmlrpc_example.module
Submit: query the XML-RPC endpoint for the method system.listMethods and report the result as a Drupal message. The result is a list of the available methods in this XML-RPC server.
xmlrpc_example_client_subtract_submit in examples/xmlrpc_example/xmlrpc_example.module
Submit: query the XML-RPC endpoint for the method xmlrpc_example.subtract and report the result as a Drupal message.
xmlrpc_example_info in examples/xmlrpc_example/xmlrpc_example.module
A simple landing-page information function.
xmlrpc_example_server_form in examples/xmlrpc_example/xmlrpc_example.module
Present a form to configure the service options. In this case the maximum and minimum values for any of the operations (add or subtraction).
_action_example_page in examples/action_example/action_example.module
A simple page to explain to the developer what to do.
_batch_progress_page_js in includes/batch.inc
Output a batch processing page with JavaScript support.
_batch_progress_page_nojs in includes/batch.inc
Output a batch processing page without JavaScript support.
_menu_site_is_offline in includes/menu.inc
Checks whether the site is in maintenance mode.
_openid_test_endpoint_authenticate in modules/openid/tests/openid_test.module
OpenID endpoint; handle "authenticate" requests.
_openid_user_login_form_alter in modules/openid/openid.module
_php_filter_tips in modules/php/php.module
Tips callback for php filter.
_shortcut_link_form_elements in modules/shortcut/shortcut.admin.inc
Helper function for building a form for adding or editing shortcut links.
_update_message_text in modules/update/update.module
Helper function to return the appropriate message text when the site is out of date or missing a security update.
_update_no_data in modules/update/update.module
Prints a warning message when there is no data about available updates.
_vertical_tabs_example_explanation in examples/vertical_tabs_example/vertical_tabs_example.module
Simple explanation page.

Code

includes/common.inc, line 2068

<?php
function url($path = NULL, array $options = array()) {
  // Merge in defaults.
  $options += array(
    'fragment' => '', 
    'query' => array(), 
    'absolute' => FALSE, 
    'alias' => FALSE, 
    'prefix' => '',
  );

  if (!isset($options['external'])) {
    // Return an external link if $path contains an allowed absolute URL. Only
    // call the slow drupal_strip_dangerous_protocols() if $path contains a ':'
    // before any / ? or #. Note: we could use url_is_external($path) here, but
    // that would require another function call, and performance inside url() is
    // critical.
    $colonpos = strpos($path, ':');
    $options['external'] = ($colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && drupal_strip_dangerous_protocols($path) == $path);
  }

  // Preserve the original path before altering or aliasing.
  $original_path = $path;

  // Allow other modules to alter the outbound URL and options.
  drupal_alter('url_outbound', $path, $options, $original_path);

  if (isset($options['fragment']) && $options['fragment'] !== '') {
    $options['fragment'] = '#' . $options['fragment'];
  }

  if ($options['external']) {
    // Split off the fragment.
    if (strpos($path, '#') !== FALSE) {
      list($path, $old_fragment) = explode('#', $path, 2);
      // If $options contains no fragment, take it over from the path.
      if (isset($old_fragment) && !$options['fragment']) {
        $options['fragment'] = '#' . $old_fragment;
      }
    }
    // Append the query.
    if ($options['query']) {
      $path .= (strpos($path, '?') !== FALSE ? '&' : '?') . drupal_http_build_query($options['query']);
    }
    if (isset($options['https']) && variable_get('https', FALSE)) {
      if ($options['https'] === TRUE) {
        $path = str_replace('http://', 'https://', $path);
      }
      elseif ($options['https'] === FALSE) {
        $path = str_replace('https://', 'http://', $path);
      }
    }
    // Reassemble.
    return $path . $options['fragment'];
  }

  global $base_url, $base_secure_url, $base_insecure_url;

  // The base_url might be rewritten from the language rewrite in domain mode.
  if (!isset($options['base_url'])) {
    if (isset($options['https']) && variable_get('https', FALSE)) {
      if ($options['https'] === TRUE) {
        $options['base_url'] = $base_secure_url;
        $options['absolute'] = TRUE;
      }
      elseif ($options['https'] === FALSE) {
        $options['base_url'] = $base_insecure_url;
        $options['absolute'] = TRUE;
      }
    }
    else {
      $options['base_url'] = $base_url;
    }
  }

  // The special path '<front>' links to the default front page.
  if ($path == '<front>') {
    $path = '';
  }
  elseif (!empty($path) && !$options['alias']) {
    $language = isset($options['language']) && isset($options['language']->language) ? $options['language']->language : '';
    $alias = drupal_get_path_alias($original_path, $language);
    if ($alias != $original_path) {
      $path = $alias;
    }
  }

  $base = $options['absolute'] ? $options['base_url'] . '/' : base_path();
  $prefix = empty($path) ? rtrim($options['prefix'], '/') : $options['prefix'];

  // With Clean URLs.
  if (!empty($GLOBALS['conf']['clean_url'])) {
    $path = drupal_encode_path($prefix . $path);
    if ($options['query']) {
      return $base . $path . '?' . drupal_http_build_query($options['query']) . $options['fragment'];
    }
    else {
      return $base . $path . $options['fragment'];
    }
  }
  // Without Clean URLs.
  else {
    $path = $prefix . $path;
    $query = array();
    if (!empty($path)) {
      $query['q'] = $path;
    }
    if ($options['query']) {
      // We do not use array_merge() here to prevent overriding $path via query
      // parameters.
      $query += $options['query'];
    }
    $query = $query ? ('?' . drupal_http_build_query($query)) : '';
    $script = isset($options['script']) ? $options['script'] : '';
    return $base . $script . $query . $options['fragment'];
  }
}
?>