diff options
Diffstat (limited to 'modules')
38 files changed, 187 insertions, 165 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 096675dc9..cfbf83bb8 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -40,43 +40,43 @@ function aggregator_help($path, $arg) { function aggregator_theme() { return array( 'aggregator_wrapper' => array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-wrapper', ), 'aggregator_categorize_items' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'aggregator.pages.inc', ), 'aggregator_feed_source' => array( - 'arguments' => array('feed' => NULL), + 'variables' => array('feed' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-feed-source', ), 'aggregator_block_item' => array( - 'arguments' => array('item' => NULL, 'feed' => 0), + 'variables' => array('item' => NULL, 'feed' => 0), ), 'aggregator_summary_items' => array( - 'arguments' => array('summary_items' => NULL, 'source' => NULL), + 'variables' => array('summary_items' => NULL, 'source' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-summary-items', ), 'aggregator_summary_item' => array( - 'arguments' => array('item' => NULL), + 'variables' => array('item' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-summary-item', ), 'aggregator_item' => array( - 'arguments' => array('item' => NULL), + 'variables' => array('item' => NULL), 'file' => 'aggregator.pages.inc', 'template' => 'aggregator-item', ), 'aggregator_page_opml' => array( - 'arguments' => array('feeds' => NULL), + 'variables' => array('feeds' => NULL), 'file' => 'aggregator.pages.inc', ), 'aggregator_page_rss' => array( - 'arguments' => array('feeds' => NULL, 'category' => NULL), + 'variables' => array('feeds' => NULL, 'category' => NULL), 'file' => 'aggregator.pages.inc', ), ); diff --git a/modules/block/block.module b/modules/block/block.module index e5e82de53..854373f1b 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -47,13 +47,13 @@ function block_help($path, $arg) { function block_theme() { return array( 'block' => array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', 'template' => 'block', ), 'block_admin_display_form' => array( 'template' => 'block-admin-display-form', 'file' => 'block.admin.inc', - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), ); } diff --git a/modules/book/book.module b/modules/book/book.module index eb76ed408..78b856c3b 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -12,25 +12,25 @@ function book_theme() { return array( 'book_navigation' => array( - 'arguments' => array('book_link' => NULL), + 'variables' => array('book_link' => NULL), 'template' => 'book-navigation', ), 'book_export_html' => array( - 'arguments' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL), + 'variables' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL), 'template' => 'book-export-html', ), 'book_admin_table' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'book_title_link' => array( - 'arguments' => array('link' => NULL), + 'variables' => array('link' => NULL), ), 'book_all_books_block' => array( - 'arguments' => array('book_menus' => array()), + 'render element' => 'book_menus', 'template' => 'book-all-books-block', ), 'book_node_export_html' => array( - 'arguments' => array('node' => NULL, 'children' => NULL), + 'variables' => array('node' => NULL, 'children' => NULL), 'template' => 'book-node-export-html', ), ); diff --git a/modules/color/color.module b/modules/color/color.module index 72d2037d0..7051386f2 100644 --- a/modules/color/color.module +++ b/modules/color/color.module @@ -22,7 +22,7 @@ function color_help($path, $arg) { function color_theme() { return array( 'color_scheme_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), ); } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 2f520a183..441c90dac 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -122,21 +122,21 @@ function comment_entity_info() { function comment_theme() { return array( 'comment_block' => array( - 'arguments' => array(), + 'variables' => array(), ), 'comment_preview' => array( - 'arguments' => array('comment' => NULL), + 'variables' => array('comment' => NULL), ), 'comment' => array( 'template' => 'comment', - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', ), 'comment_post_forbidden' => array( - 'arguments' => array('node' => NULL), + 'variables' => array('node' => NULL), ), 'comment_wrapper' => array( 'template' => 'comment-wrapper', - 'arguments' => array('content' => NULL), + 'render element' => 'content', ), ); } diff --git a/modules/dashboard/dashboard.module b/modules/dashboard/dashboard.module index 26e13eeeb..c04c815bc 100644 --- a/modules/dashboard/dashboard.module +++ b/modules/dashboard/dashboard.module @@ -152,19 +152,19 @@ function dashboard_system_info_alter(&$info, $file, $type) { function dashboard_theme() { return array( 'dashboard' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'dashboard_admin' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'dashboard_region' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'dashboard_disabled_blocks' => array( - 'arguments' => array('blocks' => NULL), + 'variables' => array('blocks' => NULL), ), 'dashboard_disabled_block' => array( - 'arguments' => array('block' => NULL), + 'variables' => array('block' => NULL), ), ); } diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module index 7607c34b1..bdc3db114 100644 --- a/modules/dblog/dblog.module +++ b/modules/dblog/dblog.module @@ -33,7 +33,7 @@ function dblog_help($path, $arg) { function dblog_theme() { return array( 'dblog_filters' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), ); } diff --git a/modules/field/field.api.php b/modules/field/field.api.php index db37d8758..fcf78b36d 100644 --- a/modules/field/field.api.php +++ b/modules/field/field.api.php @@ -676,7 +676,7 @@ function hook_field_widget_error($element, $error) { * * @code * 'field_formatter_FORMATTER_NAME' => array( - * 'arguments' => array('element' => NULL), + * 'render_element' => 'element', * ) * @code * diff --git a/modules/field/field.module b/modules/field/field.module index 1b9e23b4c..d2a51643b 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -161,17 +161,17 @@ function field_theme() { $items = array( 'field' => array( 'template' => 'field', - 'arguments' => array('element' => NULL), + 'render element' => 'element', 'path' => $path, ), 'field_multiple_value_form' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); $field_formatters = field_info_formatter_types(NULL); foreach ($field_formatters as $key => $field_formatter) { $items['field_formatter_' . $key] = array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ); if (isset($field_formatter['theme'])) { $items['field_formatter_' . $key] += $field_formatter['theme']; diff --git a/modules/field/modules/number/number.module b/modules/field/modules/number/number.module index 54c44fec6..1dcd08e22 100644 --- a/modules/field/modules/number/number.module +++ b/modules/field/modules/number/number.module @@ -11,7 +11,7 @@ */ function number_theme() { return array( - 'number' => array('arguments' => array('element' => NULL)), + 'number' => array('render element' => 'element'), ); } diff --git a/modules/field/modules/options/options.module b/modules/field/modules/options/options.module index 9fc8b9223..261b00c43 100644 --- a/modules/field/modules/options/options.module +++ b/modules/field/modules/options/options.module @@ -12,16 +12,16 @@ function options_theme() { return array( 'options_select' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'options_buttons' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'options_onoff' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'options_none' => array( - 'arguments' => array('instance' => NULL), + 'variables' => array('instance' => NULL), ), ); } diff --git a/modules/field/modules/text/text.module b/modules/field/modules/text/text.module index cf53d27da..1ee103f8b 100644 --- a/modules/field/modules/text/text.module +++ b/modules/field/modules/text/text.module @@ -12,10 +12,10 @@ function text_theme() { return array( 'text_textarea' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'text_textfield' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); } diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module index 99dd8c057..2710acf9b 100644 --- a/modules/field_ui/field_ui.module +++ b/modules/field_ui/field_ui.module @@ -154,12 +154,12 @@ function field_ui_menu_label($instance) { function field_ui_theme() { return array( 'field_ui_field_overview_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'field_ui.admin.inc', 'template' => 'field_ui-field-overview-form', ), 'field_ui_display_overview_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'field_ui.admin.inc', 'template' => 'field_ui-display-overview-form', ), diff --git a/modules/file/file.module b/modules/file/file.module index 243ae87a3..45e23d508 100644 --- a/modules/file/file.module +++ b/modules/file/file.module @@ -65,24 +65,24 @@ function file_theme() { return array( // file.module. 'file_link' => array( - 'arguments' => array('file' => NULL), + 'variables' => array('file' => NULL), ), 'file_icon' => array( - 'arguments' => array('file' => NULL), + 'variables' => array('file' => NULL), ), 'file_managed_file' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), // file.field.inc. 'file_widget' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'file_widget_multiple' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'file_upload_help' => array( - 'arguments' => array('description' => NULL, 'upload_validators' => NULL), + 'variables' => array('description' => NULL, 'upload_validators' => NULL), ), ); } diff --git a/modules/filter/filter.module b/modules/filter/filter.module index f0852510e..fa3869192 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -38,22 +38,22 @@ function filter_help($path, $arg) { function filter_theme() { return array( 'filter_admin_overview' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'filter.admin.inc', ), 'filter_admin_order' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'filter.admin.inc', ), 'filter_tips' => array( - 'arguments' => array('tips' => NULL, 'long' => FALSE), + 'variables' => array('tips' => NULL, 'long' => FALSE), 'file' => 'filter.pages.inc', ), 'filter_tips_more_info' => array( - 'arguments' => array(), + 'variables' => array(), ), 'filter_guidelines' => array( - 'arguments' => array('format' => NULL), + 'variables' => array('format' => NULL), ), ); } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 955789d77..72653dfe5 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -39,26 +39,26 @@ function forum_theme() { return array( 'forums' => array( 'template' => 'forums', - 'arguments' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + 'variables' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), ), 'forum_list' => array( 'template' => 'forum-list', - 'arguments' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), + 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), ), 'forum_topic_list' => array( 'template' => 'forum-topic-list', - 'arguments' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + 'variables' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), ), 'forum_icon' => array( 'template' => 'forum-icon', - 'arguments' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), ), 'forum_submitted' => array( 'template' => 'forum-submitted', - 'arguments' => array('topic' => NULL), + 'variables' => array('topic' => NULL), ), 'forum_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'forum.admin.inc', ), ); diff --git a/modules/image/image.module b/modules/image/image.module index a35a9e4dd..8c10f79e3 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -170,7 +170,7 @@ function image_theme() { return array( // Theme functions in image.module. 'image_style' => array( - 'arguments' => array( + 'variables' => array( 'style_name' => NULL, 'path' => NULL, 'alt' => '', @@ -182,42 +182,42 @@ function image_theme() { // Theme functions in image.admin.inc. 'image_style_list' => array( - 'arguments' => array('styles' => NULL), + 'variables' => array('styles' => NULL), ), 'image_style_effects' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'image_style_preview' => array( - 'arguments' => array('style' => NULL), + 'variables' => array('style' => NULL), ), 'image_anchor' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'image_resize_summary' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), 'image_scale_summary' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), 'image_crop_summary' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), 'image_rotate_summary' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), // Theme functions in image.field.inc. 'image_widget' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'field_formatter_image' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'field_formatter_image_link_content' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'field_formatter_image_link_file' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); } diff --git a/modules/locale/locale.module b/modules/locale/locale.module index a5d7cf142..45cd6523a 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -449,16 +449,16 @@ function locale_field_node_form_submit($form, &$form_state) { function locale_theme() { return array( 'locale_languages_overview_form' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'locale_languages_configure_form' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'locale_translation_filters' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'locale_date_format_form' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), ); } diff --git a/modules/menu/menu.module b/modules/menu/menu.module index 824954d61..aa9ae8bf4 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -159,11 +159,11 @@ function menu_theme() { return array( 'menu_overview_form' => array( 'file' => 'menu.admin.inc', - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'menu_admin_overview' => array( 'file' => 'menu.admin.inc', - 'arguments' => array('title' => NULL, 'name' => NULL, 'description' => NULL), + 'variables' => array('title' => NULL, 'name' => NULL, 'description' => NULL), ), ); } diff --git a/modules/node/node.module b/modules/node/node.module index 15dc90962..3e7a5ad01 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -122,40 +122,40 @@ function node_help($path, $arg) { function node_theme() { return array( 'node' => array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', 'template' => 'node', ), 'node_list' => array( - 'arguments' => array('items' => NULL, 'title' => NULL), + 'variables' => array('items' => NULL, 'title' => NULL), ), 'node_search_admin' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'node_filter_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'node.admin.inc', ), 'node_filters' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'node.admin.inc', ), 'node_add_list' => array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), 'file' => 'node.pages.inc', ), 'node_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'node.pages.inc', ), 'node_preview' => array( - 'arguments' => array('node' => NULL), + 'variables' => array('node' => NULL), 'file' => 'node.pages.inc', ), 'node_log_message' => array( - 'arguments' => array('log' => NULL), + 'variables' => array('log' => NULL), ), 'node_admin_overview' => array( - 'arguments' => array('name' => NULL, 'type' => NULL), + 'variables' => array('name' => NULL, 'type' => NULL), ), ); } diff --git a/modules/poll/poll.module b/modules/poll/poll.module index d1f212435..9242bcf9f 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -34,18 +34,18 @@ function poll_theme() { return array( 'poll_vote' => array( 'template' => 'poll-vote', - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'poll_choices' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'poll_results' => array( 'template' => 'poll-results', - 'arguments' => array('raw_title' => NULL, 'results' => NULL, 'votes' => NULL, 'raw_links' => NULL, 'block' => NULL, 'nid' => NULL, 'vote' => NULL), + 'variables' => array('raw_title' => NULL, 'results' => NULL, 'votes' => NULL, 'raw_links' => NULL, 'block' => NULL, 'nid' => NULL, 'vote' => NULL), ), 'poll_bar' => array( 'template' => 'poll-bar', - 'arguments' => array('title' => NULL, 'votes' => NULL, 'total_votes' => NULL, 'vote' => NULL, 'block' => NULL), + 'variables' => array('title' => NULL, 'votes' => NULL, 'total_votes' => NULL, 'vote' => NULL, 'block' => NULL), ), ); } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 6bef40933..be5c8392e 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -54,19 +54,19 @@ function profile_help($path, $arg) { function profile_theme() { return array( 'profile_block' => array( - 'arguments' => array('account' => NULL, 'fields' => array()), + 'variables' => array('account' => NULL, 'fields' => array()), 'template' => 'profile-block', ), 'profile_listing' => array( - 'arguments' => array('account' => NULL, 'fields' => array()), + 'variables' => array('account' => NULL, 'fields' => array()), 'template' => 'profile-listing', ), 'profile_wrapper' => array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), 'template' => 'profile-wrapper', ), 'profile_admin_overview' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'profile.admin.inc', ) ); diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index 5d726727e..d4b90b3c2 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -321,10 +321,10 @@ function rdf_entity_load($entities, $type) { function rdf_theme() { return array( 'rdf_template_variable_wrapper' => array( - 'arguments' => array('content' => NULL, 'attributes' => array(), 'context' => array(), 'inline' => TRUE), + 'variables' => array('content' => NULL, 'attributes' => array(), 'context' => array(), 'inline' => TRUE), ), 'rdf_metadata' => array( - 'arguments' => array('metadata' => array()), + 'variables' => array('metadata' => array()), ), ); } diff --git a/modules/search/search.module b/modules/search/search.module index 49becce1e..63542657a 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -118,21 +118,21 @@ function search_help($path, $arg) { function search_theme() { return array( 'search_block_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'template' => 'search-block-form', ), 'search_result' => array( - 'arguments' => array('result' => NULL, 'type' => NULL), + 'variables' => array('result' => NULL, 'type' => NULL), 'file' => 'search.pages.inc', 'template' => 'search-result', ), 'search_results' => array( - 'arguments' => array('results' => NULL, 'type' => NULL), + 'variables' => array('results' => NULL, 'type' => NULL), 'file' => 'search.pages.inc', 'template' => 'search-results', ), 'search_results_listing' => array( - 'arguments' => array('title' => NULL, 'content' => NULL), + 'variables' => array('title' => NULL, 'content' => NULL), ), ); } diff --git a/modules/shortcut/shortcut.module b/modules/shortcut/shortcut.module index e69cae7be..d3c9e2473 100644 --- a/modules/shortcut/shortcut.module +++ b/modules/shortcut/shortcut.module @@ -109,11 +109,11 @@ function shortcut_menu() { function shortcut_theme() { return array( 'shortcut_set_switch' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'shortcut.admin.inc', ), 'shortcut_set_customize' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'shortcut.admin.inc', ), ); diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module index 91a1cd61a..1757deb34 100644 --- a/modules/simpletest/simpletest.module +++ b/modules/simpletest/simpletest.module @@ -75,11 +75,11 @@ function simpletest_permission() { function simpletest_theme() { return array( 'simpletest_test_table' => array( - 'arguments' => array('table' => NULL), + 'render element' => 'table', 'file' => 'simpletest.pages.inc', ), 'simpletest_result_summary' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'simpletest.pages.inc', ), ); diff --git a/modules/simpletest/tests/common_test.module b/modules/simpletest/tests/common_test.module index 8b6779463..cc8c22772 100644 --- a/modules/simpletest/tests/common_test.module +++ b/modules/simpletest/tests/common_test.module @@ -106,7 +106,7 @@ function common_test_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) { function common_test_theme() { return array( 'common_test_foo' => array( - 'arguments' => array('foo' => 'foo', 'bar' => 'bar'), + 'variables' => array('foo' => 'foo', 'bar' => 'bar'), ), ); } diff --git a/modules/simpletest/tests/field_test.module b/modules/simpletest/tests/field_test.module index 86a2751ea..35985da79 100644 --- a/modules/simpletest/tests/field_test.module +++ b/modules/simpletest/tests/field_test.module @@ -580,13 +580,13 @@ function field_test_field_formatter_info() { function field_test_theme() { return array( 'field_formatter_field_test_default' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'field_formatter_field_test_multiple' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), 'field_formatter_field_test_needs_additional_data' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); } diff --git a/modules/syslog/syslog.module b/modules/syslog/syslog.module index 11b991da1..e4aa298f9 100644 --- a/modules/syslog/syslog.module +++ b/modules/syslog/syslog.module @@ -83,7 +83,7 @@ function syslog_watchdog(array $log_entry) { function syslog_theme() { return array( 'syslog_format' => array( - 'arguments' => array('entry' => NULL), + 'variables' => array('entry' => NULL), ), ); } diff --git a/modules/system/system.api.php b/modules/system/system.api.php index a1695071a..b379649a6 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -849,12 +849,19 @@ function hook_permission() { * to each sub-array is the internal name of the hook, and the array contains * info about the hook. Each array may contain the following items: * - * - arguments: (required) An array of arguments that this theme hook uses. This - * value allows the theme layer to properly utilize templates. The - * array keys represent the name of the variable, and the value will be - * used as the default value if not specified to the theme() function. - * These arguments must be in the same order that they will be given to - * the theme() function. + * - variables: (required if "render element" not present) An array of + * variables that this theme hook uses. This value allows the theme layer to + * properly utilize templates. Each array key represents the name of the + * variable and the value will be used as the default value if it is not given + * when theme() is called. Template implementations receive these arguments as + * variables in the template file. Function implementations are passed this + * array data in the $variables parameter. + * - render element: (required if "variables" not present) A string that is the + * name of the sole renderable element to pass to the theme function. The + * string represents the name of the "variable" that will hold the renderable + * array inside any optional preprocess or process functions. Cannot be used + * with the "variables" item; only one or the other, not both, can be present + * in a hook's info array. * - file: The file the implementation resides in. This file will be included * prior to the theme being rendered, to make sure that the function or * preprocess function (as needed) is actually loaded; this makes it possible @@ -929,16 +936,24 @@ function hook_permission() { function hook_theme($existing, $type, $theme, $path) { return array( 'forum_display' => array( - 'arguments' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + 'variables' => array('forums' => NULL, 'topics' => NULL, 'parents' => NULL, 'tid' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), ), 'forum_list' => array( - 'arguments' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), + 'variables' => array('forums' => NULL, 'parents' => NULL, 'tid' => NULL), ), 'forum_topic_list' => array( - 'arguments' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), + 'variables' => array('tid' => NULL, 'topics' => NULL, 'sortby' => NULL, 'forum_per_page' => NULL), ), 'forum_icon' => array( - 'arguments' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + 'variables' => array('new_posts' => NULL, 'num_posts' => 0, 'comment_mode' => 0, 'sticky' => 0), + ), + 'status_report' => array( + 'render element' => 'requirements', + 'file' => 'system.admin.inc', + ), + 'system_date_time_settings' => array( + 'render element' => 'form', + 'file' => 'system.admin.inc', ), ); } @@ -960,7 +975,7 @@ function hook_theme($existing, $type, $theme, $path) { * For example: * @code * $theme_registry['user_profile'] = array( - * 'arguments' => array( + * 'variables' => array( * 'account' => NULL, * ), * 'template' => 'modules/user/user-profile', diff --git a/modules/system/system.module b/modules/system/system.module index f67500a3d..bc582e6ff 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -156,63 +156,65 @@ function system_help($path, $arg) { function system_theme() { return array_merge(drupal_common_theme(), array( 'system_themes_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), 'system_settings_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), 'confirm_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'system_modules_fieldset' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), 'system_modules_incompatible' => array( - 'arguments' => array('message' => NULL), + 'variables' => array('message' => NULL), 'file' => 'system.admin.inc', ), 'system_modules_uninstall' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), 'status_report' => array( - 'arguments' => array('requirements' => NULL), + 'render element' => 'requirements', 'file' => 'system.admin.inc', ), 'admin_page' => array( - 'arguments' => array('blocks' => NULL), + 'variables' => array('blocks' => NULL), 'file' => 'system.admin.inc', ), 'admin_block' => array( - 'arguments' => array('block' => NULL), + 'variables' => array('block' => NULL), 'file' => 'system.admin.inc', ), 'admin_block_content' => array( - 'arguments' => array('content' => NULL), + 'variables' => array('content' => NULL), 'file' => 'system.admin.inc', ), 'system_admin_by_module' => array( - 'arguments' => array('menu_items' => NULL), + 'variables' => array('menu_items' => NULL), 'file' => 'system.admin.inc', ), 'system_powered_by' => array( - 'arguments' => NULL, + 'variables' => array(), ), 'meta_generator_html' => array( - 'arguments' => array('version' => NULL), + 'variables' => array('version' => NULL), ), 'meta_generator_header' => array( - 'arguments' => array('version' => NULL), + 'variables' => array('version' => NULL), + ), + 'system_compact_link' => array( + 'variables' => array(), ), - 'system_compact_link' => array(), 'system_run_cron_image' => array( - 'arguments' => array('image_path' => NULL), + 'variables' => array('image_path' => NULL), ), 'system_date_time_settings' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'system.admin.inc', ), )); @@ -3464,8 +3466,13 @@ function system_preprocess(&$variables, $hook) { $variables['contextual_links'] = array(); // Determine the primary theme function argument. - $keys = array_keys($hooks[$hook]['arguments']); - $key = $keys[0]; + if (isset($hooks[$hook]['variables'])) { + $keys = array_keys($hooks[$hook]['variables']); + $key = $keys[0]; + } + else { + $key = $hooks[$hook]['render element']; + } if (isset($variables[$key])) { $element = $variables[$key]; } diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index cf1ef1bc1..b04336fa0 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -152,13 +152,13 @@ function taxonomy_field_build_modes($obj_type) { function taxonomy_theme() { return array( 'taxonomy_overview_vocabularies' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'taxonomy_overview_terms' => array( - 'arguments' => array('form' => array()), + 'render element' => 'form', ), 'taxonomy_autocomplete' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', ), ); } diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module index 5d83914c4..3bf85b533 100644 --- a/modules/toolbar/toolbar.module +++ b/modules/toolbar/toolbar.module @@ -23,7 +23,7 @@ function toolbar_permission() { */ function toolbar_theme($existing, $type, $theme, $path) { $items['toolbar'] = array( - 'arguments' => array('toolbar' => array()), + 'render element' => 'toolbar', 'template' => 'toolbar', 'path' => drupal_get_path('module', 'toolbar'), ); diff --git a/modules/trigger/trigger.module b/modules/trigger/trigger.module index 9742509bb..d15ff0494 100644 --- a/modules/trigger/trigger.module +++ b/modules/trigger/trigger.module @@ -183,7 +183,7 @@ function trigger_get_assigned_actions($hook) { function trigger_theme() { return array( 'trigger_display' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', 'file' => 'trigger.admin.inc', ), ); diff --git a/modules/update/update.module b/modules/update/update.module index 3d2c7ee32..c25ece824 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -245,20 +245,20 @@ function update_manager_access() { function update_theme() { return array( 'update_manager_update_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'update.manager.inc', ), 'update_last_check' => array( - 'arguments' => array('last' => NULL), + 'variables' => array('last' => NULL), ), 'update_report' => array( - 'arguments' => array('data' => NULL), + 'variables' => array('data' => NULL), ), 'update_version' => array( - 'arguments' => array('version' => NULL, 'tag' => NULL, 'class' => array()), + 'variables' => array('version' => NULL, 'tag' => NULL, 'class' => array()), ), 'update_status_label' => array( - 'arguments' => array('status' => NULL), + 'variables' => array('status' => NULL), ), ); } diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc index f143bccbb..1f0081ec6 100644 --- a/modules/update/update.report.inc +++ b/modules/update/update.report.inc @@ -199,7 +199,7 @@ function theme_update_report($variables) { break; default: - $base_themes[] = theme('placeholder', $base_theme); + $base_themes[] = theme('placeholder', array('text' => $base_theme)); } } $row .= t('Depends on: !basethemes', array('!basethemes' => implode(', ', $base_themes))); diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 5a0c0c1c5..679cc6ba6 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -28,13 +28,13 @@ function upload_help($path, $arg) { function upload_theme() { return array( 'upload_attachments' => array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', ), 'upload_form_current' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), 'upload_form_new' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', ), ); } diff --git a/modules/user/user.module b/modules/user/user.module index 5e4f60ade..d0e1027fe 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -36,45 +36,45 @@ function user_module_invoke($type, &$edit, $account, $category = NULL) { function user_theme() { return array( 'user_picture' => array( - 'arguments' => array('account' => NULL), + 'variables' => array('account' => NULL), 'template' => 'user-picture', ), 'user_profile' => array( - 'arguments' => array('elements' => NULL), + 'render element' => 'elements', 'template' => 'user-profile', 'file' => 'user.pages.inc', ), 'user_profile_category' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', 'template' => 'user-profile-category', 'file' => 'user.pages.inc', ), 'user_profile_item' => array( - 'arguments' => array('element' => NULL), + 'render element' => 'element', 'template' => 'user-profile-item', 'file' => 'user.pages.inc', ), 'user_list' => array( - 'arguments' => array('users' => NULL, 'title' => NULL), + 'variables' => array('users' => NULL, 'title' => NULL), ), 'user_admin_permissions' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'user.admin.inc', ), 'user_admin_new_role' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'user.admin.inc', ), 'user_filter_form' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'user.admin.inc', ), 'user_filters' => array( - 'arguments' => array('form' => NULL), + 'render element' => 'form', 'file' => 'user.admin.inc', ), 'user_signature' => array( - 'arguments' => array('signature' => NULL), + 'variables' => array('signature' => NULL), ), ); } |