diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php index e84b33b..c1672e2 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -426,7 +426,7 @@ protected function processExtension(&$cache, $name, $type, $theme, $path) { // If function and file are omitted, default to standard naming // conventions. if (!isset($info['template']) && !isset($info['function'])) { - $result[$hook]['function'] = ($type == 'module' ? 'theme_' : $name . '_') . $hook; + $result[$hook]['template'] = strtr($hook, '_', '-'); } if (isset($cache[$hook]['includes'])) { diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module index 47f2173..c41db29 100644 --- a/core/modules/aggregator/aggregator.module +++ b/core/modules/aggregator/aggregator.module @@ -79,6 +79,7 @@ function aggregator_theme() { 'aggregator_page_opml' => array( 'variables' => array('feeds' => NULL), 'file' => 'aggregator.theme.inc', + 'function' => 'theme_aggregator_page_opml', ), 'aggregator_page_rss' => array( 'variables' => array('feeds' => NULL), diff --git a/core/modules/book/book.module b/core/modules/book/book.module index 8c52221..74a6ea7 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -57,6 +57,7 @@ function book_theme() { ), 'book_link' => array( 'render element' => 'element', + 'function' => 'theme_book_link', ), 'book_export_html' => array( 'variables' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL), @@ -65,6 +66,7 @@ function book_theme() { 'book_admin_table' => array( 'render element' => 'form', 'file' => 'book.admin.inc', + 'function' => 'theme_book_admin_table', ), 'book_all_books_block' => array( 'render element' => 'book_menus', diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index e68df34..0ef77d2 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -86,6 +86,7 @@ function field_ui_theme() { return array( 'field_ui_table' => array( 'render element' => 'elements', + 'function' => 'theme_field_ui_table', ), ); } diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 3890862..003e06c 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -569,26 +569,33 @@ function file_theme() { // file.module. 'file_link' => array( 'variables' => array('file' => NULL, 'icon_directory' => NULL, 'description' => NULL, 'attributes' => array()), + 'function' => 'theme_file_link', ), 'file_icon' => array( 'variables' => array('file' => NULL, 'icon_directory' => NULL), + 'function' => 'theme_file_icon', ), 'file_managed_file' => array( 'render element' => 'element', + 'function' => 'theme_file_managed_file', ), // file.field.inc. 'file_widget' => array( 'render element' => 'element', + 'function' => 'theme_file_widget', ), 'file_widget_multiple' => array( 'render element' => 'element', + 'function' => 'theme_file_widget_multiple', ), 'file_formatter_table' => array( 'variables' => array('items' => NULL), + 'function' => 'theme_file_formatter_table', ), 'file_upload_help' => array( 'variables' => array('description' => NULL, 'upload_validators' => NULL, 'cardinality' => NULL), + 'function' => 'theme_file_upload_help', ), ); } diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 5facc3c..3f4fd23 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -92,6 +92,7 @@ function forum_theme() { ), 'forum_form' => array( 'render element' => 'form', + 'function' => 'theme_forum_form', ), ); } diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 61b30b9..48bf873 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -111,46 +111,56 @@ function image_theme() { 'title' => NULL, 'attributes' => array(), ), + 'function' => 'theme_image_style', ), // Theme functions in image.admin.inc. 'image_style_effects' => array( 'render element' => 'form', 'file' => 'image.admin.inc', + 'function' => 'theme_image_style_effects', ), 'image_style_preview' => array( 'variables' => array('style' => NULL), 'file' => 'image.admin.inc', + 'function' => 'theme_image_style_preview', ), 'image_anchor' => array( 'render element' => 'element', 'file' => 'image.admin.inc', + 'function' => 'theme_image_anchor', ), 'image_resize_summary' => array( 'variables' => array('data' => NULL), 'file' => 'image.admin.inc', + 'function' => 'theme_image_resize_summary', ), 'image_scale_summary' => array( 'variables' => array('data' => NULL), 'file' => 'image.admin.inc', + 'function' => 'theme_image_scale_summary', ), 'image_crop_summary' => array( 'variables' => array('data' => NULL), 'file' => 'image.admin.inc', + 'function' => 'theme_image_crop_summary', ), 'image_rotate_summary' => array( 'variables' => array('data' => NULL), 'file' => 'image.admin.inc', + 'function' => 'theme_image_rotate_summary', ), // Theme functions in image.field.inc. 'image_widget' => array( 'render element' => 'element', 'file' => 'image.field.inc', + 'function' => 'theme_image_widget', ), 'image_formatter' => array( 'variables' => array('item' => NULL, 'item_attributes' => NULL, 'path' => NULL, 'image_style' => NULL), 'file' => 'image.field.inc', + 'function' => 'theme_image_formatter', ), ); } diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 6a17f73..b34d131 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -98,14 +98,17 @@ function language_theme() { 'language_negotiation_configure_form' => array( 'render element' => 'form', 'file' => 'language.admin.inc', + 'function' => 'theme_language_negotiation_configure_form', ), 'language_negotiation_configure_browser_form_table' => array( 'render element' => 'form', 'file' => 'language.admin.inc', + 'function' => 'theme_language_negotiation_configure_browser_form_table', ), 'language_content_settings_table' => array( 'render element' => 'element', 'file' => 'language.admin.inc', + 'function' => 'theme_language_content_settings_table', ), ); } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 881ca9a..651f4bd 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -188,6 +188,7 @@ function locale_theme() { 'locale_translate_edit_form_strings' => array( 'render element' => 'form', 'file' => 'locale.pages.inc', + 'function' => 'theme_locale_translate_edit_form_strings', ), 'locale_translation_last_check' => array( 'variables' => array('last' => NULL), diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 47b5813..3fd169c 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -108,6 +108,7 @@ function menu_theme() { 'menu_overview_form' => array( 'file' => 'menu.admin.inc', 'render element' => 'form', + 'function' => 'theme_menu_overview_form', ), ); } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index d793975..c065f2e 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -158,6 +158,7 @@ function node_theme() { ), 'node_search_admin' => array( 'render element' => 'form', + 'function' => 'theme_node_search_admin', ), 'node_add_list' => array( 'variables' => array('content' => NULL), @@ -175,6 +176,7 @@ function node_theme() { ), 'field__node__title' => array( 'base hook' => 'field', + 'function' => 'theme_field__node__title', ), ); } diff --git a/core/modules/responsive_image/responsive_image.module b/core/modules/responsive_image/responsive_image.module index 412dbc9..d206038 100644 --- a/core/modules/responsive_image/responsive_image.module +++ b/core/modules/responsive_image/responsive_image.module @@ -102,6 +102,7 @@ function responsive_image_theme() { 'attributes' => array(), 'breakpoints' => array(), ), + 'function' => 'theme_responsive_image', ), 'responsive_image_formatter' => array( 'variables' => array( @@ -110,6 +111,7 @@ function responsive_image_theme() { 'image_style' => NULL, 'breakpoints' => array(), ), + 'function' => 'theme_responsive_image_formatter', ), 'responsive_image_source' => array( 'variables' => array( @@ -118,6 +120,7 @@ function responsive_image_theme() { 'dimensions' => NULL, 'media' => NULL, ), + 'function' => 'theme_responsive_image_source', ), ); } diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index adc5bda..ae711af 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -55,6 +55,7 @@ function simpletest_theme() { 'simpletest_result_summary' => array( 'render element' => 'form', 'file' => 'simpletest.theme.inc', + 'function' => 'theme_simpletest_result_summary', ), ); } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 541168d..911fc07 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -165,6 +165,7 @@ function system_theme() { ), 'system_config_form' => array( 'render element' => 'form', + 'function' => 'theme_system_config_form', ), 'confirm_form' => array( 'render element' => 'form', @@ -173,10 +174,12 @@ function system_theme() { 'system_modules_details' => array( 'render element' => 'form', 'file' => 'system.admin.inc', + 'function' => 'theme_system_modules_details', ), 'system_modules_uninstall' => array( 'render element' => 'form', 'file' => 'system.admin.inc', + 'function' => 'theme_system_modules_uninstall', ), 'status_report' => array( 'variables' => array('requirements' => NULL), @@ -201,9 +204,11 @@ function system_theme() { 'system_admin_index' => array( 'variables' => array('menu_items' => NULL), 'file' => 'system.admin.inc', + 'function' => 'theme_system_admin_index', ), 'system_compact_link' => array( 'variables' => array(), + 'function' => 'theme_system_compact_link', ), )); } diff --git a/core/modules/system/tests/modules/common_test/common_test.module b/core/modules/system/tests/modules/common_test/common_test.module index 1a081df..2894396 100644 --- a/core/modules/system/tests/modules/common_test/common_test.module +++ b/core/modules/system/tests/modules/common_test/common_test.module @@ -119,6 +119,7 @@ function common_test_theme() { ), 'common_test_empty' => array( 'variables' => array('foo' => 'foo'), + 'function' => 'theme_common_test_empty', ), ); } diff --git a/core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module b/core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module index e963c2f..3597839 100644 --- a/core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module +++ b/core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module @@ -12,6 +12,7 @@ function theme_suggestions_test_theme() { $items['theme_suggestions_test_include'] = array( 'file' => 'theme_suggestions_test.inc', 'variables' => array(), + 'function' => 'theme_suggestions_test_include', ); return $items; } diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module index b6f13c8..27a0136 100644 --- a/core/modules/system/tests/modules/theme_test/theme_test.module +++ b/core/modules/system/tests/modules/theme_test/theme_test.module @@ -7,6 +7,7 @@ function theme_test_theme($existing, $type, $theme, $path) { $items['theme_test'] = array( 'file' => 'theme_test.inc', 'variables' => array('foo' => ''), + 'function' => 'theme_theme_test', ); $items['theme_test_template_test'] = array( 'template' => 'theme_test.template_test', @@ -32,12 +33,15 @@ function theme_test_theme($existing, $type, $theme, $path) { ); $items['theme_test_function_suggestions'] = array( 'variables' => array(), + 'function' => 'theme_theme_test_function_suggestions', ); $items['theme_test_suggestions_include'] = array( 'variables' => array(), + 'function' => 'theme_theme_test_suggestions_include', ); $items['theme_test_foo'] = array( 'variables' => array('foo' => NULL), + 'function' => 'theme_theme_test_foo', ); $items['theme_test_render_element'] = array( 'render element' => 'elements', @@ -45,9 +49,11 @@ function theme_test_theme($existing, $type, $theme, $path) { ); $items['theme_test_render_element_children'] = array( 'render element' => 'element', + 'function' => 'theme_theme_test_render_element_children', ); $items['theme_test_function_template_override'] = array( 'variables' => array(), + 'function' => 'theme_theme_test_function_template_override', ); $info['test_theme_not_existing_function'] = array( 'function' => 'test_theme_not_existing_function', diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index 0f58cb2..e5c7cb9 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -53,6 +53,7 @@ function toolbar_theme($existing, $type, $theme, $path) { ); $items['toolbar_item'] = array( 'render element' => 'element', + 'function' => 'theme_toolbar_item', ); return $items; diff --git a/core/modules/update/update.module b/core/modules/update/update.module index db3b893..129087c 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -170,21 +170,26 @@ function update_theme() { 'update_manager_update_form' => array( 'render element' => 'form', 'file' => 'update.manager.inc', + 'function' => 'theme_update_manager_update_form', ), 'update_last_check' => array( 'variables' => array('last' => NULL), + 'function' => 'theme_update_last_check', ), 'update_report' => array( 'variables' => array('data' => NULL), 'file' => 'update.report.inc', + 'function' => 'theme_update_report', ), 'update_version' => array( 'variables' => array('version' => NULL, 'tag' => NULL, 'class' => array()), 'file' => 'update.report.inc', + 'function' => 'theme_update_version', ), 'update_status_label' => array( 'variables' => array('status' => NULL), 'file' => 'update.report.inc', + 'function' => 'theme_update_status_label', ), ); } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 191140f..e79ee6f 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -103,12 +103,15 @@ function user_theme() { 'user_permission_description' => array( 'variables' => array('permission_item' => NULL, 'hide' => NULL), 'file' => 'user.admin.inc', + 'function' => 'theme_user_permission_description', ), 'user_signature' => array( 'variables' => array('signature' => NULL), + 'function' => 'theme_user_signature', ), 'username' => array( 'variables' => array('account' => NULL, 'attributes' => array()), + 'function' => 'theme_username', ), ); } diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 9d6e4af..4d7d70a 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -121,6 +121,7 @@ function views_theme($existing, $type, $theme, $path) { $hooks['views_mini_pager'] = $base + array( 'variables' => array('tags' => array(), 'quantity' => 10, 'element' => 0, 'parameters' => array()), 'template' => 'views-mini-pager', + 'function' => 'theme_views_mini_pager', ); $variables = array( @@ -140,6 +141,7 @@ function views_theme($existing, $type, $theme, $path) { // Default view themes $hooks['views_view_field'] = $base + array( 'variables' => array('view' => NULL, 'field' => NULL, 'row' => NULL), + 'function' => 'theme_views_view_field', ); $hooks['views_view_grouping'] = $base + array( 'variables' => array('view' => NULL, 'grouping' => NULL, 'grouping_level' => NULL, 'rows' => NULL, 'title' => NULL), @@ -207,6 +209,7 @@ function views_theme($existing, $type, $theme, $path) { $hooks['views_form_views_form'] = $base + array( 'render element' => 'form', + 'function' => 'theme_views_form_views_form', ); $hooks['views_exposed_form'] = $base + array( diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index 951321c..abe9255 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -80,10 +80,12 @@ function views_ui_theme() { 'views_ui_rearrange_filter_form' => array( 'render element' => 'form', 'file' => 'views_ui.theme.inc', + 'function' => 'theme_views_ui_rearrange_filter_form', ), 'views_ui_expose_filter_form' => array( 'render element' => 'form', 'file' => 'views_ui.theme.inc', + 'function' => 'theme_views_ui_expose_filter_form', ), // list views @@ -97,6 +99,7 @@ function views_ui_theme() { 'views_ui_build_group_filter_form' => array( 'render element' => 'form', 'file' => 'views_ui.theme.inc', + 'function' => 'theme_views_ui_build_group_filter_form', ), // On behalf of a plugin