theme

Versions
4.6 – 6
theme()
7
theme($hook, $variables = array())

Generate the themed representation of a Drupal object.

All requests for themed functions must go through this function. It examines the request and routes it to the appropriate theme function. If the current theme does not implement the requested function, then the current theme engine is checked. If neither the engine nor theme implement the requested function, then the base theme function is called.

For example, to retrieve the HTML that is output by theme_page($output), a module should call theme('page', $output).

Parameters

$function The name of the theme function to call.

... Additional arguments to pass along to the theme function.

Return value

An HTML string that generates the themed output.

▾ 250 functions call theme()

aggregator_admin_edit_category in modules/aggregator.module
Menu callback; displays the category edit form, or saves changes and redirects to the overview page.
aggregator_admin_edit_feed in modules/aggregator.module
Menu callback; displays the feed edit form.
aggregator_admin_overview in modules/aggregator.module
Menu callback; displays the aggregator administration page.
aggregator_block in modules/aggregator.module
Implementation of hook_block().
aggregator_edit in modules/aggregator.module
aggregator_page_categories in modules/aggregator.module
Menu callback; displays all the categories used by the aggregator.
aggregator_page_source in modules/aggregator.module
Menu callback; displays all the items captured from a particular feed.
aggregator_page_sources in modules/aggregator.module
Menu callback; displays all the feeds used by the aggregator.
aggregator_parse_feed in modules/aggregator.module
aggregator_refresh in modules/aggregator.module
Checks a news feed for new items.
aggregator_remove in modules/aggregator.module
aggregator_view in modules/aggregator.module
archive_page in modules/archive.module
Menu callback; lists all nodes posted on a given date.
block_admin in modules/block.module
Menu callback; displays the block overview page.
block_admin_configure in modules/block.module
Menu callback; displays the block configuration form.
block_admin_display in modules/block.module
Prepare the main block administration form.
block_box_add in modules/block.module
Menu callback; displays the block creation form.
block_box_delete in modules/block.module
Menu callback; confirm and delete custom blocks.
blogapi_blogger_edit_post in modules/blogapi.module
Blogging API callback. Modifies the specified blog node.
blogapi_blogger_new_post in modules/blogapi.module
Blogging API callback. Inserts a new blog post as a node.
blog_page_last in modules/blog.module
Displays a Drupal page containing recent blog entries of all users.
blog_page_user in modules/blog.module
Displays a Drupal page containing recent blog entries of a given user.
book_admin in modules/book.module
Menu callback; displays the book administration page.
book_admin_orphan in modules/book.module
Menu callback; displays a listing of all orphaned book pages.
book_admin_save in modules/book.module
book_admin_view in modules/book.module
Display an administrative view of the hierarchy of a book.
book_nodeapi in modules/book.module
Implementation of hook_nodeapi().
book_outline in modules/book.module
Implementation of function book_outline() Handles all book outline operations.
book_render in modules/book.module
Menu callback; prints a listing of all books.
chameleon_comment in themes/chameleon/chameleon.theme
chameleon_node in themes/chameleon/chameleon.theme
chameleon_page in themes/chameleon/chameleon.theme
comment_admin_edit in modules/comment.module
Menu callback; edit a comment from the administrative interface.
comment_admin_overview in modules/comment.module
Menu callback; present an administrative comment listing.
comment_block in modules/comment.module
Implementation of hook_block().
comment_configure in modules/comment.module
Menu callback; presents the comment settings page.
comment_delete in modules/comment.module
Menu callback; delete a comment.
comment_edit in modules/comment.module
comment_link in modules/comment.module
Implementation of hook_link().
comment_links in modules/comment.module
comment_matrix_settings in modules/comment.module
Menu callback; presents the moderation vote matrix.
comment_post in modules/comment.module
comment_preview in modules/comment.module
comment_render in modules/comment.module
comment_reply in modules/comment.module
comment_role_settings in modules/comment.module
Menu callback; allows admin to set default scores for different roles.
comment_save in modules/comment.module
comment_threshold_settings in modules/comment.module
Menu callback; displays settings for thresholds at which comments are displayed.
comment_vote_settings in modules/comment.module
Menu callback; displays page for assigning names to vote values.
contact_mail_user in modules/contact.module
do_search in modules/search.module
Do a query on the full-text search index for a word or words.
drupal_access_denied in includes/common.inc
Generates a 403 error if the request is not allowed.
drupal_auth in modules/drupal.module
Implementation of hook_auth().
drupal_directory_ping in modules/drupal.module
Callback function from drupal_xmlrpc() called when another site pings this one.
drupal_get_html_head in includes/common.inc
Retrieve output to be displayed in the head tag of the HTML page.
drupal_notify in modules/drupal.module
Sends a ping to the Drupal directory server.
drupal_not_found in includes/common.inc
Generates a 404 error if the request can not be handled.
drupal_page_help in modules/drupal.module
Menu callback; print Drupal-authentication-specific information from user/help.
drupal_xml_parser_create in includes/common.inc
Prepare a new XML parser.
fileupload_form in developer/examples/fileupload.module
fileupload_view in developer/examples/fileupload.module
file_check_directory in includes/file.inc
Check that directory exists and is writable.
filter_admin_add in modules/filter.module
Add a new input format.
filter_admin_configure in modules/filter.module
Menu callback; display settings defined by filters.
filter_admin_delete in modules/filter.module
Menu callback; confirm deletion of a format.
filter_admin_filters in modules/filter.module
Menu callback; configure the filters for a format.
filter_admin_order in modules/filter.module
Menu callback; display form for ordering filters for a format.
filter_admin_overview in modules/filter.module
Menu callback; allows administrators to set up input formats.
filter_filter_tips in modules/filter.module
Implementation of hook_filter_tips().
filter_form in modules/filter.module
Generate a selector for choosing a format in a form.
filter_tips_long in modules/filter.module
Menu callback; show a page with long filter tips.
form_checkbox in includes/common.inc
Format a checkbox.
form_checkboxes in includes/common.inc
Format a set of checkboxes.
form_file in includes/common.inc
Format a file upload field.
form_item in includes/common.inc
Format a general form item.
form_password in includes/common.inc
Format a single-line text field that does not display its contents visibly.
form_radio in includes/common.inc
Format a radio button.
form_radios in includes/common.inc
Format a set of radio buttons.
form_select in includes/common.inc
Format a dropdown menu or scrolling selection box.
form_textarea in includes/common.inc
Format a multiple-line text field.
form_textfield in includes/common.inc
Format a single-line text field.
forum_admin in modules/forum.module
Administration page which allows maintaining forums
forum_admin_configure in modules/forum.module
Implementation of hook_settings
forum_overview in modules/forum.module
Returns an overview list of existing forums and containers
forum_page in modules/forum.module
Menu callback; prints a forum listing.
forum_validate in modules/forum.module
Implementation of hook_validate().
help_main in modules/help.module
Menu callback; prints a page listing a glossary of Drupal terminology.
help_page in modules/help.module
Menu callback; prints a page listing general help for all modules.
hook_nodeapi in developer/hooks/core.php
Act on nodes defined by other modules.
locale_admin_export in modules/locale.module
Page handler for the translation export screen
locale_admin_import in modules/locale.module
Page handler for the translation import screen
locale_admin_manage in modules/locale.module
Page handler for the language management screen
locale_admin_manage_add in modules/locale.module
Page handler for the language addition screen
locale_admin_manage_delete_screen in modules/locale.module
User interface for the language deletion confirmation screen
locale_admin_string in modules/locale.module
Page handler for the string search and administration screen
menu_add_menu in modules/menu.module
Menu callback; handle the adding of a new menu.
menu_block in modules/menu.module
Implementation of hook_block().
menu_delete_item in modules/menu.module
Menu callback; delete a single custom item.
menu_disable_item in modules/menu.module
Menu callback; hide a menu item.
menu_edit_item in modules/menu.module
Menu callback; dispatch to the appropriate menu item edit function.
menu_edit_item_save in modules/menu.module
Save changes to a menu item into the database.
menu_get_active_help in includes/menu.inc
Returns the help associated with the active menu item.
menu_item_link in includes/menu.inc
Returns the rendered link to a menu item.
menu_overview in modules/menu.module
Menu callback; present the main menu management page.
menu_overview_tree in modules/menu.module
Present the menu tree, rendered along with links to edit menu items.
menu_primary_local_tasks in includes/menu.inc
Returns the rendered HTML of the primary local tasks.
menu_reset in modules/menu.module
Menu callback; clear the database, resetting the menu to factory defaults.
menu_reset_item in modules/menu.module
Menu callback; reset a single modified item.
menu_secondary_local_tasks in includes/menu.inc
Returns the rendered HTML of the secondary local tasks.
menu_tree in includes/menu.inc
Returns a rendered menu tree.
nodeapi_example_nodeapi in developer/examples/nodeapi_example.module
Implementation of hook_nodeapi().
node_admin in modules/node.module
Menu callback; presents the content administration overview.
node_admin_nodes in modules/node.module
Generate the content administration overview.
node_block in modules/node.module
Implementation of hook_block().
node_configure in modules/node.module
Menu callback; presents general node configuration options.
node_delete in modules/node.module
Ask for confirmation, and delete the node.
node_example_view in developer/examples/node_example.module
Implementation of hook_view().
node_page in modules/node.module
Menu callback; dispatches control to the appropriate operation handler.
node_page_default in modules/node.module
Generate a listing of promoted nodes.
node_preview in modules/node.module
Generate a node preview, including a form for further edits.
node_revision_delete in modules/node.module
Delete the revision with specified revision number.
node_revision_overview in modules/node.module
Generate an overview table of older revisions of a node.
node_revision_rollback in modules/node.module
Roll back to the revision with the specified revision number.
node_submit in modules/node.module
Accepts a submission of new or changed node content.
node_title_list in modules/node.module
Gather a listing of links to nodes.
node_types_configure in modules/node.module
Menu callback; presents each node type configuration page.
node_validate in modules/node.module
Perform validation checks on the given node.
node_view in modules/node.module
Generate a display of the given node.
page_example_baz in developer/examples/page_example.module
A more complex page callback that takes arguments.
page_example_foo in developer/examples/page_example.module
A simple page callback.
path_admin in modules/path.module
Menu callback; presents an overview of all URL aliases.
path_admin_edit in modules/path.module
Menu callback; handles pages for creating and editing URL aliases.
path_overview in modules/path.module
Return a listing of all defined URL aliases.
path_save in modules/path.module
Verify that a new URL alias is valid, and save it to the database.
poll_page in modules/poll.module
poll_results in modules/poll.module
Callback for the 'results' tab for polls you can vote on
poll_view in modules/poll.module
Implementation of hook_view().
profile_admin_add in modules/profile.module
Menu callback; adds a new field to all user profiles.
profile_admin_edit in modules/profile.module
Menu callback; displays the profile field editing form.
profile_admin_overview in modules/profile.module
Menu callback; display a listing of all editable profile fields.
profile_browse in modules/profile.module
Menu callback; display a list of user information.
profile_validate_profile in modules/profile.module
queue_overview in modules/queue.module
Display a page listing the nodes in the submission queue.
queue_view in modules/queue.module
Display a queued node along with voting options for it.
queue_vote in modules/queue.module
search_admin in modules/search.module
Menu callback; displays the search module settings page.
search_data in modules/search.module
Perform a standard search on the given keys, and return the formatted results.
search_view in modules/search.module
Menu callback; presents the search form and/or search results.
statistics_access_log in modules/statistics.module
statistics_node_tracker in modules/statistics.module
statistics_recent_hits in modules/statistics.module
Menu callback; presents the "Recent hits" page.
statistics_top_pages in modules/statistics.module
Menu callback; presents the "Top pages" page.
statistics_top_referrers in modules/statistics.module
Menu callback; presents the "Top referrers" page.
statistics_top_users in modules/statistics.module
Menu callback; presents the "Top users" page.
statistics_user_tracker in modules/statistics.module
system_modules in modules/system.module
Menu callback; displays a listing of all modules.
system_module_listing in modules/system.module
Generate a list of all the available modules, as well as update the system list.
system_site_settings in modules/system.module
Menu callback; displays a module's settings page.
system_themes in modules/system.module
Menu callback; displays a listing of all themes.
system_theme_listing in modules/system.module
Generate a list of all the available theme/style combinations.
system_theme_settings in modules/system.module
Menu callback; display theme configuration for entire site and individual themes.
system_user in modules/system.module
Implementation of hook_user().
tablesort_header in includes/tablesort.inc
Format a column header.
taxonomy_admin in modules/taxonomy.module
Menu callback; dispatches to the proper taxonomy administration function.
taxonomy_del_term in modules/taxonomy.module
taxonomy_del_vocabulary in modules/taxonomy.module
taxonomy_overview in modules/taxonomy.module
Generate a tabular listing of administrative functions for vocabularies.
taxonomy_render_nodes in modules/taxonomy.module
Accepts the result of a pager_query() call, such as that performed by taxonomy_select_nodes(), and formats each node along with a pager.
taxonomy_save_term in modules/taxonomy.module
taxonomy_save_vocabulary in modules/taxonomy.module
taxonomy_term_page in modules/taxonomy.module
Menu callback; displays all nodes associated with a term.
theme_aggregator_block_item in modules/aggregator.module
Format an individual feed item for display in the block.
theme_aggregator_feed in modules/aggregator.module
Format a news feed.
theme_blocks in includes/theme.inc
Return a set of blocks available for the current user.
theme_comment in modules/comment.module
theme_comment_controls in modules/comment.module
theme_comment_flat_collapsed in modules/comment.module
theme_comment_flat_expanded in modules/comment.module
theme_comment_folded in modules/comment.module
theme_comment_form in modules/comment.module
theme_comment_preview in modules/comment.module
theme_comment_thread_max in modules/comment.module
theme_comment_thread_min in modules/comment.module
theme_comment_view in modules/comment.module
theme_forum_display in modules/forum.module
Format the forum body.
theme_forum_list in modules/forum.module
Format the forum listing.
theme_forum_topic_list in modules/forum.module
Format the topic listing.
theme_get_styles in includes/theme.inc
Return the HTML for a theme's stylesheets.
theme_node in includes/theme.inc
Return a themed node.
theme_node_list in modules/node.module
Format a listing of links to nodes.
theme_page in includes/theme.inc
Return an entire Drupal page displaying the supplied content.
theme_pager in includes/pager.inc
Format a query pager.
theme_pager_last in includes/pager.inc
Format a "last page" link.
theme_pager_list in includes/pager.inc
Format a list of nearby pages with additional query results.
theme_pager_previous in includes/pager.inc
Format a "previous page" link.
theme_profile_profile in modules/profile.module
theme_user_list in modules/user.module
theme_user_picture in modules/user.module
theme_user_profile in modules/user.module
theme_xml_icon in includes/theme.inc
Return code that emits an XML icon.
tracker_page in modules/tracker.module
Menu callback. Prints a listing of active nodes on the site.
update_page in ./update.php
upload_admin in modules/upload.module
upload_form in modules/upload.module
upload_nodeapi in modules/upload.module
Implementation of hook_nodeapi().
user_admin in modules/user.module
user_admin_access in modules/user.module
Menu callback: list all access rules
user_admin_access_add in modules/user.module
Menu callback: add an access rule
user_admin_access_check in modules/user.module
Menu callback: check an access rule
user_admin_access_delete in modules/user.module
Menu callback: delete an access rule
user_admin_access_edit in modules/user.module
Menu callback: edit an access rule
user_admin_account in modules/user.module
user_admin_create in modules/user.module
user_admin_perm in modules/user.module
Menu callback: administer permissions.
user_admin_role in modules/user.module
Menu callback: administer roles.
user_authenticate in modules/user.module
user_block in modules/user.module
Implementation of hook_block().
user_configure in modules/user.module
user_edit in modules/user.module
user_edit_form in modules/user.module
user_edit_validate in modules/user.module
user_help_page in modules/user.module
Menu callback; Prints user-specific help information.
user_login in modules/user.module
user_logout in modules/user.module
Menu callback; logs the current user out, and redirects to the home page.
user_page in modules/user.module
user_pass in modules/user.module
user_register in modules/user.module
user_validate_authmap in modules/user.module
user_validate_mail in modules/user.module
user_validate_name in modules/user.module
Verify the syntax of the given name.
user_view in modules/user.module
watchdog_event in modules/watchdog.module
Menu callback; displays details about a log message.
watchdog_overview in modules/watchdog.module
Menu callback; displays a listing of log messages.
xtemplate_comment in themes/engines/xtemplate/xtemplate.engine
xtemplate_node in themes/engines/xtemplate/xtemplate.engine
xtemplate_page in themes/engines/xtemplate/xtemplate.engine
_aggregator_page_list in modules/aggregator.module
Prints an aggregator page listing a number of feed items. Various menu callbacks use this function to print their feeds.
_comment_delete_thread in modules/comment.module
_forum_confirm_delete in modules/forum.module
Returns a confirmation page for deleting a forum taxonomy term
_forum_icon in modules/forum.module
_locale_add_language in includes/locale.inc
Helper function to add a language
_locale_admin_manage_screen in includes/locale.inc
User interface for the language management screen
_locale_export_po in includes/locale.inc
Exports a Portable Object (Template) file for a language
_locale_import_parse_plural_forms in includes/locale.inc
Parses a Plural-Forms entry from a Gettext Portable Object file header
_locale_import_po in includes/locale.inc
Parses Gettext Portable Object file information and inserts into database
_locale_import_read_po in includes/locale.inc
Parses Gettext Portable Object file into an array
_locale_string_seek in includes/locale.inc
Perform a string search and display results in a table
_taxonomy_confirm_del_term in modules/taxonomy.module
_taxonomy_confirm_del_vocabulary in modules/taxonomy.module
_throttle_validate in modules/throttle.module

Code

includes/theme.inc, line 172

<?php
function theme() {
  global $theme, $theme_engine;

  if (!$theme) {
    // Initialize the enabled theme.
    $theme = init_theme();
  }

  $args = func_get_args();
  $function = array_shift($args);

  if (($theme != '') && function_exists($theme .'_'. $function)) {
    // call theme function
    return call_user_func_array($theme .'_'. $function, $args);
  }
  elseif (($theme != '') && isset($theme_engine) && function_exists($theme_engine .'_'. $function)) {
    // call engine function
    return call_user_func_array($theme_engine .'_'. $function, $args);
  }
  elseif (function_exists('theme_'. $function)){
    // call Drupal function
    return call_user_func_array('theme_'. $function, $args);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.