diff --git includes/menu.inc includes/menu.inc index 80d7631..5b0119e 100644 --- includes/menu.inc +++ includes/menu.inc @@ -1271,8 +1271,8 @@ function theme_menu_item_link($link) { * * @ingroup themeable */ -function theme_menu_tree($tree) { - return ''; +function theme_menu_tree($variables) { + return ''; } /** @@ -1299,7 +1299,10 @@ function theme_menu_tree($tree) { * Extra classes that should be added to the class of the list item. * Defaults to NULL. */ -function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) { +function theme_menu_item($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf')); if (!empty($extra_class)) { $class .= ' ' . $extra_class; @@ -1315,7 +1318,10 @@ function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FA * * @ingroup themeable */ -function theme_menu_local_task($link, $active = FALSE) { +function theme_menu_local_task($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return '
  • ' . $link . "
  • \n"; } @@ -1324,8 +1330,8 @@ function theme_menu_local_task($link, $active = FALSE) { * * @ingroup themeable */ -function theme_menu_local_action($link) { - return '
  • ' . $link . "
  • \n"; +function theme_menu_local_action($variables) { + return '
  • ' . $variables['link'] . "
  • \n"; } /** diff --git includes/theme.inc includes/theme.inc index d8f6a2c..cc85753 100644 --- includes/theme.inc +++ includes/theme.inc @@ -780,7 +780,19 @@ function theme() { } $args = $new_args; } - + // Set all default arguments. + if (!empty($info['arguments'])) { + $count = 0; + foreach ($info['arguments'] as $name => $default) { + $variables[$name] = isset($args[$count]) ? $args[$count] : $default; + $count++; + } + } + // Pass through a single array parameter. + if (count($args) == 1 && is_array($args[0])) { + $variables = $args[0]; + } + $callback_suggestions = array(); // Invoke the variable processors, if any. // We minimize the overhead for theming hooks that have no processors and // are called many times per page request by caching '_no_processors'. If @@ -791,13 +803,6 @@ function theme() { $variables = array( 'theme_functions' => array(), ); - if (!empty($info['arguments'])) { - $count = 0; - foreach ($info['arguments'] as $name => $default) { - $variables[$name] = isset($args[$count]) ? $args[$count] : $default; - $count++; - } - } // We don't want a poorly behaved process function changing $hook. $hook_clone = $hook; foreach (array('preprocess functions', 'process functions') as $phase) { @@ -809,40 +814,33 @@ function theme() { } } } - if (!empty($info['arguments'])) { - $count = 0; - foreach ($info['arguments'] as $name => $default) { - $args[$count] = $variables[$name]; - $count++; - } - } - // Get suggestions for alternate functions out of the variables that // were set. This lets us dynamically choose a function from a list. // The order is FILO, so this array is ordered from least appropriate // functions to most appropriate last. - $suggestions = array(); if (isset($variables['theme_functions'])) { - $suggestions = $variables['theme_functions']; + $callback_suggestions = $variables['theme_functions']; } if (isset($variables['theme_function'])) { - $suggestions[] = $variables['theme_function']; - } - foreach (array_reverse($suggestions) as $suggestion) { - if (function_exists($suggestion)) { - $info['function'] = $suggestion; - break; - } + $callback_suggestions[] = $variables['theme_function']; } + $callback_suggestions = array_reverse($callback_suggestions); } else { $hooks[$hook]['_no_processors'] = TRUE; } } - + $callback_suggestions[] = $info['function']; + $callback = FALSE; + foreach ($callback_suggestions as $suggestion) { + if (function_exists($suggestion)) { + $callback = $suggestion; + break; + } + } // Call the function. - if (function_exists($info['function'])) { - $output = call_user_func_array($info['function'], $args); + if ($callback) { + $output = $callback($variables); } } else { @@ -1329,8 +1327,9 @@ function theme_render_template($template_file, $variables) { * @return * The formatted text (html). */ -function theme_placeholder($text) { - return '' . check_plain($text) . ''; +function theme_placeholder($variables) { + // @todo - sanitize text in a preprocess function. + return '' . check_plain($$variables['text']) . ''; } /** @@ -1346,7 +1345,8 @@ function theme_placeholder($text) { * @return * A string containing the messages. */ -function theme_status_messages($display = NULL) { +function theme_status_messages($variables) { + $display = isset($variables['display']) ? $variables['display'] : NULL; $output = ''; $status_heading = array( 'status' => t('Status message'), @@ -1403,7 +1403,10 @@ function theme_status_messages($display = NULL) { * @return * A string containing an unordered list of links. */ -function theme_links($links, $attributes = array('class' => array('links')), $heading = array()) { +function theme_links($variables) { + extract($variables, EXTR_SKIP); + // Extracts $links, $attributes, $heading. + // @todo remove extract() if possible and check hook_theme defaults. global $language; $output = ''; @@ -1492,7 +1495,10 @@ function theme_links($links, $attributes = array('class' => array('links')), $he * @return * A string containing the image tag. */ -function theme_image($path, $alt = '', $title = '', $attributes = array(), $getsize = TRUE) { +function theme_image($variables) { + extract($variables, EXTR_SKIP); + // $path, $alt = '', $title = '', $attributes = array(), $getsize = TRUE + // @todo remove extract() if possible and check hook_theme defaults. if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) { $attributes = drupal_attributes($attributes); $url = file_create_url($path); @@ -1603,7 +1609,10 @@ function theme_submenu($links) { * @return * An HTML string representing the table. */ -function theme_table($header, $rows, $attributes = array(), $caption = NULL, $colgroups = array(), $sticky = TRUE) { +function theme_table($variables) { + extract($variables, EXTR_SKIP); + // $header, $rows, $attributes = array(), $caption = NULL, $colgroups = array(), $sticky = TRUE + // @todo remove extract() if possible and check hook_theme defaults. // Add sticky headers, if applicable. if (count($header) && $sticky) { @@ -1732,8 +1741,8 @@ function theme_table_select_header_cell() { * @return * A themed sort icon. */ -function theme_tablesort_indicator($style) { - if ($style == "asc") { +function theme_tablesort_indicator($variables) { + if ($variables['style'] == "asc") { return theme('image', 'misc/arrow-asc.png', t('sort icon'), t('sort ascending')); } else { @@ -1751,7 +1760,8 @@ function theme_tablesort_indicator($style) { * @return * A string containing the marker. */ -function theme_mark($type = MARK_NEW) { +function theme_mark($variables) { + $type = $variables['type']; global $user; if ($user->uid) { if ($type == MARK_NEW) { @@ -1781,7 +1791,10 @@ function theme_mark($type = MARK_NEW) { * @return * A string containing the list output. */ -function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attributes = array()) { +function theme_item_list($variables) { + extract($variables, EXTR_SKIP); + // $items = array(), $title = NULL, $type = 'ul', $attributes = array() + // @todo remove extract() if possible and check hook_theme defaults. $output = '
    '; if (isset($title)) { $output .= '

    ' . $title . '

    '; @@ -1829,8 +1842,8 @@ function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attribu /** * Returns code that emits the 'more help'-link. */ -function theme_more_help_link($url) { - return ''; +function theme_more_help_link($variables) { + return ''; } /** @@ -1841,10 +1854,10 @@ function theme_more_help_link($url) { * @param $title * A descriptive title of the feed. */ -function theme_feed_icon($url, $title) { - $text = t('Subscribe to @feed-title', array('@feed-title' => $title)); +function theme_feed_icon($variables) { + $text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title'])); if ($image = theme('image', 'misc/feed.png', $text)) { - return '' . $image . ''; + return '' . $image . ''; } } @@ -1856,8 +1869,8 @@ function theme_feed_icon($url, $title) { * @param $title * A descriptive verb for the link, like 'Read more' */ -function theme_more_link($url, $title) { - return ''; +function theme_more_link($variables) { + return ''; } /** @@ -1947,7 +1960,8 @@ function template_process_username(&$variables) { * @see template_preprocess_username() * @see template_process_username() */ -function theme_username($object) { +function theme_username($variables) { + $object = $variables['object']; if (isset($object->link_path)) { // We have a link path, so we should generate a link using l(). // Additional classes may be added as array elements like @@ -1973,11 +1987,11 @@ function theme_username($object) { * @return * A themed HTML string representing the progress bar. */ -function theme_progress_bar($percent, $message) { +function theme_progress_bar($variables) { $output = '
    '; - $output .= '
    '; - $output .= '
    ' . $percent . '%
    '; - $output .= '
    ' . $message . '
    '; + $output .= '
    '; + $output .= '
    ' . $variables['percent'] . '%
    '; + $output .= '
    ' . $variables['message'] . '
    '; $output .= '
    '; return $output; @@ -1991,9 +2005,9 @@ function theme_progress_bar($percent, $message) { * @return * A string containing indentations. */ -function theme_indentation($size = 1) { +function theme_indentation($variables) { $output = ''; - for ($n = 0; $n < $size; $n++) { + for ($n = 0; $n < $variables['size']; $n++) { $output .= '
     
    '; } return $output; @@ -2003,7 +2017,10 @@ function theme_indentation($size = 1) { * @} End of "defgroup themeable". */ -function _theme_table_cell($cell, $header = FALSE) { +function _theme_table_cell($variables) { + extract($variables, EXTR_SKIP); + // $cell, $header = FALSE + // @todo remove extract() if possible and check hook_theme defaults. $attributes = ''; if (is_array($cell)) { diff --git modules/aggregator/aggregator.module modules/aggregator/aggregator.module index d857cd4..828736d 100644 --- modules/aggregator/aggregator.module +++ modules/aggregator/aggregator.module @@ -638,7 +638,10 @@ function aggregator_category_load($cid) { * The item HTML. * @ingroup themeable */ -function theme_aggregator_block_item($item, $feed = 0) { +function theme_aggregator_block_item($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // Display the external link to the item. return '' . check_plain($item->title) . "\n"; diff --git modules/aggregator/aggregator.pages.inc modules/aggregator/aggregator.pages.inc index 6a6f870..98d5122 100644 --- modules/aggregator/aggregator.pages.inc +++ modules/aggregator/aggregator.pages.inc @@ -235,7 +235,10 @@ function aggregator_categorize_items_submit($form, &$form_state) { * The output HTML. * @ingroup themeable */ -function theme_aggregator_categorize_items($form) { +function theme_aggregator_categorize_items($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = drupal_render($form['feed_source']); $rows = array(); if (!empty($form['items'])) { @@ -368,7 +371,10 @@ function aggregator_page_rss() { * A common category, if any, for all the feeds. * @ingroup themeable */ -function theme_aggregator_page_rss($feeds, $category = NULL) { +function theme_aggregator_page_rss($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_set_header('Content-Type', 'application/rss+xml; charset=utf-8'); $items = ''; @@ -428,7 +434,10 @@ function aggregator_page_opml($cid = NULL) { * An array of the feeds to theme. * @ingroup themeable */ -function theme_aggregator_page_opml($feeds) { +function theme_aggregator_page_opml($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_set_header('Content-Type', 'text/xml; charset=utf-8'); $output = "\n"; diff --git modules/book/book.admin.inc modules/book/book.admin.inc index c324379..e397426 100644 --- modules/book/book.admin.inc +++ modules/book/book.admin.inc @@ -222,7 +222,10 @@ function _book_admin_table_tree($tree, &$form) { * @ingroup themeable * @see book_admin_table() */ -function theme_book_admin_table($form) { +function theme_book_admin_table($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_tabledrag('book-outline', 'match', 'parent', 'book-plid', 'book-plid', 'book-mlid', TRUE, MENU_MAX_DEPTH - 2); drupal_add_tabledrag('book-outline', 'order', 'sibling', 'book-weight'); diff --git modules/book/book.module modules/book/book.module index 7ac3a3b..956bfe7 100644 --- modules/book/book.module +++ modules/book/book.module @@ -303,7 +303,10 @@ function book_block_save($delta = '', $edit = array()) { * * @ingroup themeable */ -function theme_book_title_link($link) { +function theme_book_title_link($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $link['options']['attributes']['class'] = array('book-title'); return l($link['title'], $link['href'], $link['options']); diff --git modules/color/color.module modules/color/color.module index 5620e42..9de8475 100644 --- modules/color/color.module +++ modules/color/color.module @@ -199,7 +199,10 @@ function color_scheme_form(&$form_state, $theme) { * * @ingroup themeable */ -function theme_color_scheme_form($form) { +function theme_color_scheme_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $theme = $form['theme']['#value']; $info = $form['info']['#value']; $path = drupal_get_path('theme', $theme) . '/'; diff --git modules/comment/comment.module modules/comment/comment.module index 43279b9..7a8528b 100644 --- modules/comment/comment.module +++ modules/comment/comment.module @@ -2137,7 +2137,10 @@ function template_preprocess_comment(&$variables) { * The comment node. * @ingroup themeable */ -function theme_comment_post_forbidden($node) { +function theme_comment_post_forbidden($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + global $user; if (!$user->uid) { diff --git modules/dblog/dblog.module modules/dblog/dblog.module index 3d4449f..ee1809d 100644 --- modules/dblog/dblog.module +++ modules/dblog/dblog.module @@ -173,7 +173,10 @@ function dblog_form_system_logging_settings_alter(&$form, $form_state) { * * @ingroup themeable */ -function theme_dblog_filters($form) { +function theme_dblog_filters($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; foreach (element_children($form['status']) as $key) { $output .= drupal_render($form['status'][$key]); diff --git modules/field/field.api.php modules/field/field.api.php index 4ec2cc7..69726a1 100644 --- modules/field/field.api.php +++ modules/field/field.api.php @@ -787,7 +787,10 @@ function hook_field_formatter_info_alter(&$info) { * - #formatter: The name of the formatter being used. * - #settings: The array of formatter settings. */ -function theme_field_formatter_FORMATTER_SINGLE($element) { +function theme_field_formatter_FORMATTER_SINGLE($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // This relies on a 'safe' element being prepared in hook_field_sanitize(). return $element['#item']['safe']; } @@ -809,7 +812,10 @@ function theme_field_formatter_FORMATTER_SINGLE($element) { * - #settings: The array of formatter settings. * - numeric indexes: the field values being displayed. */ -function theme_field_formatter_FORMATTER_MULTIPLE($element) { +function theme_field_formatter_FORMATTER_MULTIPLE($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $items = array(); foreach (element_children($element) as $key) { $items[$key] = $key .':'. $element[$key]['#item']['value']; diff --git modules/field/field.form.inc modules/field/field.form.inc index 6f70054..fb44ccf 100644 --- modules/field/field.form.inc +++ modules/field/field.form.inc @@ -221,7 +221,10 @@ function field_multiple_value_form($field, $instance, $langcode, $items, &$form, * Combine multiple values into a table with drag-n-drop reordering. * TODO : convert to a template. */ -function theme_field_multiple_value_form($element) { +function theme_field_multiple_value_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; if ($element['#multiple'] > 1 || $element['#multiple'] == FIELD_CARDINALITY_UNLIMITED) { diff --git modules/field/modules/list/list.module modules/field/modules/list/list.module index ec7edde..10a78de 100644 --- modules/field/modules/list/list.module +++ modules/field/modules/list/list.module @@ -257,7 +257,10 @@ function list_field_formatter_info() { /** * Theme function for 'default' list field formatter. */ -function theme_field_formatter_list_default($element) { +function theme_field_formatter_list_default($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $field = field_info_field($element['#field_name']); if (($allowed_values = list_allowed_values($field)) && isset($allowed_values[$element['#item']['value']])) { return $allowed_values[$element['#item']['value']]; @@ -269,6 +272,9 @@ function theme_field_formatter_list_default($element) { /** * Theme function for 'key' list field formatter. */ -function theme_field_formatter_list_key($element) { +function theme_field_formatter_list_key($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#item']['safe']; } diff --git modules/field/modules/number/number.module modules/field/modules/number/number.module index fa8f325..71eae22 100644 --- modules/field/modules/number/number.module +++ modules/field/modules/number/number.module @@ -240,14 +240,20 @@ function number_field_formatter_info() { /** * Theme function for 'unformatted' number field formatter. */ -function theme_field_formatter_number_unformatted($element) { +function theme_field_formatter_number_unformatted($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#item']['value']; } /** * Proxy theme function for number field formatters. */ -function theme_field_formatter_number($element) { +function theme_field_formatter_number($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $field = field_info_field($element['#field_name']); $instance = field_info_instance($element['#field_name'], $element['#bundle']); $value = $element['#item']['value']; @@ -497,6 +503,9 @@ function number_decimal_validate($element, &$form_state) { * $element['#field_name'] contains the field name * $element['#delta] is the position of this element in the group */ -function theme_number($element) { +function theme_number($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#children']; } diff --git modules/field/modules/options/options.module modules/field/modules/options/options.module index a971274..728427c 100644 --- modules/field/modules/options/options.module +++ modules/field/modules/options/options.module @@ -385,7 +385,10 @@ function options_options($field, $instance) { * Theme the label for the empty value for options that are not required. * The default theme will display N/A for a radio list and blank for a select. */ -function theme_options_none($instance) { +function theme_options_none($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + switch ($instance['widget']['type']) { case 'options_buttons': case 'node_reference_buttons': @@ -411,14 +414,23 @@ function theme_options_none($instance) { * $element['#field_name'] contains the field name * $element['#delta] is the position of this element in the group */ -function theme_options_select($element) { +function theme_options_select($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#children']; } -function theme_options_onoff($element) { +function theme_options_onoff($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#children']; } -function theme_options_buttons($element) { +function theme_options_buttons($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#children']; } \ No newline at end of file diff --git modules/field/modules/text/text.module modules/field/modules/text/text.module index 8a6b7de..433a4cf 100644 --- modules/field/modules/text/text.module +++ modules/field/modules/text/text.module @@ -296,21 +296,30 @@ function text_field_formatter_info() { /** * Theme function for 'default' text field formatter. */ -function theme_field_formatter_text_default($element) { +function theme_field_formatter_text_default($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#item']['safe']; } /** * Theme function for 'plain' text field formatter. */ -function theme_field_formatter_text_plain($element) { +function theme_field_formatter_text_plain($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return strip_tags($element['#item']['safe']); } /** * Theme function for 'trimmed' text field formatter. */ -function theme_field_formatter_text_trimmed($element) { +function theme_field_formatter_text_trimmed($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $field = field_info_field($element['#field_name']); $instance = field_info_instance($element['#field_name'], $element['#bundle']); return text_summary($element['#item']['safe'], $instance['settings']['text_processing'] ? $element['#item']['format'] : NULL); @@ -322,7 +331,10 @@ function theme_field_formatter_text_trimmed($element) { * element of the field or, if the summary is empty, the trimmed * version of the full element of the field. */ -function theme_field_formatter_text_summary_or_trimmed($element) { +function theme_field_formatter_text_summary_or_trimmed($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $field = field_info_field($element['#field_name']); $instance = field_info_instance($element['#field_name'], $element['#bundle']); @@ -777,10 +789,16 @@ function text_field_widget_formatted_text_value($form, $edit = FALSE) { * $element['#field_name'] contains the field name * $element['#delta] is the position of this element in the group */ -function theme_text_textfield($element) { +function theme_text_textfield($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#children']; } -function theme_text_textarea($element) { +function theme_text_textarea($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $element['#children']; } diff --git modules/file/file.field.inc modules/file/file.field.inc index ca95b06..73a2d5e 100644 --- modules/file/file.field.inc +++ modules/file/file.field.inc @@ -745,7 +745,10 @@ function file_field_widget_process_multiple($element, &$form_state, $form) { /** * Theme an individual file upload widget. */ -function theme_file_widget($element) { +function theme_file_widget($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; // The "form-managed-file" class is required for proper AJAX functionality. $output .= '
    '; @@ -762,7 +765,10 @@ function theme_file_widget($element) { /** * Theme a group of file upload widgets. */ -function theme_file_widget_multiple($element) { +function theme_file_widget_multiple($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $field = field_info_field($element['#field_name']); // Get our list of widgets in order. @@ -854,7 +860,10 @@ function theme_file_widget_multiple($element) { * @return * A string suitable for a file field description. */ -function theme_file_upload_help($description, $upload_validators) { +function theme_file_upload_help($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $descriptions = array(); if (strlen($description)) { @@ -889,21 +898,30 @@ function theme_file_upload_help($description, $upload_validators) { /** * Theme function for 'default' file field formatter. */ -function theme_field_formatter_file_default($element) { +function theme_field_formatter_file_default($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('file_link', (object) $element['#item']); } /** * Theme function for 'url_plain' file field formatter. */ -function theme_field_formatter_file_url_plain($element) { +function theme_field_formatter_file_url_plain($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return empty($element['#item']['uri']) ? '' : file_create_url($element['#item']['uri']); } /** * Theme function for the 'table' formatter. */ -function theme_field_formatter_file_table($element) { +function theme_field_formatter_file_table($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Attachment'), t('Size')); $rows = array(); foreach (element_children($element) as $key) { diff --git modules/file/file.module modules/file/file.module index 7a2e263..acac478 100644 --- modules/file/file.module +++ modules/file/file.module @@ -577,7 +577,10 @@ function file_managed_file_save_upload($element) { /** * Theme a managed file element. */ -function theme_file_managed_file($element) { +function theme_file_managed_file($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // This wrapper is required to apply JS behaviors and CSS styling. $output = ''; $output .= '
    '; @@ -592,7 +595,10 @@ function theme_file_managed_file($element) { * @param $file * A file object to which the link will be created. */ -function theme_file_link($file) { +function theme_file_link($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $url = file_create_url($file->uri); $icon = theme('file_icon', $file); @@ -622,7 +628,10 @@ function theme_file_link($file) { * @param $file * A file object for which to make an icon. */ -function theme_file_icon($file) { +function theme_file_icon($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $mime = check_plain($file->filemime); $icon_url = file_icon_url($file); return ''; diff --git modules/filter/filter.admin.inc modules/filter/filter.admin.inc index fe17f9c..16f1655 100644 --- modules/filter/filter.admin.inc +++ modules/filter/filter.admin.inc @@ -64,7 +64,10 @@ function filter_admin_overview_submit($form, &$form_state) { * * @ingroup themeable */ -function theme_filter_admin_overview($form) { +function theme_filter_admin_overview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $rows = array(); foreach (element_children($form) as $id) { $element = $form[$id]; @@ -359,7 +362,10 @@ function filter_admin_order(&$form_state, $format = NULL) { * * @ingroup themeable */ -function theme_filter_admin_order($form) { +function theme_filter_admin_order($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Name'), t('Weight')); $rows = array(); foreach (element_children($form['names']) as $id) { diff --git modules/filter/filter.module modules/filter/filter.module index dec76c7..57cb92d 100644 --- modules/filter/filter.module +++ modules/filter/filter.module @@ -781,7 +781,10 @@ function theme_filter_tips_more_info() { * * @ingroup themeable */ -function theme_filter_guidelines($format) { +function theme_filter_guidelines($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $name = isset($format->name) ? '' : ''; return '
    ' . $name . theme('filter_tips', _filter_tips($format->format, FALSE)) . '
    '; } diff --git modules/filter/filter.pages.inc modules/filter/filter.pages.inc index 5d76af4..1f1f211 100644 --- modules/filter/filter.pages.inc +++ modules/filter/filter.pages.inc @@ -48,7 +48,10 @@ function filter_tips_long() { * @see _filter_tips() * @ingroup themeable */ -function theme_filter_tips($tips, $long = FALSE) { +function theme_filter_tips($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $multiple = count($tips) > 1; diff --git modules/image/image.admin.inc modules/image/image.admin.inc index 53c8a8b..99bf63b 100644 --- modules/image/image.admin.inc +++ modules/image/image.admin.inc @@ -572,7 +572,10 @@ function image_rotate_form($data) { * @see image_get_styles() * @ingroup themeable */ -function theme_image_style_list($styles) { +function theme_image_style_list($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Style name'), array('data' => t('Operations'), 'colspan' => 3)); $rows = array(); foreach ($styles as $style) { @@ -605,7 +608,10 @@ function theme_image_style_list($styles) { * An associative array containing the structure of the effects group. * @ingroup themeable */ -function theme_image_style_effects($form) { +function theme_image_style_effects($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $rows = array(); foreach (element_children($form) as $key) { @@ -658,7 +664,10 @@ function theme_image_style_effects($form) { * The image style array being previewed. * @ingroup themeable */ -function theme_image_style_preview($style) { +function theme_image_style_preview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $sample_image = variable_get('image_style_preview_image', drupal_get_path('module', 'image') . '/sample.png'); $sample_width = 160; $sample_height = 160; @@ -730,7 +739,10 @@ function theme_image_style_preview($style) { * A Form API element containing radio buttons. * @ingroup themeable */ -function theme_image_anchor($element) { +function theme_image_anchor($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $rows = array(); $row = array(); foreach (element_children($element) as $n => $key) { @@ -753,7 +765,10 @@ function theme_image_anchor($element) { * The current configuration for this resize effect. * @ingroup themeable */ -function theme_image_resize_summary($data) { +function theme_image_resize_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + if ($data['width'] && $data['height']) { return check_plain($data['width']) . 'x' . check_plain($data['height']); } @@ -769,7 +784,10 @@ function theme_image_resize_summary($data) { * The current configuration for this scale effect. * @ingroup themeable */ -function theme_image_scale_summary($data) { +function theme_image_scale_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('image_resize_summary', $data) . ' ' . ($data['upscale'] ? '(' . t('upscaling allowed') . ')' : ''); } @@ -780,7 +798,10 @@ function theme_image_scale_summary($data) { * The current configuration for this crop effect. * @ingroup themeable */ -function theme_image_crop_summary($data) { +function theme_image_crop_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('image_resize_summary', $data); } @@ -791,6 +812,9 @@ function theme_image_crop_summary($data) { * The current configuration for this rotate effect. * @ingroup themeable */ -function theme_image_rotate_summary($data) { +function theme_image_rotate_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return ($data['random']) ? t('random between -@degrees° and @degrees°', array('@degrees' => str_replace('-', '', $data['degrees']))) : t('@degrees°', array('@degrees' => $data['degrees'])); } diff --git modules/image/image.module modules/image/image.module index d9d344f..423bf79 100644 --- modules/image/image.module +++ modules/image/image.module @@ -802,7 +802,10 @@ function image_effect_apply($image, $effect) { * A string containing the image tag. * @ingroup themeable */ -function theme_image_style($style_name, $path, $alt = '', $title = '', $attributes = array(), $getsize = TRUE) { +function theme_image_style($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // theme_image() can only honor the $getsize parameter with local file paths. // The derivative image is not created until it has been requested so the file // may not yet exist, in this case we just fallback to the URL. diff --git modules/locale/locale.module modules/locale/locale.module index 1f477ad..fcc7f9a 100644 --- modules/locale/locale.module +++ modules/locale/locale.module @@ -673,7 +673,10 @@ function locale_block_view($delta = '') { * * @ingroup themeable */ -function theme_locale_translation_filters($form) { +function theme_locale_translation_filters($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; foreach (element_children($form['status']) as $key) { $output .= drupal_render($form['status'][$key]); diff --git modules/menu/menu.admin.inc modules/menu/menu.admin.inc index 70fb40d..bc438a1 100644 --- modules/menu/menu.admin.inc +++ modules/menu/menu.admin.inc @@ -27,7 +27,10 @@ function menu_overview_page() { /** * Theme the menu title and description for admin page */ -function theme_menu_admin_overview($title, $name, $description) { +function theme_menu_admin_overview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = check_plain($title); $output .= '
    ' . filter_xss_admin($description) . '
    '; @@ -186,7 +189,10 @@ function menu_overview_form_submit($form, &$form_state) { * * @ingroup themeable */ -function theme_menu_overview_form($form) { +function theme_menu_overview_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_tabledrag('menu-overview', 'match', 'parent', 'menu-plid', 'menu-plid', 'menu-mlid', TRUE, MENU_MAX_DEPTH - 1); drupal_add_tabledrag('menu-overview', 'order', 'sibling', 'menu-weight'); diff --git modules/node/content_types.inc modules/node/content_types.inc index c5bfc69..1ad62cf 100644 --- modules/node/content_types.inc +++ modules/node/content_types.inc @@ -47,7 +47,10 @@ function node_overview_types() { return $build; } -function theme_node_admin_overview($name, $type) { +function theme_node_admin_overview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = check_plain($name); $output .= ' (Machine name: ' . check_plain($type->type) . ')'; $output .= '
    ' . filter_xss_admin($type->description) . '
    '; diff --git modules/node/node.admin.inc modules/node/node.admin.inc index 8835f14..a1a68ee 100644 --- modules/node/node.admin.inc +++ modules/node/node.admin.inc @@ -192,7 +192,10 @@ function node_filter_form() { * * @ingroup themeable */ -function theme_node_filter_form($form) { +function theme_node_filter_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $output .= '
    '; $output .= drupal_render($form['filters']); @@ -206,7 +209,10 @@ function theme_node_filter_form($form) { * * @ingroup themeable */ -function theme_node_filters($form) { +function theme_node_filters($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $output .= '
      '; if (!empty($form['current'])) { @@ -514,7 +520,10 @@ function node_admin_nodes_submit($form, &$form_state) { * * @ingroup themeable */ -function theme_node_admin_nodes($form) { +function theme_node_admin_nodes($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $output .= drupal_render($form['options']); diff --git modules/node/node.module modules/node/node.module index 665f0b1..9c7144c 100644 --- modules/node/node.module +++ modules/node/node.module @@ -282,7 +282,10 @@ function node_title_list($result, $title = NULL) { * * @ingroup themeable */ -function theme_node_list($items, $title = NULL) { +function theme_node_list($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('item_list', $items, $title); } @@ -1207,7 +1210,10 @@ function template_preprocess_node(&$variables) { * * @ingroup themeable */ -function theme_node_log_message($log) { +function theme_node_log_message($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return '
      ' . t('Log') . ':
      ' . $log . '
      '; } @@ -1508,7 +1514,10 @@ function node_user_cancel($edit, $account, $method) { * * @ingroup themeable */ -function theme_node_search_admin($form) { +function theme_node_search_admin($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = drupal_render($form['info']); $header = array(t('Factor'), t('Weight')); diff --git modules/node/node.pages.inc modules/node/node.pages.inc index d524f2a..3429d2d 100644 --- modules/node/node.pages.inc +++ modules/node/node.pages.inc @@ -32,7 +32,10 @@ function node_add_page() { * * @ingroup themeable */ -function theme_node_add_list($content) { +function theme_node_add_list($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; if ($content) { @@ -320,7 +323,10 @@ function node_form_build_preview($form, &$form_state) { * * @ingroup themeable */ -function theme_node_form($form) { +function theme_node_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = "\n
      \n"; $output .= "
      \n"; @@ -379,7 +385,10 @@ function node_preview($node) { * * @ingroup themeable */ -function theme_node_preview($node) { +function theme_node_preview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = '
      '; $preview_trimmed_version = FALSE; diff --git modules/poll/poll.module modules/poll/poll.module index d06a653..4bde930 100644 --- modules/poll/poll.module +++ modules/poll/poll.module @@ -747,7 +747,10 @@ function poll_view_results($node, $build_mode, $block = FALSE) { * * @ingroup themeable */ -function theme_poll_choices($form) { +function theme_poll_choices($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_tabledrag('poll-choice-table', 'order', 'sibling', 'poll-weight'); $delta = 0; diff --git modules/profile/profile.admin.inc modules/profile/profile.admin.inc index f1180a5..9bfa21d 100644 --- modules/profile/profile.admin.inc +++ modules/profile/profile.admin.inc @@ -96,7 +96,10 @@ function profile_admin_overview_submit($form, &$form_state) { * @ingroup themeable * @see profile_admin_overview() */ -function theme_profile_admin_overview($form) { +function theme_profile_admin_overview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_css(drupal_get_path('module', 'profile') . '/profile.css'); // Add javascript if there's more than one field. if (isset($form['submit'])) { diff --git modules/search/search.pages.inc modules/search/search.pages.inc index 801b077..2e2deaa 100644 --- modules/search/search.pages.inc +++ modules/search/search.pages.inc @@ -56,7 +56,10 @@ function search_view($type = 'node') { * @return * A string containing the listing output. */ -function theme_search_results_listing($title, $content) { +function theme_search_results_listing($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = '

      ' . $title . '

      ' . $content . '
      '; return $output; } diff --git modules/simpletest/simpletest.pages.inc modules/simpletest/simpletest.pages.inc index efae086..867b502 100644 --- modules/simpletest/simpletest.pages.inc +++ modules/simpletest/simpletest.pages.inc @@ -65,7 +65,10 @@ function simpletest_test_form() { * @param $table Form array that represent a table. * @return HTML output. */ -function theme_simpletest_test_table($table) { +function theme_simpletest_test_table($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css'); drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js'); @@ -362,7 +365,10 @@ function simpletest_result_form_submit($form, &$form_state) { * * @return HTML output. */ -function theme_simpletest_result_summary($form) { +function theme_simpletest_result_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return '
      ' . _simpletest_format_summary_line($form) . '
      '; } diff --git modules/simpletest/tests/common_test.module modules/simpletest/tests/common_test.module index 1b2464b..baa8331 100644 --- modules/simpletest/tests/common_test.module +++ modules/simpletest/tests/common_test.module @@ -84,7 +84,10 @@ function common_test_theme() { /** * Theme function for testing drupal_render() theming. */ -function theme_common_test_foo($foo, $bar) { +function theme_common_test_foo($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $foo . $bar; } diff --git modules/simpletest/tests/field_test.module modules/simpletest/tests/field_test.module index a0bac02..aa672b5 100644 --- modules/simpletest/tests/field_test.module +++ modules/simpletest/tests/field_test.module @@ -561,7 +561,10 @@ function field_test_theme() { /** * Theme function for 'field_test_default' formatter. */ -function theme_field_formatter_field_test_default($element) { +function theme_field_formatter_field_test_default($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $value = $element['#item']['value']; $settings = $element['#settings']; @@ -571,7 +574,10 @@ function theme_field_formatter_field_test_default($element) { /** * Theme function for 'field_test_multiple' formatter. */ -function theme_field_formatter_field_test_multiple($element) { +function theme_field_formatter_field_test_multiple($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $settings = $element['#settings']; $items = array(); diff --git modules/syslog/syslog.module modules/syslog/syslog.module index 5b1805d..c9cd552 100644 --- modules/syslog/syslog.module +++ modules/syslog/syslog.module @@ -93,7 +93,10 @@ function syslog_theme() { * * @ingroup themeable */ -function theme_syslog_format($entry) { +function theme_syslog_format($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + global $base_url; $message = $base_url; diff --git modules/system/system.admin.inc modules/system/system.admin.inc index 2ca6956..4be2681 100644 --- modules/system/system.admin.inc +++ modules/system/system.admin.inc @@ -1954,7 +1954,10 @@ function system_batch_page() { * include a 'title', a 'description' and a formatted 'content'. * @ingroup themeable */ -function theme_admin_block($block) { +function theme_admin_block($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // Don't display the block if it has no content to display. if (empty($block['show'])) { return ''; @@ -1995,7 +1998,10 @@ EOT; * include a 'title', a 'description' and a formatted 'content'. * @ingroup themeable */ -function theme_admin_block_content($content) { +function theme_admin_block_content($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + if (!$content) { return ''; } @@ -2028,7 +2034,10 @@ function theme_admin_block_content($content) { * in. This is usually 'left' or 'right'. * @ingroup themeable */ -function theme_admin_page($blocks) { +function theme_admin_page($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $stripe = 0; $container = array(); @@ -2064,7 +2073,10 @@ function theme_admin_page($blocks) { * An array of modules to be displayed. * @ingroup themeable */ -function theme_system_admin_by_module($menu_items) { +function theme_system_admin_by_module($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $stripe = 0; $output = ''; $container = array('left' => '', 'right' => ''); @@ -2112,7 +2124,10 @@ function theme_system_admin_by_module($menu_items) { * An array of requirements. * @ingroup themeable */ -function theme_status_report($requirements) { +function theme_status_report($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $i = 0; $output = ''; foreach ($requirements as $requirement) { @@ -2149,7 +2164,10 @@ function theme_status_report($requirements) { * An associative array containing the structure of the form. * @ingroup themeable */ -function theme_system_modules_fieldset($form) { +function theme_system_modules_fieldset($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // Individual table headers. $rows = array(); // Iterate through all the modules, which are @@ -2196,7 +2214,10 @@ function theme_system_modules_fieldset($form) { * @return * An HTML string for the message. */ -function theme_system_modules_incompatible($message) { +function theme_system_modules_incompatible($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return '
      ' . $message . '
      '; } @@ -2209,7 +2230,10 @@ function theme_system_modules_incompatible($message) { * @return * An HTML string representing the table. */ -function theme_system_modules_uninstall($form) { +function theme_system_modules_uninstall($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // No theming for the confirm form. if (isset($form['confirm'])) { return drupal_render($form); @@ -2249,7 +2273,10 @@ function theme_system_modules_uninstall($form) { * An associative array containing the structure of the form. * @ingroup themeable */ -function theme_system_themes_form($form) { +function theme_system_themes_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + foreach (element_children($form) as $key) { // Only look for themes if (!isset($form[$key]['info'])) { diff --git modules/system/system.module modules/system/system.module index 4f29fd4..aa15c2d 100644 --- modules/system/system.module +++ modules/system/system.module @@ -2963,7 +2963,10 @@ function system_timezone($abbreviation = '', $offset = -1, $is_daylight_saving_t * * @ingroup themeable */ -function theme_system_powered_by($image_path) { +function theme_system_powered_by($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $image = theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system')); return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE)); } @@ -2992,7 +2995,10 @@ function theme_system_compact_link() { * * @ingroup themeable */ -function theme_meta_generator_html($version = VERSION) { +function theme_meta_generator_html($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_html_head(''); } @@ -3001,7 +3007,10 @@ function theme_meta_generator_html($version = VERSION) { * * @ingroup themeable */ -function theme_meta_generator_header($version = VERSION) { +function theme_meta_generator_header($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_set_header('X-Generator', 'Drupal ' . $version . ' (http://drupal.org)'); } @@ -3154,7 +3163,10 @@ function system_run_cron_image_access() { * @see system_run_cron_image() * @ingroup themeable */ -function theme_system_run_cron_image($image_path) { +function theme_system_run_cron_image($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return ''; } diff --git modules/taxonomy/taxonomy.admin.inc modules/taxonomy/taxonomy.admin.inc index 2339e1f..4860cfa 100644 --- modules/taxonomy/taxonomy.admin.inc +++ modules/taxonomy/taxonomy.admin.inc @@ -62,7 +62,10 @@ function taxonomy_overview_vocabularies_submit($form, &$form_state) { * @ingroup themeable * @see taxonomy_overview_vocabularies() */ -function theme_taxonomy_overview_vocabularies($form) { +function theme_taxonomy_overview_vocabularies($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $rows = array(); foreach (element_children($form) as $key) { @@ -592,7 +595,10 @@ function taxonomy_overview_terms_submit($form, &$form_state) { * @ingroup themeable * @see taxonomy_overview_terms() */ -function theme_taxonomy_overview_terms($form) { +function theme_taxonomy_overview_terms($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $page_increment = $form['#page_increment']; $page_entries = $form['#page_entries']; $back_peddle = $form['#back_peddle']; diff --git modules/taxonomy/taxonomy.module modules/taxonomy/taxonomy.module index 23e0e5d..d639a30 100644 --- modules/taxonomy/taxonomy.module +++ modules/taxonomy/taxonomy.module @@ -1455,7 +1455,10 @@ function _taxonomy_term_select($title, $value, $vocabulary_id, $description, $mu * * @ingroup themeable */ -function theme_taxonomy_term_select($element) { +function theme_taxonomy_term_select($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('select', $element); } @@ -1876,7 +1879,10 @@ function taxonomy_field_formatter_info() { /** * Theme function for 'link' term field formatter. */ -function theme_field_formatter_taxonomy_term_link($element) { +function theme_field_formatter_taxonomy_term_link($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $term = $element['#item']['taxonomy_term']; return l($term->name, taxonomy_term_path($term)); } @@ -1884,7 +1890,10 @@ function theme_field_formatter_taxonomy_term_link($element) { /** * Theme function for 'plain' term field formatter. */ -function theme_field_formatter_taxonomy_term_plain($element) { +function theme_field_formatter_taxonomy_term_plain($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $term = $element['#item']['taxonomy_term']; return $term->name; } diff --git modules/trigger/trigger.admin.inc modules/trigger/trigger.admin.inc index f3f0257..1344af6 100644 --- modules/trigger/trigger.admin.inc +++ modules/trigger/trigger.admin.inc @@ -266,7 +266,10 @@ function trigger_assign_form_submit($form, $form_state) { * * @ingroup themeable */ -function theme_trigger_display($element) { +function theme_trigger_display($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(); $rows = array(); if (count($element['assigned']['#value'])) { diff --git modules/update/update.report.inc modules/update/update.report.inc index 83778e9..fa45dd5 100644 --- modules/update/update.report.inc +++ modules/update/update.report.inc @@ -25,7 +25,10 @@ function update_status() { * * @ingroup themeable */ -function theme_update_report($data) { +function theme_update_report($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $last = variable_get('update_last_check', 0); $output = '
      ' . ($last ? t('Last checked: @time ago', array('@time' => format_interval(REQUEST_TIME - $last))) : t('Last checked: never')); $output .= ' (' . l(t('Check manually'), 'admin/reports/updates/check') . ')'; @@ -227,7 +230,10 @@ function theme_update_report($data) { * * @ingroup themeable */ -function theme_update_version($version, $tag, $class) { +function theme_update_version($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $output .= '
      '; $output .= ''; diff --git modules/upload/upload.module modules/upload/upload.module index 5e46cc3..2ace36f 100644 --- modules/upload/upload.module +++ modules/upload/upload.module @@ -436,7 +436,10 @@ function upload_node_search_result($node) { * * @ingroup themeable */ -function theme_upload_attachments($elements) { +function theme_upload_attachments($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Attachment'), t('Size')); $rows = array(); foreach ($elements['#files'] as $file) { @@ -600,7 +603,10 @@ function _upload_form($node) { * * @ingroup themeable */ -function theme_upload_form_current($form) { +function theme_upload_form_current($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array('', t('Delete'), t('List'), t('Description'), t('Weight'), t('Size')); drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); @@ -627,7 +633,10 @@ function theme_upload_form_current($form) { * * @ingroup themeable */ -function theme_upload_form_new($form) { +function theme_upload_form_new($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); $output = drupal_render_children($form); return $output; diff --git modules/user/user.admin.inc modules/user/user.admin.inc index 24dad61..c21bcbf 100644 --- modules/user/user.admin.inc +++ modules/user/user.admin.inc @@ -678,7 +678,10 @@ function user_admin_permissions_submit($form, &$form_state) { * * @ingroup themeable */ -function theme_user_admin_permissions($form) { +function theme_user_admin_permissions($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $roles = user_roles(); foreach (element_children($form['permission']) as $key) { $row = array(); @@ -804,7 +807,10 @@ function user_admin_role_submit($form, &$form_state) { * * @ingroup themeable */ -function theme_user_admin_account($form) { +function theme_user_admin_account($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // Overview table: $header = array( theme('table_select_header_cell'), @@ -849,7 +855,10 @@ function theme_user_admin_account($form) { * * @ingroup themeable */ -function theme_user_admin_new_role($form) { +function theme_user_admin_new_role($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Name'), array('data' => t('Operations'), 'colspan' => 2)); foreach (user_roles() as $rid => $name) { $edit_permissions = l(t('edit permissions'), 'admin/config/people/permissions/' . $rid); @@ -873,7 +882,10 @@ function theme_user_admin_new_role($form) { * * @ingroup themeable */ -function theme_user_filter_form($form) { +function theme_user_filter_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = '
      '; $output .= drupal_render($form['filters']); $output .= '
      '; @@ -886,7 +898,10 @@ function theme_user_filter_form($form) { * * @ingroup themeable */ -function theme_user_filters($form) { +function theme_user_filters($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = '
        '; if (!empty($form['current'])) { foreach (element_children($form['current']) as $key) { diff --git modules/user/user.module modules/user/user.module index 60da692..a8599f4 100644 --- modules/user/user.module +++ modules/user/user.module @@ -1160,7 +1160,10 @@ function template_preprocess_user_picture(&$variables) { * * @ingroup themeable */ -function theme_user_list($users, $title = NULL) { +function theme_user_list($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + if (!empty($users)) { foreach ($users as $user) { $items[] = theme('username', $user); @@ -2693,7 +2696,10 @@ function user_comment_view($comment) { * * @ingroup themeable */ -function theme_user_signature($signature) { +function theme_user_signature($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; if ($signature) { $output .= '
        ';