Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.211 diff -u -p -r1.211 install.php --- install.php 29 Sep 2009 15:31:12 -0000 1.211 +++ install.php 6 Oct 2009 18:23:20 -0000 @@ -263,7 +263,7 @@ function install_begin_request(&$install require_once DRUPAL_ROOT . '/includes/cache-install.inc'; $conf['cache_inc'] = 'includes/cache.inc'; $conf['cache_default_class'] = 'DrupalFakeCache'; - + // Prepare for themed output, if necessary. We need to run this at the // beginning of the page request to avoid a different theme accidentally // getting set. @@ -679,9 +679,9 @@ function install_display_output($output, // Let the theming function know when every step of the installation has // been completed. $active_task = $install_state['installation_finished'] ? NULL : $install_state['active_task']; - drupal_add_region_content('sidebar_first', theme_task_list(install_tasks_to_display($install_state), $active_task)); + drupal_add_region_content('sidebar_first', theme('task_list', array('items' => install_tasks_to_display($install_state), 'active' => $active_task))); } - print theme($install_state['database_tables_exist'] ? 'maintenance_page' : 'install_page', $output); + print theme($install_state['database_tables_exist'] ? 'maintenance_page' : 'install_page', array('content' => $output)); exit; } @@ -708,7 +708,7 @@ function install_verify_requirements(&$i if ($severity == REQUIREMENT_ERROR) { if ($install_state['interactive']) { drupal_set_title(st('Requirements problem')); - $status_report = theme('status_report', $requirements); + $status_report = theme('status_report', array('requirements' => $requirements)); $status_report .= st('Check the error messages and proceed with the installation.', array('!url' => request_uri())); return $status_report; } @@ -956,7 +956,7 @@ function install_database_errors($databa $databases['default']['default'] = $database; try { db_run_tasks($database['driver']); - } + } catch (DatabaseTaskException $e) { // These are generic errors, so we do not have any specific key of the // database connection array to attach them to; therefore, we just put @@ -1025,7 +1025,8 @@ function install_select_profile(&$instal if ($install_state['interactive']) { include_once DRUPAL_ROOT . '/includes/form.inc'; drupal_set_title(st('Select an installation profile')); - return drupal_render(drupal_get_form('install_select_profile_form', $install_state['profiles'])); + $form = drupal_get_form('install_select_profile_form', $install_state['profiles']); + return drupal_render($form); } else { throw new Exception(install_no_profile_error()); @@ -1076,7 +1077,7 @@ function install_select_profile_form($fo foreach ($profile_files as $profile) { // TODO: is this right? include_once DRUPAL_ROOT . '/' . $profile->uri; - + $details = install_profile_info($profile->name); $profiles[$profile->name] = $details; @@ -1680,7 +1681,7 @@ function install_configure_form_submit($ // Enable update.module if this option was selected. if ($form_state['values']['update_status_module'][1]) { drupal_install_modules(array('update')); - + // Add the site maintenance account's email address to the list of // addresses to be notified when updates are available, if selected. if ($form_state['values']['update_status_module'][2]) { Index: update.php =================================================================== RCS file: /cvs/drupal/drupal/update.php,v retrieving revision 1.305 diff -u -p -r1.305 update.php --- update.php 28 Sep 2009 22:16:32 -0000 1.305 +++ update.php 6 Oct 2009 18:23:20 -0000 @@ -66,7 +66,7 @@ function update_script_selection_form() '#value' => $update['start'], ); $form['start'][$module . '_updates'] = array( - '#markup' => theme('item_list', $update['pending'], $module . ' module'), + '#markup' => theme('item_list', array('items' => $update['pending'], 'title' => $module . ' module')), ); } if (isset($update['pending'])) { @@ -78,7 +78,7 @@ function update_script_selection_form() drupal_set_message(t('No pending updates.')); unset($form); $form['links'] = array( - '#markup' => theme('item_list', update_helpful_links()), + '#markup' => theme('item_list', array('items' => update_helpful_links())), ); } else { @@ -136,7 +136,7 @@ function update_results_page() { $output .= "

Reminder: don't forget to set the \$update_free_access value in your settings.php file back to FALSE.

"; } - $output .= theme('item_list', $links); + $output .= theme('item_list', array('items' => $links)); // Output a list of queries executed if (!empty($_SESSION['update_results'])) { @@ -224,7 +224,7 @@ function update_task_list($active = NULL 'finished' => 'Review log', ); - drupal_add_region_content('sidebar_first', theme('task_list', $tasks, $active)); + drupal_add_region_content('sidebar_first', theme('task_list', array('items' => $tasks, 'active' => $active))); } /** @@ -252,9 +252,9 @@ function update_check_requirements() { if ($severity == REQUIREMENT_ERROR) { update_task_list('requirements'); drupal_set_title('Requirements problem'); - $status_report = theme('status_report', $requirements); + $status_report = theme('status_report', array('requirements' => $requirements)); $status_report .= 'Please check the error messages and try again.'; - print theme('update_page', $status_report); + print theme('update_page', array('content' => $status_report)); exit(); } } @@ -363,5 +363,5 @@ else { if (isset($output) && $output) { // We defer the display of messages until all updates are done. $progress_page = ($batch = batch_get()) && isset($batch['running']); - print theme('update_page', $output, !$progress_page); + print theme('update_page', array('content' => $output, 'show_messages' => !$progress_page)); } Index: includes/batch.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/batch.inc,v retrieving revision 1.40 diff -u -p -r1.40 batch.inc --- includes/batch.inc 3 Oct 2009 20:17:45 -0000 1.40 +++ includes/batch.inc 6 Oct 2009 18:23:20 -0000 @@ -170,7 +170,7 @@ function _batch_progress_page_nojs() { // the error message. ob_start(); $fallback = $current_set['error_message'] . '
' . $batch['error_message']; - $fallback = theme('maintenance_page', $fallback, FALSE); + $fallback = theme('maintenance_page', array('content' => $fallback, 'show_messages' => FALSE)); // We strip the end of the page using a marker in the template, so any // additional HTML output by PHP shows up inside the page rather than below @@ -192,7 +192,7 @@ function _batch_progress_page_nojs() { $url = url($batch['url'], array('query' => array('id' => $batch['id'], 'op' => $new_op))); drupal_add_html_head(''); - return theme('progress_bar', $percentage, $message); + return theme('progress_bar', array('percent' => $percentage, 'message' => $message)); } /** Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1008 diff -u -p -r1.1008 common.inc --- includes/common.inc 5 Oct 2009 02:48:38 -0000 1.1008 +++ includes/common.inc 6 Oct 2009 18:23:20 -0000 @@ -320,7 +320,7 @@ function drupal_add_feed($url = NULL, $t $stored_feed_links = &drupal_static(__FUNCTION__, array()); if (!is_null($url) && !isset($stored_feed_links[$url])) { - $stored_feed_links[$url] = theme('feed_icon', $url, $title); + $stored_feed_links[$url] = theme('feed_icon', array('url' => $url, 'title' => $title)); drupal_add_link(array('rel' => 'alternate', 'type' => 'application/rss+xml', @@ -650,8 +650,8 @@ function drupal_site_offline() { drupal_maintenance_theme(); drupal_add_http_header('503 Service unavailable'); drupal_set_title(t('Site under maintenance')); - print theme('maintenance_page', filter_xss_admin(variable_get('maintenance_mode_message', - t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')))))); + print theme('maintenance_page', array('content' => filter_xss_admin(variable_get('maintenance_mode_message', + t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal'))))))); } /** @@ -1174,7 +1174,7 @@ function _drupal_log_error($error, $fata drupal_set_title(t('Error')); // We fallback to a maintenance page at this point, because the page generation // itself can generate errors. - print theme('maintenance_page', t('The website encountered an unexpected error. Please try again later.')); + print theme('maintenance_page', array('content' => t('The website encountered an unexpected error. Please try again later.'))); exit; } } @@ -1499,7 +1499,7 @@ function t($string, array $args = array( case '%': default: // Escaped and placeholder. - $args[$key] = theme('placeholder', $value); + $args[$key] = theme('placeholder', array('text' => $value)); break; case '!': @@ -3683,7 +3683,7 @@ function drupal_get_library($module, $na * themed into a table. The table must have an id attribute set. If using * theme_table(), the id may be set as such: * @code - * $output = theme('table', $header, $rows, array('id' => 'my-module-table')); + * $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'my-module-table'))); * return $output; * @endcode * @@ -4860,7 +4860,7 @@ function drupal_common_theme() { 'arguments' => array('region' => NULL), ), 'username' => array( - 'arguments' => array('object' => NULL), + 'arguments' => array('account' => NULL), ), 'progress_bar' => array( 'arguments' => array('percent' => NULL, 'message' => NULL), Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.192 diff -u -p -r1.192 file.inc --- includes/file.inc 30 Sep 2009 18:36:01 -0000 1.192 +++ includes/file.inc 6 Oct 2009 18:23:20 -0000 @@ -1162,7 +1162,7 @@ function file_save_upload($source, $vali if (!empty($errors)) { $message = t('The specified file %name could not be uploaded.', array('%name' => $file->filename)); if (count($errors) > 1) { - $message .= theme('item_list', $errors); + $message .= theme('item_list', array('items' => $errors)); } else { $message .= ' ' . array_pop($errors); Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.379 diff -u -p -r1.379 form.inc --- includes/form.inc 5 Oct 2009 01:18:25 -0000 1.379 +++ includes/form.inc 6 Oct 2009 18:23:21 -0000 @@ -1562,7 +1562,8 @@ function form_options_flatten($array, $r * $options to an associative array in which the keys are group labels, and the * values are associative arrays in the normal $options format. */ -function theme_select($element) { +function theme_select($variables) { + $element = $variables['element']; $select = ''; $size = $element['#size'] ? ' size="' . $element['#size'] . '"' : ''; _form_set_class($element, array('form-select')); @@ -1676,7 +1677,8 @@ function form_get_options($element, $key * * @ingroup themeable */ -function theme_fieldset($element) { +function theme_fieldset($variables) { + $element = $variables['element']; if (!empty($element['#collapsible'])) { if (!isset($element['#attributes']['class'])) { @@ -1705,7 +1707,8 @@ function theme_fieldset($element) { * * @ingroup themeable */ -function theme_radio($element) { +function theme_radio($variables) { + $element = $variables['element']; _form_set_class($element, array('form-radio')); $output = '' . drupal_render_children($element) . ''; } @@ -2015,7 +2020,8 @@ function form_process_text_format($eleme * * @ingroup themeable */ -function theme_text_format_wrapper($element) { +function theme_text_format_wrapper($variables) { + $element = $variables['element']; $output = '
' . "\n"; $output .= $element['#children'] . "\n"; @@ -2041,7 +2047,8 @@ function theme_text_format_wrapper($elem * * @ingroup themeable */ -function theme_checkbox($element) { +function theme_checkbox($variables) { + $element = $variables['element']; _form_set_class($element, array('form-checkbox')); $checkbox = ' $element['#empty'], 'colspan' => count($header))); } - return theme('table', $header, $rows); + return theme('table', array('header' => $header, 'rows' => $rows)); } /** @@ -2384,7 +2393,8 @@ function form_process_vertical_tabs($ele * * @ingroup themeable */ -function theme_vertical_tabs($element) { +function theme_vertical_tabs($variables) { + $element = $variables['element']; // Add required JavaScript and Stylesheet. drupal_add_library('system', 'vertical-tabs'); @@ -2402,7 +2412,8 @@ function theme_vertical_tabs($element) { * * @ingroup themeable */ -function theme_submit($element) { +function theme_submit($variables) { + $element = $variables['element']; return theme('button', $element); } @@ -2417,7 +2428,8 @@ function theme_submit($element) { * * @ingroup themeable */ -function theme_button($element) { +function theme_button($variables) { + $element = $variables['element']; $element['#attributes']['class'][] = 'form-' . $element['#button_type']; return '\n"; @@ -2433,7 +2445,8 @@ function theme_button($element) { * A themed HTML string representing the form element. * @ingroup themeable */ -function theme_image_button($element) { +function theme_image_button($variables) { + $element = $variables['element']; $element['#attributes']['class'][] = 'form-' . $element['#button_type']; return '\n"; } @@ -2472,7 +2486,8 @@ function theme_hidden($element) { * * @ingroup themeable */ -function theme_textfield($element) { +function theme_textfield($variables) { + $element = $variables['element']; $size = empty($element['#size']) ? '' : ' size="' . $element['#size'] . '"'; $maxlength = empty($element['#maxlength']) ? '' : ' maxlength="' . $element['#maxlength'] . '"'; $class = array('form-text'); @@ -2509,7 +2524,8 @@ function theme_textfield($element) { * * @ingroup themeable */ -function theme_form($element) { +function theme_form($variables) { + $element = $variables['element']; // Anonymous div to satisfy XHTML compliance. $action = $element['#action'] ? 'action="' . check_url($element['#action']) . '" ' : ''; return '
\n
" . $element['#children'] . "\n
\n"; @@ -2527,7 +2543,8 @@ function theme_form($element) { * * @ingroup themeable */ -function theme_textarea($element) { +function theme_textarea($variables) { + $element = $variables['element']; $class = array('form-textarea'); // Add resizable behavior @@ -2552,7 +2569,8 @@ function theme_textarea($element) { * @ingroup themeable */ -function theme_markup($element) { +function theme_markup($variables) { + $element = $variables['element']; return (!empty($element['#markup']) ? $element['#markup'] : '') . drupal_render_children($element); } @@ -2568,7 +2586,8 @@ function theme_markup($element) { * * @ingroup themeable */ -function theme_password($element) { +function theme_password($variables) { + $element = $variables['element']; $size = $element['#size'] ? ' size="' . $element['#size'] . '" ' : ''; $maxlength = $element['#maxlength'] ? ' maxlength="' . $element['#maxlength'] . '" ' : ''; @@ -2605,7 +2624,8 @@ function form_process_weight($element) { * For assistance with handling the uploaded file correctly, see the API * provided by file.inc. */ -function theme_file($element) { +function theme_file($variables) { + $element = $variables['element']; _form_set_class($element, array('form-file')); return '\n"; } @@ -2621,7 +2641,8 @@ function theme_file($element) { * * @ingroup themeable */ -function theme_form_element($element) { +function theme_form_element($variables) { + $element = $variables['element']; // This is also used in the installer, pre-database setup. $t = get_t(); @@ -2905,7 +2926,7 @@ function batch_process($redirect = NULL, $batch =& batch_get(); drupal_theme_initialize(); - + if (isset($batch)) { // Add process information $process_info = array( Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.229 diff -u -p -r1.229 locale.inc --- includes/locale.inc 29 Sep 2009 15:13:54 -0000 1.229 +++ includes/locale.inc 6 Oct 2009 18:23:21 -0000 @@ -71,7 +71,8 @@ function locale_languages_overview_form( * * @ingroup themeable */ -function theme_locale_languages_overview_form($form) { +function theme_locale_languages_overview_form($variables) { + $form = $variables['form']; $default = language_default(); foreach ($form['name'] as $key => $element) { // Do not take form control structures. @@ -96,7 +97,7 @@ function theme_locale_languages_overview } } $header = array(array('data' => t('English name')), array('data' => t('Native name')), array('data' => t('Code')), array('data' => t('Direction')), array('data' => t('Enabled')), array('data' => t('Default')), array('data' => t('Weight')), array('data' => t('Operations'))); - $output = theme('table', $header, $rows, array('id' => 'language-order')); + $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'language-order'))); $output .= drupal_render_children($form); drupal_add_tabledrag('language-order', 'order', 'sibling', 'language-order-weight'); @@ -543,7 +544,7 @@ function locale_translate_overview_scree $rows[$data->language][$data->textgroup] = $data->translation . '/' . $groupsums[$data->textgroup] . " ($ratio%)"; } - return theme('table', $headers, $rows); + return theme('table', array('header' => $headers, 'rows' => $rows)); } /** * @} End of "locale-translate-overview" @@ -2305,8 +2306,8 @@ function _locale_translate_seek() { } if (count($rows)) { - $output .= theme('table', $header, $rows); - if ($pager = theme('pager', NULL)) { + $output .= theme('table', array('header' => $header, 'rows' => $rows)); + if ($pager = theme('pager', array('tags' => NULL))) { $output .= $pager; } } Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.348 diff -u -p -r1.348 menu.inc --- includes/menu.inc 1 Oct 2009 19:07:12 -0000 1.348 +++ includes/menu.inc 6 Oct 2009 18:23:21 -0000 @@ -1310,8 +1310,8 @@ function template_preprocess_menu_tree(& * * @ingroup themeable */ -function theme_menu_tree($tree) { - return ''; +function theme_menu_tree($variables) { + return ''; } /** @@ -1322,7 +1322,8 @@ function theme_menu_tree($tree) { * * @ingroup themeable */ -function theme_menu_link(array $element) { +function theme_menu_link(array $variables) { + $element = $variables['element']; $sub_menu = ''; if ($element['#below']) { @@ -1342,8 +1343,9 @@ function theme_menu_link(array $element) * * @ingroup themeable */ -function theme_menu_local_task($link, $active = FALSE) { - return '
  • ' . l($link['title'], $link['href'], $link['localized_options']) . "
  • \n"; +function theme_menu_local_task($variables) { + $link = $variables['link']; + return '
  • ' . l($link['title'], $link['href'], $link['localized_options']) . "
  • \n"; } /** @@ -1354,7 +1356,8 @@ function theme_menu_local_task($link, $a * * @ingroup themeable */ -function theme_menu_local_action($link) { +function theme_menu_local_action($variables) { + $link = $variables['link']; return '
  • ' . l($link['title'], $link['href'], $link['localized_options']) . "
  • \n"; } @@ -1389,7 +1392,7 @@ function menu_get_active_help() { // Add "more help" link on admin pages if the module provides a // standalone help page. if ($arg[0] == "admin" && user_access('access administration pages') && module_exists('help') && $function('admin/help#' . $arg[2], $empty_arg) && $help) { - $output .= theme("more_help_link", url('admin/help/' . $arg[2])); + $output .= theme("more_help_link", array('url' => url('admin/help/' . $arg[2]))); } } return $output; @@ -1597,17 +1600,17 @@ function menu_local_tasks($level = 0) { for ($p = $item['tab_parent']; $tasks[$p]['type'] == MENU_DEFAULT_LOCAL_TASK; $p = $tasks[$p]['tab_parent']); // Use the path of the parent instead. $link['href'] = $tasks[$p]['href']; - $tabs_current .= theme('menu_local_task', $link, TRUE); + $tabs_current .= theme('menu_local_task', array('link' => $link, 'active' => TRUE)); $next_path = $item['path']; $tab_count++; } else { if ($item['type'] == MENU_LOCAL_TASK) { - $tabs_current .= theme('menu_local_task', $link); + $tabs_current .= theme('menu_local_task', array('link' => $link)); $tab_count++; } else { - $actions_current .= theme('menu_local_action', $link); + $actions_current .= theme('menu_local_action', array('link' => $link)); $action_count++; } } @@ -1649,14 +1652,14 @@ function menu_local_tasks($level = 0) { } // We check for the active tab. if ($item['path'] == $path) { - $tabs_current .= theme('menu_local_task', $link, TRUE); + $tabs_current .= theme('menu_local_task', array('link' => $link, 'active' => TRUE)); $next_path = $item['tab_parent']; if (isset($tasks[$next_path])) { $next_parent = $tasks[$next_path]['tab_parent']; } } else { - $tabs_current .= theme('menu_local_task', $link); + $tabs_current .= theme('menu_local_task', array('link' => $link)); } } } Index: includes/pager.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/pager.inc,v retrieving revision 1.73 diff -u -p -r1.73 pager.inc --- includes/pager.inc 29 Sep 2009 15:31:13 -0000 1.73 +++ includes/pager.inc 6 Oct 2009 18:23:21 -0000 @@ -205,7 +205,11 @@ function pager_get_query_parameters() { * * @ingroup themeable */ -function theme_pager($tags = array(), $element = 0, $parameters = array(), $quantity = 9) { +function theme_pager($variables) { + $tags = $variables['tags']; + $element = $variables['element']; + $parameters = $variables['parameters']; + $quantity = $variables['quantity']; global $pager_page_array, $pager_total; // Calculate various markers within this pager piece: @@ -235,10 +239,10 @@ function theme_pager($tags = array(), $e } // End of generation loop preparation. - $li_first = theme('pager_first', (isset($tags[0]) ? $tags[0] : t('« first')), $element, $parameters); - $li_previous = theme('pager_previous', (isset($tags[1]) ? $tags[1] : t('‹ previous')), $element, 1, $parameters); - $li_next = theme('pager_next', (isset($tags[3]) ? $tags[3] : t('next ›')), $element, 1, $parameters); - $li_last = theme('pager_last', (isset($tags[4]) ? $tags[4] : t('last »')), $element, $parameters); + $li_first = theme('pager_first', array('text' => (isset($tags[0]) ? $tags[0] : t('« first')), 'element' => $element, 'parameters' => $parameters)); + $li_previous = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('‹ previous')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters)); + $li_next = theme('pager_next', array('text' => (isset($tags[3]) ? $tags[3] : t('next ›')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters)); + $li_last = theme('pager_last', array('text' => (isset($tags[4]) ? $tags[4] : t('last »')), 'element' => $element, 'parameters' => $parameters)); if ($pager_total[$element] > 1) { if ($li_first) { @@ -267,7 +271,7 @@ function theme_pager($tags = array(), $e if ($i < $pager_current) { $items[] = array( 'class' => array('pager-item'), - 'data' => theme('pager_previous', $i, $element, ($pager_current - $i), $parameters), + 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($pager_current - $i), 'parameters' => $parameters)), ); } if ($i == $pager_current) { @@ -279,7 +283,7 @@ function theme_pager($tags = array(), $e if ($i > $pager_current) { $items[] = array( 'class' => array('pager-item'), - 'data' => theme('pager_next', $i, $element, ($i - $pager_current), $parameters), + 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $pager_current), 'parameters' => $parameters)), ); } } @@ -303,7 +307,7 @@ function theme_pager($tags = array(), $e 'data' => $li_last, ); } - return theme('item_list', $items, NULL, 'ul', array('class' => array('pager'))); + return theme('item_list', array('items' => $items, 'title' => NULL, 'type' => 'ul', 'attributes' => array('class' => array('pager')))); } } @@ -329,13 +333,16 @@ function theme_pager($tags = array(), $e * * @ingroup themeable */ -function theme_pager_first($text, $element = 0, $parameters = array()) { +function theme_pager_first($variables) { + $text = $variables['text']; + $element = $variables['element']; + $parameters = $variables['parameters']; global $pager_page_array; $output = ''; // If we are anywhere but the first page if ($pager_page_array[$element] > 0) { - $output = theme('pager_link', $text, pager_load_array(0, $element, $pager_page_array), $element, $parameters); + $output = theme('pager_link', array('text' => $text, 'page_new' => pager_load_array(0, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters)); } return $output; @@ -357,7 +364,11 @@ function theme_pager_first($text, $eleme * * @ingroup themeable */ -function theme_pager_previous($text, $element = 0, $interval = 1, $parameters = array()) { +function theme_pager_previous($variables) { + $text = $variables['text']; + $element = $variables['element']; + $interval = $variables['interval']; + $parameters = $variables['parameters']; global $pager_page_array; $output = ''; @@ -367,11 +378,11 @@ function theme_pager_previous($text, $el // If the previous page is the first page, mark the link as such. if ($page_new[$element] == 0) { - $output = theme('pager_first', $text, $element, $parameters); + $output = theme('pager_first', array('text' => $text, 'element' => $element, 'parameters' => $parameters)); } // The previous page is not the first page. else { - $output = theme('pager_link', $text, $page_new, $element, $parameters); + $output = theme('pager_link', array('text' => $text, 'page_new' => $page_new, 'element' => $element, 'parameters' => $parameters)); } } @@ -394,7 +405,11 @@ function theme_pager_previous($text, $el * * @ingroup themeable */ -function theme_pager_next($text, $element = 0, $interval = 1, $parameters = array()) { +function theme_pager_next($variables) { + $text = $variables['text']; + $element = $variables['element']; + $interval = $variables['interval']; + $parameters = $variables['parameters']; global $pager_page_array, $pager_total; $output = ''; @@ -403,11 +418,11 @@ function theme_pager_next($text, $elemen $page_new = pager_load_array($pager_page_array[$element] + $interval, $element, $pager_page_array); // If the next page is the last page, mark the link as such. if ($page_new[$element] == ($pager_total[$element] - 1)) { - $output = theme('pager_last', $text, $element, $parameters); + $output = theme('pager_last', array('text' => $text, 'element' => $element, 'parameters' => $parameters)); } // The next page is not the last page. else { - $output = theme('pager_link', $text, $page_new, $element, $parameters); + $output = theme('pager_link', array('text' => $text, 'page_new' => $page_new, 'element' => $element, 'parameters' => $parameters)); } } @@ -428,13 +443,16 @@ function theme_pager_next($text, $elemen * * @ingroup themeable */ -function theme_pager_last($text, $element = 0, $parameters = array()) { +function theme_pager_last($variables) { + $text = $variables['text']; + $element = $variables['element']; + $parameters = $variables['parameters']; global $pager_page_array, $pager_total; $output = ''; // If we are anywhere but the last page if ($pager_page_array[$element] < ($pager_total[$element] - 1)) { - $output = theme('pager_link', $text, pager_load_array($pager_total[$element] - 1, $element, $pager_page_array), $element, $parameters); + $output = theme('pager_link', array('text' => $text, 'page_new' => pager_load_array($pager_total[$element] - 1, $element, $pager_page_array), 'element' => $element, 'parameters' => $parameters)); } return $output; @@ -457,7 +475,13 @@ function theme_pager_last($text, $elemen * * @ingroup themeable */ -function theme_pager_link($text, $page_new, $element, $parameters = array(), $attributes = array()) { +function theme_pager_link($variables) { + $text = $variables['text']; + $page_new = $variables['page_new']; + $element = $variables['element']; + $parameters = $variables['parameters']; + $attributes = $variables['attributes']; + $page = isset($_GET['page']) ? $_GET['page'] : ''; if ($new_page = implode(',', pager_load_array($page_new[$element], $element, explode(',', $page)))) { $parameters['page'] = $new_page; Index: includes/tablesort.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/tablesort.inc,v retrieving revision 1.55 diff -u -p -r1.55 tablesort.inc --- includes/tablesort.inc 29 Sep 2009 15:31:13 -0000 1.55 +++ includes/tablesort.inc 6 Oct 2009 18:23:21 -0000 @@ -169,7 +169,7 @@ function tablesort_header($cell, $header if ($cell['data'] == $ts['name']) { $ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc'); $cell['class'][] = 'active'; - $image = theme('tablesort_indicator', $ts['sort']); + $image = theme('tablesort_indicator', array('style' => $ts['sort'])); } else { // If the user clicks a different header, we want to sort ascending initially. Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.531 diff -u -p -r1.531 theme.inc --- includes/theme.inc 5 Oct 2009 02:43:01 -0000 1.531 +++ includes/theme.inc 6 Oct 2009 18:23:21 -0000 @@ -751,10 +751,7 @@ function list_themes($refresh = FALSE) { * @return * An HTML string that generates the themed output. */ -function theme() { - $args = func_get_args(); - $hook = array_shift($args); - +function theme($hook, $variables = array()) { static $hooks = NULL; if (!isset($hooks)) { drupal_theme_initialize(); @@ -786,99 +783,78 @@ function theme() { include_once DRUPAL_ROOT . '/' . $include_file; } } - if (isset($info['function'])) { - // The theme call is a function. - // If a theme function that does not expect a renderable array is called - // with a renderable array as the only argument (via drupal_render), then - // we take the arguments from the properties of the renderable array. If - // missing, use hook_theme() defaults. - if (isset($args[0]) && is_array($args[0]) && isset($args[0]['#theme']) && count($info['arguments']) > 1) { - $new_args = array(); + // If a renderable array is passed as $variables, then set $variables to + // what's expected by the theme hook. If the theme hook expects a single + // argument, set the renderable array as that argument. If the theme hook + // expects multiple arguments, set the properties of the renderable array as + // those arguments. + if (isset($variables['#theme']) || isset($variables['#theme_wrappers'])) { + $element = $variables; + $variables = array(); + $n = count($info['arguments']); + if ($n == 1) { + $arg_keys = array_keys($info['arguments']); + $variables[$arg_keys[0]] = $element; + } + elseif ($n > 1) { foreach ($info['arguments'] as $name => $default) { - $new_args[] = isset($args[0]["#$name"]) ? $args[0]["#$name"] : $default; + if (isset($element["#$name"])) { + $variables[$name] = $element["#$name"]; + } } - $args = $new_args; } + } - // 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 - // we do have processors, then the overhead of calling them overshadows the - // overhead of calling empty(). - if (!isset($info['_no_processors'])) { - if (!empty($info['preprocess functions']) || !empty($info['process functions'])) { - $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) { - if (!empty($info[$phase])) { - foreach ($info[$phase] as $processor_function) { - if (function_exists($processor_function)) { - $processor_function($variables, $hook_clone); - } - } - } - } - if (!empty($info['arguments'])) { - $count = 0; - foreach ($info['arguments'] as $name => $default) { - $args[$count] = $variables[$name]; - $count++; - } - } + // Merge in argument defaults. + if (!empty($info['arguments'])) { + $variables += $info['arguments']; + } - // 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']; - } - if (isset($variables['theme_function'])) { - $suggestions[] = $variables['theme_function']; - } - foreach (array_reverse($suggestions) as $suggestion) { - if (function_exists($suggestion)) { - $info['function'] = $suggestion; - break; + // Invoke the variable processors, if any. The processors may specify + // alternate suggestions for which function/template should be used. + if (isset($info['preprocess functions']) || isset($info['process functions'])) { + $variables['theme_functions'] = array(); + $variables['template_files'] = array(); + foreach (array('preprocess functions', 'process functions') as $phase) { + if (!empty($info[$phase])) { + foreach ($info[$phase] as $processor_function) { + if (function_exists($processor_function)) { + // We don't want a poorly behaved process function changing $hook. + $hook_clone = $hook; + $processor_function($variables, $hook_clone); } } } - else { - $hooks[$hook]['_no_processors'] = TRUE; + } + // Function suggestion takes priority over template suggestion. + // theme_function takes priority over theme_functions. + // theme_functions are in FILO order (least appropriate to most appropriate). + // Here, just look for function suggestions. Deal with template + // suggestions only after determining that the theme call is a template. + $suggestions = array(); + if (!empty($variables['theme_functions'])) { + $suggestions = $variables['theme_functions']; + } + if (!empty($variables['theme_function'])) { + $suggestions[] = $variables['theme_function']; + } + foreach (array_reverse($suggestions) as $suggestion) { + if (function_exists($suggestion)) { + $info['function'] = $suggestion; + break; } } + } - // Call the function. + // Generate the output using either a function or a template. + if (isset($info['function'])) { if (function_exists($info['function'])) { - $output = call_user_func_array($info['function'], $args); + $output = $info['function']($variables); } } else { - // The theme call is a template. - $variables = array( - 'template_files' => array() - ); - if (!empty($info['arguments'])) { - $count = 0; - foreach ($info['arguments'] as $name => $default) { - $variables[$name] = isset($args[$count]) ? $args[$count] : $default; - $count++; - } - } - - // default render function and extension. + // Default render function and extension. $render_function = 'theme_render_template'; $extension = '.tpl.php'; @@ -898,44 +874,32 @@ function theme() { } } - // This construct ensures that we can keep a reference through - // call_user_func_array. - $args = array(&$variables, $hook); - foreach (array('preprocess functions', 'process functions') as $phase) { - if (!empty($info[$phase])) { - foreach ($info[$phase] as $processor_function) { - if (function_exists($processor_function)) { - call_user_func_array($processor_function, $args); - } - } - } - } - - // Get suggestions for alternate templates out of the variables - // that were set. This lets us dynamically choose a template - // from a list. The order is FILO, so this array is ordered from - // least appropriate first to most appropriate last. + // Find which template file exists and can be used. Priority order is: + // 1. $variables['template_file']. + // 2. $variables['template_files'] in FILO order (later in array is higher + // priority). + // 3. $info['template']. $suggestions = array(); - if (isset($variables['template_files'])) { $suggestions = $variables['template_files']; } if (isset($variables['template_file'])) { $suggestions[] = $variables['template_file']; } - if ($suggestions) { $template_file = drupal_discover_template($info['theme paths'], $suggestions, $extension); } - if (empty($template_file)) { $template_file = $info['template'] . $extension; if (isset($info['path'])) { $template_file = $info['path'] . '/' . $template_file; } } + + // Render the output using the found template file. $output = $render_function($template_file, $variables); } + // restore path_to_theme() $theme_path = $temp; return $output; @@ -1288,11 +1252,12 @@ function theme_render_template($template * * Inside Drupal, the theme layer is utilized by the use of the theme() * function, which is passed the name of a component (the theme hook) - * and several arguments. For example, theme('table', $header, $rows); + * and an array of variables. For example, + * theme('table', array('header' => $header, 'rows' => $rows)); * Additionally, the theme() function can take an array of theme * hooks, which can be used to provide 'fallback' implementations to * allow for more specific control of output. For example, the function: - * theme(array('table__foo', 'table'), $header, $rows) would look to see if + * theme(array('table__foo', 'table'), $variables) would look to see if * 'table__foo' is registered anywhere; if it is not, it would 'fall back' * to the generic 'table' implementation. This can be used to attach specific * theme functions to named objects, allowing the themer more control over @@ -1349,8 +1314,9 @@ function theme_render_template($template * @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']) . ''; } /** @@ -1366,8 +1332,10 @@ function theme_placeholder($text) { * @return * A string containing the messages. */ -function theme_status_messages($display = NULL) { +function theme_status_messages($variables) { + $display = $variables['display']; $output = ''; + $status_heading = array( 'status' => t('Status message'), 'error' => t('Error message'), @@ -1423,7 +1391,10 @@ function theme_status_messages($display * @return * A string containing an unordered list of links. */ -function theme_links($links, $attributes = array('class' => array('links')), $heading = array()) { +function theme_links($variables) { + $links = $variables['links']; + $attributes = $variables['attributes']; + $heading = $variables['heading']; global $language; $output = ''; @@ -1512,7 +1483,13 @@ function theme_links($links, $attributes * @return * A string containing the image tag. */ -function theme_image($path, $alt = '', $title = '', $attributes = array(), $getsize = TRUE) { +function theme_image($variables) { + $path = $variables['path']; + $alt = $variables['alt']; + $title = $variables['title']; + $attributes = $variables['attributes']; + $getsize = $variables['getsize']; + if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) { $attributes = drupal_attributes($attributes); $url = file_create_url($path); @@ -1527,7 +1504,9 @@ function theme_image($path, $alt = '', $ * An array containing the breadcrumb links. * @return a string containing the breadcrumb output. */ -function theme_breadcrumb($breadcrumb) { +function theme_breadcrumb($variables) { + $breadcrumb = $variables['breadcrumb']; + if (!empty($breadcrumb)) { // Provide a navigational heading to give context for breadcrumb links to // screen-reader users. Make the heading invisible with .element-invisible. @@ -1544,7 +1523,9 @@ function theme_breadcrumb($breadcrumb) { * @param $links * An array of links. */ -function theme_submenu($links) { +function theme_submenu($variables) { + $links = $variables['links']; + return ''; } @@ -1623,7 +1604,13 @@ 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) { + $header = $variables['header']; + $rows = $variables['rows']; + $attributes = $variables['attributes']; + $caption = $variables['caption']; + $colgroups = $variables['colgroups']; + $sticky = $variables['sticky']; // Add sticky headers, if applicable. if (count($header) && $sticky) { @@ -1752,12 +1739,12 @@ function theme_table_select_header_cell( * @return * A themed sort icon. */ -function theme_tablesort_indicator($style) { - if ($style == "asc") { - return theme('image', 'misc/arrow-asc.png', t('sort icon'), t('sort ascending')); +function theme_tablesort_indicator($variables) { + if ($variables['style'] == "asc") { + return theme('image', array('path' => 'misc/arrow-asc.png', 'alt' => t('sort icon'), 'title' => t('sort ascending'))); } else { - return theme('image', 'misc/arrow-desc.png', t('sort icon'), t('sort descending')); + return theme('image', array('path' => 'misc/arrow-desc.png', 'alt' => t('sort icon'), 'title' => t('sort descending'))); } } @@ -1771,7 +1758,8 @@ function theme_tablesort_indicator($styl * @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) { @@ -1801,7 +1789,12 @@ 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) { + $items = $variables['items']; + $title = $variables['title']; + $type = $variables['type']; + $attributes = $variables['attributes']; + $output = '
    '; if (isset($title)) { $output .= '

    ' . $title . '

    '; @@ -1849,8 +1842,8 @@ function theme_item_list($items = array( /** * Returns code that emits the 'more help'-link. */ -function theme_more_help_link($url) { - return ''; +function theme_more_help_link($variables) { + return ''; } /** @@ -1861,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)); - if ($image = theme('image', 'misc/feed.png', $text)) { - return '' . $image . ''; +function theme_feed_icon($variables) { + $text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title'])); + if ($image = theme('image', array('path' => 'misc/feed.png', 'alt' => $text))) { + return '' . $image . ''; } } @@ -1876,65 +1869,62 @@ 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 ''; } /** * Preprocess variables for theme_username(). * - * Modules that make any changes to the $variables['object'] properties like - * 'name' or 'extra' must insure that the final string is safe to include - * directly in the ouput by using check_plain() or filter_xss(). + * Modules that make any changes to variables like 'name' or 'extra' must insure + * that the final string is safe to include directly in the ouput by using + * check_plain() or filter_xss(). * * @see theme_username(). */ function template_preprocess_username(&$variables) { - $account = $variables['object']; - // Create a new empty object to populate with standardized data. - $variables['object'] = new stdClass; - // Keep a reference to the original data. - $variables['object']->account = $account; - $variables['object']->extra = ''; + $account = $variables['account']; + + $variables['extra'] = ''; if (empty($account->uid)) { - $variables['object']->uid = 0; - if (theme_get_setting('toggle_comment_user_verification')) { - $variables['object']->extra = ' (' . t('not verified') . ')'; - } + $variables['uid'] = 0; + if (theme_get_setting('toggle_comment_user_verification')) { + $variables['extra'] = ' (' . t('not verified') . ')'; + } } else { - $variables['object']->uid = (int)$account->uid; + $variables['uid'] = (int)$account->uid; } if (empty($account->name)) { - $variables['object']->name = variable_get('anonymous', t('Anonymous')); + $variables['name'] = variable_get('anonymous', t('Anonymous')); } else { - $variables['object']->name = $account->name; + $variables['name'] = $account->name; } - $variables['object']->profile_access = user_access('access user profiles'); - $variables['object']->link_attributes = array(); + $variables['profile_access'] = user_access('access user profiles'); + $variables['link_attributes'] = array(); // Populate link path and attributes if appropriate. - if ($variables['object']->uid && $variables['object']->profile_access) { + if ($variables['uid'] && $variables['profile_access']) { // We are linking to a local user. - $variables['object']->link_attributes = array('title' => t('View user profile.')); - $variables['object']->link_path = 'user/' . $variables['object']->uid; + $variables['link_attributes'] = array('title' => t('View user profile.')); + $variables['link_path'] = 'user/' . $variables['uid']; } elseif (!empty($account->homepage)) { - $variables['object']->link_attributes = array('rel' => 'nofollow'); - $variables['object']->link_path = $account->homepage; - $variables['object']->homepage = $account->homepage; + $variables['link_attributes'] = array('rel' => 'nofollow'); + $variables['link_path'] = $account->homepage; + $variables['homepage'] = $account->homepage; } // We do not want the l() function to check_plain() a second time. - $variables['object']->link_options['html'] = TRUE; + $variables['link_options']['html'] = TRUE; // Set a default class. - $variables['object']->attributes = array('class' => array('username')); + $variables['attributes_array'] = array('class' => array('username')); // Shorten the name when it is too long or it will break many tables. - if (drupal_strlen($variables['object']->name) > 20) { - $variables['object']->name = drupal_substr($variables['object']->name, 0, 15) . '...'; + if (drupal_strlen($variables['name']) > 20) { + $variables['name'] = drupal_substr($variables['name'], 0, 15) . '...'; } // Make sure name is safe for use in the theme function. - $variables['object']->name = check_plain($variables['object']->name); + $variables['name'] = check_plain($variables['name']); } /** @@ -1946,8 +1936,8 @@ function template_process_username(&$var // Finalize the link_options array for passing to the l() function. // This is done in the process phase so that attributes may be added by // modules or the theme during the preprocess phase. - if (isset($variables['object']->link_path)) { - $variables['object']->link_options['attributes'] = $variables['object']->link_attributes + $variables['object']->attributes; + if (isset($variables['link_path'])) { + $variables['link_options']['attributes'] = $variables['link_attributes'] + $variables['attributes_array']; } } @@ -1966,18 +1956,18 @@ function template_process_username(&$var * @see template_preprocess_username() * @see template_process_username() */ -function theme_username($object) { - if (isset($object->link_path)) { +function theme_username($variables) { + if (isset($variables['link_path'])) { // We have a link path, so we should generate a link using l(). // Additional classes may be added as array elements like - // $object->link_options['attributes']['class'][] = 'myclass'; - $output = l($object->name . $object->extra, $object->link_path, $object->link_options); + // $variables['link_options']['attributes']['class'][] = 'myclass'; + $output = l($variables['name'] . $variables['extra'], $variables['link_path'], $variables['link_options']); } else { // Modules may have added important attributes so they must be included // in the output. Additional classes may be added as array elements like - // $object->attributes['class'][] = 'myclass'; - $output = 'attributes) . '>' . $object->name . $object->extra . ''; + // $variables['attributes_array']['class'][] = 'myclass'; + $output = '' . $variables['name'] . $variables['extra'] . ''; } return $output; } @@ -1992,11 +1982,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; @@ -2010,9 +2000,9 @@ function theme_progress_bar($percent, $m * @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; @@ -2128,7 +2118,7 @@ function template_preprocess_html(&$vari else { $variables['classes_array'][] = 'no-sidebars'; } - + // Populate the body classes. if ($suggestions = template_page_suggestions(arg(), 'page')) { foreach ($suggestions as $suggestion) { @@ -2172,7 +2162,7 @@ function template_preprocess_html(&$vari } } $variables['head_title'] = implode(' | ', $head_title); - + // Populate the page template suggestions. if ($suggestions = template_page_suggestions(arg(), 'html')) { $variables['template_files'] = $suggestions; @@ -2217,7 +2207,7 @@ function template_preprocess_page(&$vari $variables['base_path'] = base_path(); $variables['front_page'] = url(); - $variables['breadcrumb'] = theme('breadcrumb', drupal_get_breadcrumb()); + $variables['breadcrumb'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())); $variables['feed_icons'] = drupal_get_feeds(); $variables['language'] = $GLOBALS['language']; $variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr'; Index: includes/theme.maintenance.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v retrieving revision 1.41 diff -u -p -r1.41 theme.maintenance.inc --- includes/theme.maintenance.inc 30 Sep 2009 18:36:01 -0000 1.41 +++ includes/theme.maintenance.inc 6 Oct 2009 18:23:21 -0000 @@ -85,7 +85,10 @@ function _theme_load_offline_registry($t * * @ingroup themeable */ -function theme_task_list($items, $active = NULL) { +function theme_task_list($variables) { + $items = $variables['items']; + $active = $variables['active']; + $done = isset($items[$active]) || $active == NULL; $output = '

    Installation tasks

    '; $output .= '
      '; @@ -118,11 +121,9 @@ function theme_task_list($items, $active * @param $content * The page content to show. */ -function theme_install_page($content) { +function theme_install_page($variables) { drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); - // Assign content. - $variables['content'] = $content; // Delay setting the message variable so it can be processed below. $variables['show_messages'] = FALSE; // Variable processors invoked manually since this function and theme_update_page() @@ -136,7 +137,7 @@ function theme_install_page($content) { if (isset($messages['error'])) { $title = count($messages['error']) > 1 ? st('The following errors must be resolved before you can continue the installation process') : st('The following error must be resolved before you can continue the installation process'); $variables['messages'] .= '

      ' . $title . ':

      '; - $variables['messages'] .= theme('status_messages', 'error'); + $variables['messages'] .= theme('status_messages', array('display' => 'error')); $variables['content'] .= '

      ' . st('Please check the error messages and try again.', array('!url' => request_uri())) . '

      '; } @@ -144,14 +145,14 @@ function theme_install_page($content) { if (isset($messages['warning'])) { $title = count($messages['warning']) > 1 ? st('The following installation warnings should be carefully reviewed') : st('The following installation warning should be carefully reviewed'); $variables['messages'] .= '

      ' . $title . ':

      '; - $variables['messages'] .= theme('status_messages', 'warning'); + $variables['messages'] .= theme('status_messages', array('display' => 'warning')); } // Special handling of status messages if (isset($messages['status'])) { $title = count($messages['status']) > 1 ? st('The following installation warnings should be carefully reviewed, but in most cases may be safely ignored') : st('The following installation warning should be carefully reviewed, but in most cases may be safely ignored'); $variables['messages'] .= '

      ' . $title . ':

      '; - $variables['messages'] .= theme('status_messages', 'status'); + $variables['messages'] .= theme('status_messages', array('display' => 'status')); } // This was called as a theme hook (not template), so we need to @@ -174,13 +175,10 @@ function theme_install_page($content) { * Whether to output status and error messages. * FALSE can be useful to postpone the messages to a subsequent page. */ -function theme_update_page($content, $show_messages = TRUE) { +function theme_update_page($variables) { // Set required headers. drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); - // Assign content and show message flag. - $variables['content'] = $content; - $variables['show_messages'] = $show_messages; // Variable processors invoked manually since this function and theme_install_page() // are exceptions in how it works within the theme system. template_preprocess($variables, 'update_page'); @@ -192,7 +190,7 @@ function theme_update_page($content, $sh if (isset($messages['warning'])) { $title = count($messages['warning']) > 1 ? 'The following update warnings should be carefully reviewed before continuing' : 'The following update warning should be carefully reviewed before continuing'; $variables['messages'] .= '

      ' . $title . ':

      '; - $variables['messages'] .= theme('status_messages', 'warning'); + $variables['messages'] .= theme('status_messages', array('display' => 'warning')); } // This was called as a theme hook (not template), so we need to Index: modules/aggregator/aggregator.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.admin.inc,v retrieving revision 1.43 diff -u -p -r1.43 aggregator.admin.inc --- modules/aggregator/aggregator.admin.inc 18 Sep 2009 00:12:45 -0000 1.43 +++ modules/aggregator/aggregator.admin.inc 6 Oct 2009 18:23:21 -0000 @@ -32,7 +32,7 @@ function aggregator_view() { if (empty($rows)) { $rows[] = array(array('data' => t('No feeds available. Add feed.', array('@link' => url('admin/content/aggregator/add/feed'))), 'colspan' => '5', 'class' => array('message'))); } - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); $result = db_query('SELECT c.cid, c.title, COUNT(ci.iid) as items FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid GROUP BY c.cid, c.title ORDER BY title'); @@ -46,7 +46,7 @@ function aggregator_view() { if (empty($rows)) { $rows[] = array(array('data' => t('No categories available. Add category.', array('@link' => url('admin/config/services/aggregator/add/category'))), 'colspan' => '5', 'class' => array('message'))); } - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); return $output; } Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.424 diff -u -p -r1.424 aggregator.module --- modules/aggregator/aggregator.module 25 Sep 2009 15:20:12 -0000 1.424 +++ modules/aggregator/aggregator.module 6 Oct 2009 18:23:21 -0000 @@ -390,7 +390,7 @@ function aggregator_block_view($delta = if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) { $block['subject'] = check_plain($feed->title); $result = db_query_range("SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC", 0, $feed->block, array(':fid' => $id)); - $read_more = theme('more_link', url('aggregator/sources/' . $feed->fid), t("View this feed's recent news.")); + $read_more = theme('more_link', array('url' => url('aggregator/sources/' . $feed->fid), 'title' => t("View this feed's recent news."))); } break; @@ -398,18 +398,18 @@ function aggregator_block_view($delta = if ($category = db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchObject()) { $block['subject'] = check_plain($category->title); $result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = :cid ORDER BY i.timestamp DESC, i.iid DESC', 0, $category->block, array(':cid' => $category->cid)); - $read_more = theme('more_link', url('aggregator/categories/' . $category->cid), t("View this category's recent news.")); + $read_more = theme('more_link', array('url' => url('aggregator/categories/' . $category->cid), 'title' => t("View this category's recent news."))); } break; } $items = array(); foreach ($result as $item) { - $items[] = theme('aggregator_block_item', $item); + $items[] = theme('aggregator_block_item', array('item' => $item)); } // Only display the block if there are items to show. if (count($items) > 0) { - $block['content'] = theme('item_list', $items) . $read_more; + $block['content'] = theme('item_list', array('items' => $items)) . $read_more; } return $block; } @@ -650,11 +650,9 @@ function aggregator_category_load($cid) * The item HTML. * @ingroup themeable */ -function theme_aggregator_block_item($item, $feed = 0) { - +function theme_aggregator_block_item($variables) { // Display the external link to the item. - return '' . check_plain($item->title) . "\n"; - + return '' . check_plain($variables['item']->title) . "\n"; } /** Index: modules/aggregator/aggregator.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.pages.inc,v retrieving revision 1.36 diff -u -p -r1.36 aggregator.pages.inc --- modules/aggregator/aggregator.pages.inc 30 Sep 2009 18:36:02 -0000 1.36 +++ modules/aggregator/aggregator.pages.inc 6 Oct 2009 18:23:21 -0000 @@ -37,7 +37,7 @@ function aggregator_page_source($arg1, $ // $arg1 is $form_state and $arg2 is $feed. Otherwise, $arg1 is $feed. $feed = is_object($arg2) ? $arg2 : $arg1; drupal_set_title($feed->title); - $feed_source = theme('aggregator_feed_source', $feed); + $feed_source = theme('aggregator_feed_source', array('feed' => $feed)); // It is safe to include the fid in the query because it's loaded from the // database by aggregator_feed_load. @@ -128,9 +128,9 @@ function _aggregator_page_list($items, $ // Assemble themed output. $output = $feed_source; foreach ($items as $item) { - $output .= theme('aggregator_item', $item); + $output .= theme('aggregator_item', array('item' => $item)); } - $output = theme('aggregator_wrapper', $output); + $output = theme('aggregator_wrapper', array('content' => $output)); } return $output; @@ -163,7 +163,7 @@ function aggregator_categorize_items($it '#tree' => TRUE, ); foreach ($items as $item) { - $form['items'][$item->iid] = array('#markup' => theme('aggregator_item', $item)); + $form['items'][$item->iid] = array('#markup' => theme('aggregator_item', array('item' => $item))); $form['categories'][$item->iid] = array(); $categories_result = db_query('SELECT c.cid, c.title, ci.iid FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid AND ci.iid = :iid', array(':iid' => $item->iid)); $selected = array(); @@ -235,7 +235,9 @@ function aggregator_categorize_items_sub * The output HTML. * @ingroup themeable */ -function theme_aggregator_categorize_items($form) { +function theme_aggregator_categorize_items($variables) { + $form = $variables['form']; + $output = drupal_render($form['feed_source']); $rows = array(); if (!empty($form['items'])) { @@ -246,11 +248,11 @@ function theme_aggregator_categorize_ite ); } } - $output .= theme('table', array('', t('Categorize')), $rows); + $output .= theme('table', array('header' => array('', t('Categorize')), 'rows' => $rows)); $output .= drupal_render($form['submit']); $output .= drupal_render_children($form); - return theme('aggregator_wrapper', $output); + return theme('aggregator_wrapper', array('content' => $output)); } /** @@ -259,7 +261,7 @@ function theme_aggregator_categorize_ite * @see aggregator-wrapper.tpl.php */ function template_preprocess_aggregator_wrapper(&$variables) { - $variables['pager'] = theme('pager', NULL); + $variables['pager'] = theme('pager', array('tags' => NULL)); } /** @@ -306,15 +308,15 @@ function aggregator_page_sources() { if (variable_get('aggregator_summary_items', 3)) { $items = db_query_range('SELECT i.title, i.timestamp, i.link FROM {aggregator_item} i WHERE i.fid = :fid ORDER BY i.timestamp DESC', 0, variable_get('aggregator_summary_items', 3), array(':fid' => $feed->fid)); foreach ($items as $item) { - $summary_items[] = theme('aggregator_summary_item', $item); + $summary_items[] = theme('aggregator_summary_item', array('item' => $item)); } } $feed->url = url('aggregator/sources/' . $feed->fid); - $output .= theme('aggregator_summary_items', $summary_items, $feed); + $output .= theme('aggregator_summary_items', array('summary_items' => $summary_items, 'source' => $feed)); } - $output .= theme('feed_icon', url('aggregator/opml'), t('OPML feed')); + $output .= theme('feed_icon', array('url' => url('aggregator/opml'), 'title' => t('OPML feed'))); - return theme('aggregator_wrapper', $output); + return theme('aggregator_wrapper', array('content' => $output)); } /** @@ -329,14 +331,14 @@ function aggregator_page_categories() { $summary_items = array(); $items = db_query_range('SELECT i.title, i.timestamp, i.link, f.title as feed_title, f.link as feed_link FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON i.iid = ci.iid LEFT JOIN {aggregator_feed} f ON i.fid = f.fid WHERE ci.cid = :cid ORDER BY i.timestamp DESC', 0, variable_get('aggregator_summary_items', 3), array(':cid' => $category->cid)); foreach ($items as $item) { - $summary_items[] = theme('aggregator_summary_item', $item); + $summary_items[] = theme('aggregator_summary_item', array('item' => $item)); } } $category->url = url('aggregator/categories/' . $category->cid); - $output .= theme('aggregator_summary_items', $summary_items, $category); + $output .= theme('aggregator_summary_items', array('summary_items' => $summary_items, 'source' => $category)); } - return theme('aggregator_wrapper', $output); + return theme('aggregator_wrapper', array('content' => $output)); } /** @@ -356,7 +358,7 @@ function aggregator_page_rss() { } $feeds = $result->fetchAll(); - return theme('aggregator_page_rss', $feeds, $category); + return theme('aggregator_page_rss', array('feeds' => $feeds, 'category' => $category)); } /** @@ -368,7 +370,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) { + $feeds = $variables['feeds']; + $category = $variables['category']; + drupal_add_http_header('Content-Type', 'application/rss+xml; charset=utf-8'); $items = ''; @@ -418,7 +423,7 @@ function aggregator_page_opml($cid = NUL } $feeds = $result->fetchAll(); - return theme('aggregator_page_opml', $feeds); + return theme('aggregator_page_opml', array('feeds' => $feeds)); } /** @@ -428,7 +433,9 @@ function aggregator_page_opml($cid = NUL * An array of the feeds to theme. * @ingroup themeable */ -function theme_aggregator_page_opml($feeds) { +function theme_aggregator_page_opml($variables) { + $feeds = $variables['feeds']; + drupal_add_http_header('Content-Type', 'text/xml; charset=utf-8'); $output = "\n"; @@ -454,7 +461,7 @@ function theme_aggregator_page_opml($fee */ function template_preprocess_aggregator_summary_items(&$variables) { $variables['title'] = check_plain($variables['source']->title); - $variables['summary_list'] = theme('item_list', $variables['summary_items']); + $variables['summary_list'] = theme('item_list', array('items' => $variables['summary_items'])); $variables['source_url'] = $variables['source']->url; } @@ -486,7 +493,7 @@ function template_preprocess_aggregator_ function template_preprocess_aggregator_feed_source(&$variables) { $feed = $variables['feed']; - $variables['source_icon'] = theme('feed_icon', $feed->url, t('!title feed', array('!title' => $feed->title))); + $variables['source_icon'] = theme('feed_icon', array('url' => $feed->url, 'title' => t('!title feed', array('!title' => $feed->title)))); $variables['source_image'] = $feed->image; $variables['source_description'] = aggregator_filter_xss($feed->description); $variables['source_url'] = check_url(url($feed->link, array('absolute' => TRUE))); Index: modules/aggregator/aggregator.parser.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.parser.inc,v retrieving revision 1.4 diff -u -p -r1.4 aggregator.parser.inc --- modules/aggregator/aggregator.parser.inc 15 Jul 2009 21:32:43 -0000 1.4 +++ modules/aggregator/aggregator.parser.inc 6 Oct 2009 18:23:21 -0000 @@ -37,7 +37,7 @@ function aggregator_aggregator_parse($fe } if (!empty($image['link']) && !empty($image['url']) && !empty($image['title'])) { - $image = l(theme('image', $image['url'], $image['title']), $image['link'], array('html' => TRUE)); + $image = l(theme('image', array('path' => $image['url'], 'alt' => $image['title'])), $image['link'], array('html' => TRUE)); } else { $image = ''; @@ -168,7 +168,7 @@ function aggregator_parse_feed(&$data, $ if (empty($item['author']) && !empty($item['dc:creator'])) { $item['author'] = $item['dc:creator']; } - + $item += array('author' => '', 'description' => ''); // Store on $feed object. This is where processors will look for parsed items. Index: modules/blog/blog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v retrieving revision 1.335 diff -u -p -r1.335 blog.module --- modules/blog/blog.module 29 Aug 2009 05:46:02 -0000 1.335 +++ modules/blog/blog.module 6 Oct 2009 18:23:21 -0000 @@ -177,7 +177,7 @@ function blog_block_view($delta = '') { if ($node_title_list = node_title_list($result)) { $block['content'] = $node_title_list; - $block['content'] .= theme('more_link', url('blog'), t('Read the latest blog entries.')); + $block['content'] .= theme('more_link', array('url' => url('blog'), 'title' => t('Read the latest blog entries.'))); $block['subject'] = t('Recent blog posts'); return $block; } Index: modules/blog/blog.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/blog/blog.pages.inc,v retrieving revision 1.22 diff -u -p -r1.22 blog.pages.inc --- modules/blog/blog.pages.inc 10 Aug 2009 22:39:24 -0000 1.22 +++ modules/blog/blog.pages.inc 6 Oct 2009 18:23:21 -0000 @@ -55,7 +55,7 @@ function blog_page_user($account) { drupal_set_message(t('You have not created any blog entries.')); } else { - drupal_set_message(t('!author has not created any blog entries.', array('!author' => theme('username', $account)))); + drupal_set_message(t('!author has not created any blog entries.', array('!author' => theme('username', array('account' => $account))))); } } drupal_add_feed(url('blog/' . $account->uid . '/feed'), t('RSS - !title', array('!title' => $title))); Index: modules/book/book.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.admin.inc,v retrieving revision 1.22 diff -u -p -r1.22 book.admin.inc --- modules/book/book.admin.inc 18 Sep 2009 00:12:45 -0000 1.22 +++ modules/book/book.admin.inc 6 Oct 2009 18:23:21 -0000 @@ -24,7 +24,7 @@ function book_admin_overview() { $rows[] = array(array('data' => t('No books available.'), 'colspan' => 2)); } - return theme('table', $headers, $rows); + return theme('table', array('header' => $headers, 'rows' => $rows)); } /** @@ -221,7 +221,9 @@ function _book_admin_table_tree($tree, & * @ingroup themeable * @see book_admin_table() */ -function theme_book_admin_table($form) { +function theme_book_admin_table($variables) { + $form = $variables['form']; + 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'); @@ -240,7 +242,7 @@ function theme_book_admin_table($form) { $form[$key]['weight']['#attributes']['class'] = array('book-weight'); $data = array( - theme('indentation', $form[$key]['depth']['#value'] - 2) . drupal_render($form[$key]['title']), + theme('indentation', array('size' => $form[$key]['depth']['#value'] - 2)) . drupal_render($form[$key]['title']), drupal_render($form[$key]['weight']), drupal_render($form[$key]['plid']) . drupal_render($form[$key]['mlid']), l(t('view'), $href), @@ -255,6 +257,6 @@ function theme_book_admin_table($form) { $rows[] = $row; } - return theme('table', $header, $rows, array('id' => 'book-outline')); + return theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'book-outline'))); } Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.516 diff -u -p -r1.516 book.module --- modules/book/book.module 29 Sep 2009 15:31:14 -0000 1.516 +++ modules/book/book.module 6 Oct 2009 18:23:21 -0000 @@ -264,7 +264,7 @@ function book_block_view($delta = '') { $tree = menu_tree_all_data($node->book['menu_name'], $node->book); // There should only be one element at the top level. $data = array_shift($tree); - $block['subject'] = theme('book_title_link', $data['link']); + $block['subject'] = theme('book_title_link', array('link' => $data['link'])); $block['content'] = ($data['below']) ? menu_tree_output($data['below']) : ''; } } @@ -305,7 +305,9 @@ function book_block_save($delta = '', $e * * @ingroup themeable */ -function theme_book_title_link($link) { +function theme_book_title_link($variables) { + $link = $variables['link']; + $link['options']['attributes']['class'] = array('book-title'); return l($link['title'], $link['href'], $link['options']); @@ -737,7 +739,7 @@ function book_node_view($node, $build_mo if ($build_mode == 'full') { if (!empty($node->book['bid']) && empty($node->in_preview)) { $node->content['book_navigation'] = array( - '#markup' => theme('book_navigation', $node->book), + '#markup' => theme('book_navigation', array('book_link' => $node->book)), '#weight' => 100, ); } @@ -1087,7 +1089,7 @@ function book_node_export($node, $childr node_build_content($node, 'print'); $node->rendered = drupal_render($node->content); - return theme('book_node_export_html', $node, $children); + return theme('book_node_export_html', array('node' => $node, 'children' => $children)); } /** Index: modules/book/book.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.pages.inc,v retrieving revision 1.16 diff -u -p -r1.16 book.pages.inc --- modules/book/book.pages.inc 18 Sep 2009 00:12:45 -0000 1.16 +++ modules/book/book.pages.inc 6 Oct 2009 18:23:21 -0000 @@ -15,7 +15,7 @@ function book_render() { $book_list[] = l($book['title'], $book['href'], $book['options']); } - return theme('item_list', $book_list); + return theme('item_list', array('items' => $book_list)); } /** @@ -79,7 +79,7 @@ function book_export_html($nid) { $contents = book_export_traverse($tree, 'book_node_export'); } - return theme('book_export_html', $node->title, $contents, $node->book['depth']); + return theme('book_export_html', array('title' => $node->title, 'contents' => $contents, 'depth' => $node->book['depth'])); } else { drupal_access_denied(); Index: modules/color/color.module =================================================================== RCS file: /cvs/drupal/drupal/modules/color/color.module,v retrieving revision 1.72 diff -u -p -r1.72 color.module --- modules/color/color.module 18 Sep 2009 00:12:45 -0000 1.72 +++ modules/color/color.module 6 Oct 2009 18:23:21 -0000 @@ -60,7 +60,7 @@ function _color_theme_select_form_alter( foreach (element_children($form) as $theme) { if ($screenshot = variable_get('color_' . $theme . '_screenshot')) { if (isset($form[$theme]['screenshot'])) { - $form[$theme]['screenshot']['#markup'] = theme('image', $screenshot, '', '', array('class' => array('screenshot')), FALSE); + $form[$theme]['screenshot']['#markup'] = theme('image', array('path' => $screenshot, 'alt' => '', 'title' => '', 'attributes' => array('class' => array('screenshot')), 'getsize' => FALSE)); } } } @@ -207,7 +207,9 @@ function color_scheme_form($form, &$form * * @ingroup themeable */ -function theme_color_scheme_form($form) { +function theme_color_scheme_form($variables) { + $form = $variables['form']; + $theme = $form['theme']['#value']; $info = $form['info']['#value']; $path = drupal_get_path('theme', $theme) . '/'; Index: modules/comment/comment.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.admin.inc,v retrieving revision 1.32 diff -u -p -r1.32 comment.admin.inc --- modules/comment/comment.admin.inc 18 Sep 2009 00:12:45 -0000 1.32 +++ modules/comment/comment.admin.inc 6 Oct 2009 18:23:21 -0000 @@ -87,7 +87,7 @@ function comment_admin_overview($form, & foreach ($result as $comment) { $options[$comment->cid] = array( 'subject' => l($comment->subject, 'comment/' . $comment->cid, array('attributes' => array('title' => truncate_utf8($comment->comment, 128)), 'fragment' => 'comment-' . $comment->cid)), - 'author' => theme('username', $comment), + 'author' => theme('username', array('account' => $comment)), 'posted_in' => l($comment->node_title, 'node/' . $comment->nid), 'time' => format_date($comment->timestamp, 'short'), 'operations' => l(t('edit'), 'comment/edit/' . $comment->cid, array('query' => $destination)), Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.775 diff -u -p -r1.775 comment.module --- modules/comment/comment.module 29 Sep 2009 15:31:14 -0000 1.775 +++ modules/comment/comment.module 6 Oct 2009 18:23:21 -0000 @@ -142,7 +142,7 @@ function comment_theme() { 'arguments' => array('elements' => NULL), ), 'comment_post_forbidden' => array( - 'arguments' => array('nid' => NULL), + 'arguments' => array('node' => NULL), ), 'comment_wrapper' => array( 'template' => 'comment-wrapper', @@ -466,7 +466,7 @@ function theme_comment_block() { } if ($items) { - return theme('item_list', $items); + return theme('item_list', array('items' => $items)); } } @@ -522,7 +522,7 @@ function comment_node_view($node, $build ); } else { - $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node); + $links['comment_forbidden']['title'] = theme('comment_post_forbidden', array('node' => $node)); } } } @@ -547,7 +547,7 @@ function comment_node_view($node, $build } } else { - $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node); + $links['comment_forbidden']['title'] = theme('comment_post_forbidden', array('node' => $node)); } } } @@ -901,7 +901,7 @@ function comment_links($comment, $node) ); } else { - $links['comment_forbidden']['title'] = theme('comment_post_forbidden', $node); + $links['comment_forbidden']['title'] = theme('comment_post_forbidden', array('node' => $node)); $links['comment_forbidden']['html'] = TRUE; } } @@ -1736,7 +1736,7 @@ function comment_form($form, &$form_stat $form['_author'] = array( '#type' => 'item', '#title' => t('Your name'), - '#markup' => theme('username', $user), + '#markup' => theme('username', array('account' => $user)), ); $form['author'] = array( '#type' => 'value', @@ -2093,19 +2093,19 @@ function template_preprocess_comment(&$v $node = $variables['elements']['#node']; $variables['comment'] = $comment; $variables['node'] = $node; - $variables['author'] = theme('username', $comment); + $variables['author'] = theme('username', array('account' => $comment)); $variables['date'] = format_date($comment->timestamp); $variables['new'] = !empty($comment->new) ? t('new') : ''; - $variables['picture'] = theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', $comment) : ''; + $variables['picture'] = theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', array('account' => $comment)) : ''; $variables['signature'] = $comment->signature; $variables['title'] = l($comment->subject, 'comment/' . $comment->cid, array('fragment' => "comment-$comment->cid")); $variables['template_files'][] = 'comment-' . $variables['node']->type; - + // Helpful $content variable for templates. foreach (element_children($variables['elements']) as $key) { $variables['content'][$key] = $variables['elements'][$key]; } - + // Set status to a string representation of comment->status. if (isset($comment->in_preview)) { $variables['status'] = 'comment-preview'; @@ -2141,7 +2141,8 @@ function template_preprocess_comment(&$v * The comment node. * @ingroup themeable */ -function theme_comment_post_forbidden($node) { +function theme_comment_post_forbidden($variables) { + $node = $variables['node']; global $user; if (!$user->uid) { Index: modules/contact/contact.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.admin.inc,v retrieving revision 1.16 diff -u -p -r1.16 contact.admin.inc --- modules/contact/contact.admin.inc 26 Sep 2009 00:13:18 -0000 1.16 +++ modules/contact/contact.admin.inc 6 Oct 2009 18:23:21 -0000 @@ -33,7 +33,7 @@ function contact_admin_categories() { $rows[] = array(array('data' => t('No categories available. Add category.', array('@link' => url('admin/structure/contact/add'))), 'colspan' => 5)); } - return theme('table', $header, $rows); + return theme('table', array('header' => $header, 'rows' => $rows)); } /** Index: modules/contact/contact.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/contact/contact.pages.inc,v retrieving revision 1.26 diff -u -p -r1.26 contact.pages.inc --- modules/contact/contact.pages.inc 29 Sep 2009 15:31:14 -0000 1.26 +++ modules/contact/contact.pages.inc 6 Oct 2009 18:23:21 -0000 @@ -177,11 +177,11 @@ function contact_personal_form($form, &$ $form['recipient'] = array('#type' => 'value', '#value' => $recipient); $form['from'] = array('#type' => 'item', '#title' => t('From'), - '#markup' => theme('username', $user) . ' <' . check_plain($user->mail) . '>', + '#markup' => theme('username', array('account' => $user)) . ' <' . check_plain($user->mail) . '>', ); $form['to'] = array('#type' => 'item', '#title' => t('To'), - '#markup' => theme('username', $recipient), + '#markup' => theme('username', array('account' => $recipient)), ); $form['subject'] = array('#type' => 'textfield', '#title' => t('Subject'), Index: modules/dblog/dblog.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v retrieving revision 1.30 diff -u -p -r1.30 dblog.admin.inc --- modules/dblog/dblog.admin.inc 18 Sep 2009 00:12:46 -0000 1.30 +++ modules/dblog/dblog.admin.inc 6 Oct 2009 18:23:21 -0000 @@ -16,11 +16,11 @@ function dblog_overview() { WATCHDOG_DEBUG => '', WATCHDOG_INFO => '', WATCHDOG_NOTICE => '', - WATCHDOG_WARNING => theme('image', 'misc/watchdog-warning.png', t('warning'), t('warning')), - WATCHDOG_ERROR => theme('image', 'misc/watchdog-error.png', t('error'), t('error')), - WATCHDOG_CRITICAL => theme('image', 'misc/watchdog-error.png', t('critical'), t('critical')), - WATCHDOG_ALERT => theme('image', 'misc/watchdog-error.png', t('alert'), t('alert')), - WATCHDOG_EMERG => theme('image', 'misc/watchdog-error.png', t('emergency'), t('emergency')), + WATCHDOG_WARNING => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning'))), + WATCHDOG_ERROR => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('error'), 'title' => t('error'))), + WATCHDOG_CRITICAL => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('critical'), 'title' => t('critical'))), + WATCHDOG_ALERT => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('alert'), 'title' => t('alert'))), + WATCHDOG_EMERG => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('emergency'), 'title' => t('emergency'))), ); $classes = array( WATCHDOG_DEBUG => 'dblog-debug', @@ -66,7 +66,7 @@ function dblog_overview() { t($dblog->type), format_date($dblog->timestamp, 'short'), l(truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE), 'admin/reports/event/' . $dblog->wid, array('html' => TRUE)), - theme('username', $dblog), + theme('username', array('account' => $dblog)), $dblog->link, ), // Attributes for tr @@ -152,7 +152,7 @@ function dblog_event($id) { ), array( array('data' => t('User'), 'header' => TRUE), - theme('username', $dblog), + theme('username', array('account' => $dblog)), ), array( array('data' => t('Location'), 'header' => TRUE), Index: modules/dblog/dblog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v retrieving revision 1.42 diff -u -p -r1.42 dblog.module --- modules/dblog/dblog.module 29 Aug 2009 03:36:27 -0000 1.42 +++ modules/dblog/dblog.module 6 Oct 2009 18:23:21 -0000 @@ -173,8 +173,10 @@ function dblog_form_system_logging_setti * * @ingroup themeable */ -function theme_dblog_filters($form) { +function theme_dblog_filters($variables) { + $form = $variables['form']; $output = ''; + foreach (element_children($form['status']) as $key) { $output .= drupal_render($form['status'][$key]); } Index: modules/field/field.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.api.php,v retrieving revision 1.37 diff -u -p -r1.37 field.api.php --- modules/field/field.api.php 30 Sep 2009 12:26:36 -0000 1.37 +++ modules/field/field.api.php 6 Oct 2009 18:23:21 -0000 @@ -790,9 +790,9 @@ function hook_field_formatter_info_alter * - #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) { // This relies on a 'safe' element being prepared in hook_field_sanitize(). - return $element['#item']['safe']; + return $variables['element']['#item']['safe']; } /** @@ -812,7 +812,9 @@ function theme_field_formatter_FORMATTER * - #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) { + $element = $variables['element']; + $items = array(); foreach (element_children($element) as $key) { $items[$key] = $key .':'. $element[$key]['#item']['value']; Index: modules/field/field.form.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.form.inc,v retrieving revision 1.26 diff -u -p -r1.26 field.form.inc --- modules/field/field.form.inc 29 Sep 2009 01:08:35 -0000 1.26 +++ modules/field/field.form.inc 6 Oct 2009 18:23:21 -0000 @@ -221,7 +221,8 @@ function field_multiple_value_form($fiel * 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) { + $element = $variables['element']; $output = ''; if ($element['#cardinality'] > 1 || $element['#cardinality'] == FIELD_CARDINALITY_UNLIMITED) { @@ -268,7 +269,7 @@ function theme_field_multiple_value_form } $output = '
      '; - $output .= theme('table', $header, $rows, array('id' => $table_id, 'class' => array('field-multiple-table'))); + $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => $table_id, 'class' => array('field-multiple-table')))); $output .= $element['#description'] ? '
      ' . $element['#description'] . '
      ' : ''; $output .= '
      ' . drupal_render($add_more_button) . '
      '; $output .= '
      '; Index: modules/field/modules/list/list.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/list/list.module,v retrieving revision 1.15 diff -u -p -r1.15 list.module --- modules/field/modules/list/list.module 26 Sep 2009 15:57:38 -0000 1.15 +++ modules/field/modules/list/list.module 6 Oct 2009 18:23:22 -0000 @@ -263,7 +263,8 @@ 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) { + $element = $variables['element']; $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']]; @@ -275,6 +276,7 @@ function theme_field_formatter_list_defa /** * Theme function for 'key' list field formatter. */ -function theme_field_formatter_list_key($element) { +function theme_field_formatter_list_key($variables) { + $element = $variables['element']; return $element['#item']['safe']; } Index: modules/field/modules/number/number.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/number/number.module,v retrieving revision 1.20 diff -u -p -r1.20 number.module --- modules/field/modules/number/number.module 27 Sep 2009 11:12:15 -0000 1.20 +++ modules/field/modules/number/number.module 6 Oct 2009 18:23:22 -0000 @@ -242,14 +242,16 @@ 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) { + $element = $variables['element']; return $element['#item']['value']; } /** * Proxy theme function for number field formatters. */ -function theme_field_formatter_number($element) { +function theme_field_formatter_number($variables) { + $element = $variables['element']; $field = field_info_field($element['#field_name']); $instance = field_info_instance($element['#field_name'], $element['#bundle']); $value = $element['#item']['value']; @@ -499,6 +501,7 @@ function number_decimal_validate($elemen * $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) { + $element = $variables['element']; return $element['#children']; } Index: modules/field/modules/options/options.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/options/options.module,v retrieving revision 1.10 diff -u -p -r1.10 options.module --- modules/field/modules/options/options.module 10 Sep 2009 06:31:38 -0000 1.10 +++ modules/field/modules/options/options.module 6 Oct 2009 18:23:22 -0000 @@ -21,7 +21,7 @@ function options_theme() { 'arguments' => array('element' => NULL), ), 'options_none' => array( - 'arguments' => array('widget_type' => NULL, 'field_name' => NULL, 'node_type' => NULL), + 'arguments' => array('instance' => NULL), ), ); } @@ -375,7 +375,7 @@ function options_options($field, $instan if (!$instance['required']) { if ((in_array($instance['widget']['type'], array('options_buttons', 'node_reference_buttons', 'user_reference_buttons')) && !$field['cardinality']) || (in_array($instance['widget']['type'], array('options_select', 'node_reference_select', 'user_reference_select')))) { - $options = array('' => theme('options_none', $instance)) + $options; + $options = array('' => theme('options_none', array('instance' => $instance))) + $options; } } return $options; @@ -385,7 +385,8 @@ function options_options($field, $instan * 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) { + $instance = $variables['instance']; switch ($instance['widget']['type']) { case 'options_buttons': case 'node_reference_buttons': @@ -411,14 +412,17 @@ 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) { + $element = $variables['element']; return $element['#children']; } -function theme_options_onoff($element) { +function theme_options_onoff($variables) { + $element = $variables['element']; return $element['#children']; } -function theme_options_buttons($element) { +function theme_options_buttons($variables) { + $element = $variables['element']; return $element['#children']; } \ No newline at end of file Index: modules/field/modules/text/text.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/text/text.module,v retrieving revision 1.30 diff -u -p -r1.30 text.module --- modules/field/modules/text/text.module 26 Sep 2009 15:57:38 -0000 1.30 +++ modules/field/modules/text/text.module 6 Oct 2009 18:23:22 -0000 @@ -299,21 +299,24 @@ 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) { + $element = $variables['element']; 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) { + $element = $variables['element']; 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) { + $element = $variables['element']; $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); @@ -325,7 +328,8 @@ function theme_field_formatter_text_trim * 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) { + $element = $variables['element']; $field = field_info_field($element['#field_name']); $instance = field_info_instance($element['#field_name'], $element['#bundle']); @@ -780,10 +784,12 @@ function text_field_widget_formatted_tex * $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) { + $element = $variables['element']; return $element['#children']; } -function theme_text_textarea($element) { +function theme_text_textarea($variables) { + $element = $variables['element']; return $element['#children']; } Index: modules/field_ui/field_ui.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v retrieving revision 1.21 diff -u -p -r1.21 field_ui.admin.inc --- modules/field_ui/field_ui.admin.inc 2 Oct 2009 14:39:43 -0000 1.21 +++ modules/field_ui/field_ui.admin.inc 6 Oct 2009 18:23:22 -0000 @@ -34,7 +34,7 @@ function field_ui_fields_list() { else { // Sort rows by field name. ksort($rows); - $output = theme('table', $header, $rows); + $output = theme('table', array('header' => $header, 'rows' => $rows)); } return $output; } @@ -56,7 +56,7 @@ function field_ui_inactive_message($bund '%widget_module' => $instance['widget']['module'], )); } - drupal_set_message(t('Inactive fields are not shown unless their providing modules are enabled. The following fields are not enabled: !list', array('!list' => theme('item_list', $list))), 'error'); + drupal_set_message(t('Inactive fields are not shown unless their providing modules are enabled. The following fields are not enabled: !list', array('!list' => theme('item_list', array('items' => $list)))), 'error'); } } @@ -832,7 +832,7 @@ function field_ui_field_settings_form($f '#options' => array(TRUE => t('Translatable field'), FALSE => t('Language neutral field')), '#default_value' => $field['translatable'], '#description' => t("Translatable fields can have a different value for each available language. An example of a translatable field is an article's body. Language neutral fields will retain the same value across all translations. An example of a language neutral field is a user profile's first name."), - ); + ); // Add settings provided by the field module. The field module is // responsible for not returning settings that cannot be changed if Index: modules/file/file.field.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/file/file.field.inc,v retrieving revision 1.4 diff -u -p -r1.4 file.field.inc --- modules/file/file.field.inc 26 Sep 2009 15:57:38 -0000 1.4 +++ modules/file/file.field.inc 6 Oct 2009 18:23:22 -0000 @@ -523,7 +523,7 @@ function file_field_widget(&$form, &$for // If there's only one field, return it as delta 0. $element['#title'] = $instance['label']; if (empty($element['#default_value']['fid'])) { - $element['#description'] = theme('file_upload_help', $instance['description'], $element['#upload_validators']); + $element['#description'] = theme('file_upload_help', array('description' => $instance['description'], 'upload_validators' => $element['#upload_validators'])); } $elements = array($element); } @@ -557,7 +557,7 @@ function file_field_widget(&$form, &$for // field. These are added here so that they may be referenced easily through // a hook_form_alter(). $elements['#file_upload_title'] = t('Add a new file'); - $elements['#file_upload_description'] = theme('file_upload_help', '', $elements[0]['#upload_validators']); + $elements['#file_upload_description'] = theme('file_upload_help', array('description' => '', 'upload_validators' => $elements[0]['#upload_validators'])); } return $elements; @@ -746,8 +746,10 @@ function file_field_widget_process_multi /** * Theme an individual file upload widget. */ -function theme_file_widget($element) { +function theme_file_widget($variables) { + $element = $variables['element']; $output = ''; + // The "form-managed-file" class is required for proper AJAX functionality. $output .= '
      '; if ($element['fid']['#value'] != 0) { @@ -763,7 +765,9 @@ function theme_file_widget($element) { /** * Theme a group of file upload widgets. */ -function theme_file_widget_multiple($element) { +function theme_file_widget_multiple($variables) { + $element = $variables['element']; + $field = field_info_field($element['#field_name']); // Get our list of widgets in order. @@ -840,7 +844,7 @@ function theme_file_widget_multiple($ele drupal_add_tabledrag($table_id, 'order', 'sibling', $weight_class); $output = ''; - $output = empty($rows) ? '' : theme('table', $headers, $rows, array('id' => $table_id)); + $output = empty($rows) ? '' : theme('table', array('header' => $headers, 'rows' => $rows, 'attributes' => array('id' => $table_id))); $output .= drupal_render_children($element); return $output; } @@ -855,7 +859,10 @@ function theme_file_widget_multiple($ele * @return * A string suitable for a file field description. */ -function theme_file_upload_help($description, $upload_validators) { +function theme_file_upload_help($variables) { + $description = $variables['description']; + $upload_validators = $variables['upload_validators']; + $descriptions = array(); if (strlen($description)) { @@ -890,29 +897,33 @@ function theme_file_upload_help($descrip /** * Theme function for 'default' file field formatter. */ -function theme_field_formatter_file_default($element) { - return theme('file_link', (object) $element['#item']); +function theme_field_formatter_file_default($variables) { + $element = $variables['element']; + return theme('file_link', array('file' => (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) { + $element = $variables['element']; 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) { + $element = $variables['element']; + $header = array(t('Attachment'), t('Size')); $rows = array(); foreach (element_children($element) as $key) { $rows[] = array( - theme('file_link', (object) $element[$key]['#item']), + theme('file_link', array('file' => (object) $element[$key]['#item'])), format_size($element[$key]['#item']['filesize']), ); } - return empty($rows) ? '' : theme('table', $header, $rows); + return empty($rows) ? '' : theme('table', array('header' => $header, 'rows' => $rows)); } Index: modules/file/file.module =================================================================== RCS file: /cvs/drupal/drupal/modules/file/file.module,v retrieving revision 1.4 diff -u -p -r1.4 file.module --- modules/file/file.module 10 Sep 2009 06:31:39 -0000 1.4 +++ modules/file/file.module 6 Oct 2009 18:23:22 -0000 @@ -80,7 +80,7 @@ function file_theme() { 'arguments' => array('element' => NULL), ), 'file_upload_help' => array( - 'arguments' => array('upload_validators' => NULL), + 'arguments' => array('description' => NULL, 'upload_validators' => NULL), ), ); } @@ -413,7 +413,7 @@ function file_managed_file_process($elem if ($fid && $element['#file']) { $element['filename'] = array( '#type' => 'markup', - '#markup' => theme('file_link', $element['#file']) . ' ', + '#markup' => theme('file_link', array('file' => $element['#file'])) . ' ', '#weight' => -10, ); } @@ -577,7 +577,9 @@ function file_managed_file_save_upload($ /** * Theme a managed file element. */ -function theme_file_managed_file($element) { +function theme_file_managed_file($variables) { + $element = $variables['element']; + // This wrapper is required to apply JS behaviors and CSS styling. $output = ''; $output .= '
      '; @@ -592,9 +594,11 @@ function theme_file_managed_file($elemen * @param $file * A file object to which the link will be created. */ -function theme_file_link($file) { +function theme_file_link($variables) { + $file = $variables['file']; + $url = file_create_url($file->uri); - $icon = theme('file_icon', $file); + $icon = theme('file_icon', array('file' => $file)); // Set options as per anchor format described at // http://microformats.org/wiki/file-format-examples @@ -622,7 +626,9 @@ 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) { + $file = $variables['file']; + $mime = check_plain($file->filemime); $icon_url = file_icon_url($file); return ''; Index: modules/file/tests/file.test =================================================================== RCS file: /cvs/drupal/drupal/modules/file/tests/file.test,v retrieving revision 1.2 diff -u -p -r1.2 file.test --- modules/file/tests/file.test 20 Sep 2009 17:40:41 -0000 1.2 +++ modules/file/tests/file.test 6 Oct 2009 18:23:22 -0000 @@ -304,7 +304,7 @@ class FileFieldDisplayTestCase extends F // Check that the default formatter is displaying with the file name. $node = node_load($nid, NULL, TRUE); $node_file = (object) $node->{$field_name}[FIELD_LANGUAGE_NONE][0]; - $default_output = theme('file_link', $node_file); + $default_output = theme('file_link', array('file' => $node_file)); $this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.')); // Turn the "display" option off and check that the file is no longer displayed. @@ -531,7 +531,7 @@ class FileFieldPathTestCase extends File /** * A loose assertion to check that a file is uploaded to the right location. - * + * * @param $expected_path * The location where the file is expected to be uploaded. Duplicate file * names to not need to be taken into account. Index: modules/filter/filter.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v retrieving revision 1.47 diff -u -p -r1.47 filter.admin.inc --- modules/filter/filter.admin.inc 25 Sep 2009 14:06:09 -0000 1.47 +++ modules/filter/filter.admin.inc 6 Oct 2009 18:23:22 -0000 @@ -23,8 +23,8 @@ function filter_admin_overview($form) { // to all roles and cannot be deleted via the admin interface. $form['formats'][$id]['#is_fallback'] = ($id == $fallback_format); if ($form['formats'][$id]['#is_fallback']) { - $form['formats'][$id]['name'] = array('#markup' => theme('placeholder', $format->name)); - $roles_markup = theme('placeholder', t('All roles may use this format')); + $form['formats'][$id]['name'] = array('#markup' => theme('placeholder', array('text' => $format->name))); + $roles_markup = theme('placeholder', array('text' => t('All roles may use this format'))); } else { $form['formats'][$id]['name'] = array('#markup' => check_plain($format->name)); @@ -59,7 +59,9 @@ function filter_admin_overview_submit($f * * @ingroup themeable */ -function theme_filter_admin_overview($form) { +function theme_filter_admin_overview($variables) { + $form = $variables['form']; + $rows = array(); foreach (element_children($form['formats']) as $id) { $form['formats'][$id]['weight']['#attributes']['class'] = array('text-format-order-weight'); @@ -75,7 +77,7 @@ function theme_filter_admin_overview($fo ); } $header = array(t('Name'), t('Roles'), t('Weight'), array('data' => t('Operations'), 'colspan' => 2)); - $output = theme('table', $header, $rows, array('id' => 'text-format-order')); + $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'text-format-order'))); $output .= drupal_render_children($form); drupal_add_tabledrag('text-format-order', 'order', 'sibling', 'text-format-order-weight'); @@ -153,7 +155,7 @@ function filter_admin_format_form($form, // Composition tips (guidelines) $tips = _filter_tips($format->format, FALSE); - $tiplist = theme('filter_tips', $tips, FALSE); + $tiplist = theme('filter_tips', array('tips' => $tips, 'long' => FALSE)); if (!$tiplist) { $tiplist = '

      ' . t('No guidelines available.') . '

      '; } @@ -342,7 +344,9 @@ function filter_admin_order($form, &$for * * @ingroup themeable */ -function theme_filter_admin_order($form) { +function theme_filter_admin_order($variables) { + $form = $variables['form']; + $header = array(t('Name'), t('Weight')); $rows = array(); foreach (element_children($form['names']) as $id) { @@ -356,7 +360,7 @@ function theme_filter_admin_order($form) } } - $output = theme('table', $header, $rows, array('id' => 'filter-order')); + $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'filter-order'))); $output .= drupal_render_children($form); drupal_add_tabledrag('filter-order', 'order', 'sibling', 'filter-order-weight', NULL, NULL, FALSE); Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.293 diff -u -p -r1.293 filter.module --- modules/filter/filter.module 5 Oct 2009 01:18:25 -0000 1.293 +++ modules/filter/filter.module 6 Oct 2009 18:23:22 -0000 @@ -265,7 +265,7 @@ function filter_permission() { if (!empty($permission)) { // Only link to the text format configuration page if the user who is // viewing this will have access to that page. - $format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/' . $format->format) : theme('placeholder', $format->name); + $format_name_replacement = user_access('administer filters') ? l($format->name, 'admin/config/content/formats/' . $format->format) : theme('placeholder', array('text' => $format->name)); $perms[$permission] = array( 'title' => t("Use the %text_format text format", array('%text_format' => $format->name)), 'description' => t('Use !text_format in forms when entering or editing content. %warning', array('!text_format' => $format_name_replacement, '%warning' => t('Warning: This permission may have security implications depending on how the text format is configured.'))), @@ -371,7 +371,7 @@ function _filter_html_tips($filter, $for ); } } - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); $output .= '

      ' . t('Most unusual characters can be directly entered without any problems.') . '

      '; $output .= '

      ' . t('If you do encounter problems, try using HTML character entities. A common example looks like &amp; for an ampersand & character. For a full list of entities see HTML\'s entities page. Some of the available characters include:', array('@html-entities' => 'http://www.w3.org/TR/html4/sgml/entities.html')) . '

      '; @@ -391,7 +391,7 @@ function _filter_html_tips($filter, $for array('data' => $entity[1], 'class' => array('get')) ); } - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); return $output; } @@ -761,7 +761,7 @@ function filter_form($selected_format = foreach ($formats as $format) { $options[$format->format] = $format->name; $form['format_guidelines'][$format->format] = array( - '#markup' => theme('filter_guidelines', $format), + '#markup' => theme('filter_guidelines', array('format' => $format)), ); } $form['format'] = array( @@ -906,9 +906,11 @@ function theme_filter_tips_more_info() { * * @ingroup themeable */ -function theme_filter_guidelines($format) { +function theme_filter_guidelines($variables) { + $format = $variables['format']; + $name = isset($format->name) ? '' : ''; - return '
      ' . $name . theme('filter_tips', _filter_tips($format->format, FALSE)) . '
      '; + return '
      ' . $name . theme('filter_tips', array('tips' => _filter_tips($format->format, FALSE))) . '
      '; } /** Index: modules/filter/filter.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.pages.inc,v retrieving revision 1.7 diff -u -p -r1.7 filter.pages.inc --- modules/filter/filter.pages.inc 8 Mar 2009 21:25:18 -0000 1.7 +++ modules/filter/filter.pages.inc 6 Oct 2009 18:23:22 -0000 @@ -13,10 +13,10 @@ function filter_tips_long() { $format = arg(2); if ($format) { - $output = theme('filter_tips', _filter_tips($format, TRUE), TRUE); + $output = theme('filter_tips', array('tips' => _filter_tips($format, TRUE), 'long' => TRUE)); } else { - $output = theme('filter_tips', _filter_tips(-1, TRUE), TRUE); + $output = theme('filter_tips', array('tips' => _filter_tips(-1, TRUE), 'long' => TRUE)); } return $output; } @@ -48,7 +48,9 @@ function filter_tips_long() { * @see _filter_tips() * @ingroup themeable */ -function theme_filter_tips($tips, $long = FALSE) { +function theme_filter_tips($variables) { + $tips = $variables['tips']; + $long = $variables['long']; $output = ''; $multiple = count($tips) > 1; Index: modules/forum/forum-icon.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum-icon.tpl.php,v retrieving revision 1.5 diff -u -p -r1.5 forum-icon.tpl.php --- modules/forum/forum-icon.tpl.php 8 Mar 2009 20:58:19 -0000 1.5 +++ modules/forum/forum-icon.tpl.php 6 Oct 2009 18:23:22 -0000 @@ -18,7 +18,7 @@ - + "misc/forum-$icon.png")) ?> Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.519 diff -u -p -r1.519 forum.module --- modules/forum/forum.module 18 Sep 2009 00:04:22 -0000 1.519 +++ modules/forum/forum.module 6 Oct 2009 18:23:22 -0000 @@ -568,7 +568,7 @@ function forum_block_view_pre_render($el $result = $elements['#query']->execute(); if ($node_title_list = node_title_list($result)) { $elements['forum_list'] = array('#markup' => $node_title_list); - $elements['forum_more'] = array('#markup' => theme('more_link', url('forum'), t('Read the latest forum topics.'))); + $elements['forum_more'] = array('#markup' => theme('more_link', array('url' => url('forum'), 'title' => t('Read the latest forum topics.')))); } return $elements; } @@ -843,14 +843,14 @@ function template_preprocess_forums(&$va $variables['links'] = $forum_types; if (!empty($variables['forums'])) { - $variables['forums'] = theme('forum_list', $variables['forums'], $variables['parents'], $variables['tid']); + $variables['forums'] = theme('forum_list', $variables); } else { $variables['forums'] = ''; } if ($variables['tid'] && !in_array($variables['tid'], variable_get('forum_containers', array()))) { - $variables['topics'] = theme('forum_topic_list', $variables['tid'], $variables['topics'], $variables['sortby'], $variables['forum_per_page']); + $variables['topics'] = theme('forum_topic_list', $variables); drupal_add_feed(url('taxonomy/term/' . $variables['tid'] . '/0/feed'), 'RSS - ' . $title); } else { @@ -917,7 +917,7 @@ function template_preprocess_forum_list( } $variables['forums'][$id]->old_topics = $forum->num_topics - $variables['forums'][$id]->new_topics; } - $variables['forums'][$id]->last_reply = theme('forum_submitted', $forum->last_post); + $variables['forums'][$id]->last_reply = theme('forum_submitted', array('topic' => $forum->last_post)); } // Give meaning to $tid for themers. $tid actually stands for term id. $variables['forum_id'] = $variables['tid']; @@ -951,7 +951,7 @@ function template_preprocess_forum_topic if (!empty($variables['topics'])) { $row = 0; foreach ($variables['topics'] as $id => $topic) { - $variables['topics'][$id]->icon = theme('forum_icon', $topic->new, $topic->num_comments, $topic->comment_mode, $topic->sticky); + $variables['topics'][$id]->icon = theme('forum_icon', array('new_posts' => $topic->new, 'num_posts' => $topic->num_comments, 'comment_mode' => $topic->comment_mode, 'sticky' => $topic->sticky)); $variables['topics'][$id]->zebra = $row % 2 == 0 ? 'odd' : 'even'; $row++; @@ -968,8 +968,8 @@ function template_preprocess_forum_topic $variables['topics'][$id]->title = l($topic->title, "node/$topic->nid"); $variables['topics'][$id]->message = ''; } - $variables['topics'][$id]->created = theme('forum_submitted', $topic); - $variables['topics'][$id]->last_reply = theme('forum_submitted', isset($topic->last_reply) ? $topic->last_reply : NULL); + $variables['topics'][$id]->created = theme('forum_submitted', array('topic' => $topic)); + $variables['topics'][$id]->last_reply = theme('forum_submitted', array('topic' => isset($topic->last_reply) ? $topic->last_reply : NULL)); $variables['topics'][$id]->new_text = ''; $variables['topics'][$id]->new_url = ''; @@ -988,7 +988,7 @@ function template_preprocess_forum_topic $variables['topic_id'] = $variables['tid']; unset($variables['tid']); - $variables['pager'] = theme('pager', NULL); + $variables['pager'] = theme('pager', array('tags' => NULL)); } /** @@ -1030,7 +1030,7 @@ function template_preprocess_forum_icon( * @see theme_forum_submitted() */ function template_preprocess_forum_submitted(&$variables) { - $variables['author'] = isset($variables['topic']->uid) ? theme('username', $variables['topic']) : ''; + $variables['author'] = isset($variables['topic']->uid) ? theme('username', array('account' => $variables['topic'])) : ''; $variables['time'] = isset($variables['topic']->timestamp) ? format_interval(REQUEST_TIME - $variables['topic']->timestamp) : ''; } Index: modules/forum/forum.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.pages.inc,v retrieving revision 1.2 diff -u -p -r1.2 forum.pages.inc --- modules/forum/forum.pages.inc 26 Jul 2007 06:48:03 -0000 1.2 +++ modules/forum/forum.pages.inc 6 Oct 2009 18:23:22 -0000 @@ -20,5 +20,5 @@ function forum_page($tid = 0) { $topics = forum_get_topics($tid, $sortby, $forum_per_page); } - return theme('forums', $forums, $topics, $parents, $tid, $sortby, $forum_per_page); + return theme('forums', array('forums' => $forums, 'topics' => $topics, 'parents' => $parents, 'tid' => $tid, 'sortby' => $sortby, 'forums_per_page' => $forum_per_page)); } Index: modules/forum/forums.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forums.tpl.php,v retrieving revision 1.5 diff -u -p -r1.5 forums.tpl.php --- modules/forum/forums.tpl.php 13 Oct 2008 12:31:42 -0000 1.5 +++ modules/forum/forums.tpl.php 6 Oct 2009 18:23:22 -0000 @@ -20,7 +20,7 @@ ?>
      - + $links)); ?>
      Index: modules/help/help.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/help/help.admin.inc,v retrieving revision 1.9 diff -u -p -r1.9 help.admin.inc --- modules/help/help.admin.inc 6 Jun 2009 16:05:26 -0000 1.9 +++ modules/help/help.admin.inc 6 Oct 2009 18:23:22 -0000 @@ -38,7 +38,7 @@ function help_page($name) { $admin_tasks = system_get_module_admin_tasks($name); if (!empty($admin_tasks)) { ksort($admin_tasks); - $output .= theme('item_list', $admin_tasks, t('@module administration pages', array('@module' => $module['name']))); + $output .= theme('item_list', array('items' => $admin_tasks, 'title' => t('@module administration pages', array('@module' => $module['name'])))); } } Index: modules/image/image.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.admin.inc,v retrieving revision 1.11 diff -u -p -r1.11 image.admin.inc --- modules/image/image.admin.inc 18 Sep 2009 00:12:46 -0000 1.11 +++ modules/image/image.admin.inc 6 Oct 2009 18:23:22 -0000 @@ -14,7 +14,7 @@ function image_style_list() { $styles = image_styles(); $page['image_style_list'] = array( - '#markup' => theme('image_style_list', $styles), + '#markup' => theme('image_style_list', array('styles' => $styles)), '#attached' => array( 'css' => array(drupal_get_path('module', 'image') . '/image.admin.css' => array('preprocess' => FALSE)), ), @@ -64,7 +64,7 @@ function image_style_form($form, &$form_ '#markup' => $effect['label'], ); $form['effects'][$ieid]['summary'] = array( - '#markup' => isset($effect['summary theme']) ? theme($effect['summary theme'], $effect['data']) : '', + '#markup' => isset($effect['summary theme']) ? theme($effect['summary theme'], array('data' => $effect['data'])) : '', ); $form['effects'][$ieid]['weight'] = array( '#type' => 'weight', @@ -106,7 +106,7 @@ function image_style_form($form, &$form_ $form['preview'] = array( '#type' => 'item', '#title' => t('Preview'), - '#markup' => theme('image_style_preview', $style), + '#markup' => theme('image_style_preview', array('style' => $style)), ); $form['submit'] = array( '#type' => 'submit', @@ -560,7 +560,9 @@ function image_rotate_form($data) { * @see image_get_styles() * @ingroup themeable */ -function theme_image_style_list($styles) { +function theme_image_style_list($variables) { + $styles = $variables['styles']; + $header = array(t('Style name'), array('data' => t('Operations'), 'colspan' => 3)); $rows = array(); foreach ($styles as $style) { @@ -583,7 +585,7 @@ function theme_image_style_list($styles) )); } - return theme('table', $header, $rows); + return theme('table', array('header' => $header, 'rows' => $rows)); } /** @@ -593,7 +595,9 @@ 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) { + $form = $variables['form']; + $rows = array(); foreach (element_children($form) as $key) { @@ -634,7 +638,7 @@ function theme_image_style_effects($form ))); } - $output = theme('table', $header, $rows, array('id' => 'image-style-effects')); + $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'image-style-effects'))); drupal_add_tabledrag('image-style-effects', 'order', 'sibling', 'image-effect-order-weight'); return $output; } @@ -646,7 +650,9 @@ 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) { + $style = $variables['style']; + $sample_image = variable_get('image_style_preview_image', drupal_get_path('module', 'image') . '/sample.png'); $sample_width = 160; $sample_height = 160; @@ -690,7 +696,7 @@ function theme_image_style_preview($styl $output .= '
      '; $output .= t('original') . ' (' . l(t('view actual size'), $original_path) . ')'; $output .= ''; // End preview-image. @@ -700,7 +706,7 @@ function theme_image_style_preview($styl $output .= '
      '; $output .= check_plain($style['name']) . ' (' . l(t('view actual size'), file_create_url($preview_file) . '?' . time()) . ')'; $output .= ''; // End preview-image. @@ -718,7 +724,9 @@ function theme_image_style_preview($styl * A Form API element containing radio buttons. * @ingroup themeable */ -function theme_image_anchor($element) { +function theme_image_anchor($variables) { + $element = $variables['element']; + $rows = array(); $row = array(); foreach (element_children($element) as $n => $key) { @@ -731,7 +739,7 @@ function theme_image_anchor($element) { } } - return theme('table', array(), $rows, array('class' => array('image-anchor'))); + return theme('table', array('header' => array(), 'rows' => $rows, 'attributes' => array('class' => array('image-anchor')))); } /** @@ -741,7 +749,9 @@ 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) { + $data = $variables['data']; + if ($data['width'] && $data['height']) { return check_plain($data['width']) . 'x' . check_plain($data['height']); } @@ -757,8 +767,9 @@ function theme_image_resize_summary($dat * The current configuration for this scale effect. * @ingroup themeable */ -function theme_image_scale_summary($data) { - return theme('image_resize_summary', $data) . ' ' . ($data['upscale'] ? '(' . t('upscaling allowed') . ')' : ''); +function theme_image_scale_summary($variables) { + $data = $variables['data']; + return theme('image_resize_summary', array('data' => $data)) . ' ' . ($data['upscale'] ? '(' . t('upscaling allowed') . ')' : ''); } /** @@ -768,8 +779,8 @@ function theme_image_scale_summary($data * The current configuration for this crop effect. * @ingroup themeable */ -function theme_image_crop_summary($data) { - return theme('image_resize_summary', $data); +function theme_image_crop_summary($variables) { + return theme('image_resize_summary', $variables); } /** @@ -779,6 +790,7 @@ 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) { + $data = $variables['data']; return ($data['random']) ? t('random between -@degrees° and @degrees°', array('@degrees' => str_replace('-', '', $data['degrees']))) : t('@degrees°', array('@degrees' => $data['degrees'])); } Index: modules/image/image.module =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.module,v retrieving revision 1.17 diff -u -p -r1.17 image.module --- modules/image/image.module 30 Sep 2009 18:36:02 -0000 1.17 +++ modules/image/image.module 6 Oct 2009 18:23:22 -0000 @@ -20,7 +20,7 @@ function image_help($path, $arg) { $output .= '

      ' . t('Image styles') . '

      '; $output .= '

      ' . t('Image styles allow your site to output an image in several different ways without affecting the original image. Any created images will automatically be refreshed if any changes are made to the image style.') .'

      '; $output .= '

      ' . t('Every image style must have a name, which will be used in the URL of generated images. There are two common approaches to naming image styles:') . '

      '; - $output .= theme('item_list', $naming_approaches); + $output .= theme('item_list', array('items' => $naming_approaches)); $output .= '

      ' . t('Both approaches are common and which you choose depends on how you use the image style.') . '

      '; $output .= '

      ' . t('After creating an image style, effects may be added to the style. Image module comes with some basic effects such as crop, scale, desaturate, and rotate. In addition to the effects included with Image, other modules may provide additional effects. Multiple effects may be combined together, such as using the crop and scale effect and the desaturate effect, you could create square, grayscale thumbnails.'); return $output; @@ -128,7 +128,7 @@ function image_theme() { return array( 'image_style' => array( 'arguments' => array( - 'style' => NULL, + 'style_name' => NULL, 'path' => NULL, 'alt' => '', 'title' => '', @@ -802,7 +802,10 @@ function image_effect_apply($image, $eff * 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) { + $style_name = $variables['style_name']; + $path = $variables['path']; + // 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. @@ -810,7 +813,8 @@ function theme_image_style($style_name, if (!file_exists($style_path)) { $style_path = image_style_url($style_name, $path); } - return theme('image', file_create_url($style_path), $alt, $title, $attributes, $getsize); + $variables['path'] = file_create_url($style_path); + return theme('image', $variables); } /** Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.259 diff -u -p -r1.259 locale.module --- modules/locale/locale.module 22 Sep 2009 07:50:16 -0000 1.259 +++ modules/locale/locale.module 6 Oct 2009 18:23:22 -0000 @@ -656,7 +656,7 @@ function locale_block_view($delta = '') drupal_alter('translation_link', $links, $path); $block['subject'] = t('Languages'); - $block['content'] = theme('links', $links, array()); + $block['content'] = theme('links', array('links' => $links, 'attributes' => array())); return $block; } } @@ -666,8 +666,10 @@ function locale_block_view($delta = '') * * @ingroup themeable */ -function theme_locale_translation_filters($form) { +function theme_locale_translation_filters($variables) { + $form = $variables['form']; $output = ''; + foreach (element_children($form['status']) as $key) { $output .= drupal_render($form['status'][$key]); } Index: modules/menu/menu.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.admin.inc,v retrieving revision 1.61 diff -u -p -r1.61 menu.admin.inc --- modules/menu/menu.admin.inc 3 Oct 2009 01:16:02 -0000 1.61 +++ modules/menu/menu.admin.inc 6 Oct 2009 18:23:22 -0000 @@ -14,22 +14,22 @@ function menu_overview_page() { $header = array(t('Title'), array('data' => t('Operations'), 'colspan' => '3')); $rows = array(); foreach ($result as $menu) { - $row = array(theme('menu_admin_overview', $menu['title'], $menu['menu_name'], $menu['description'])); + $row = array(theme('menu_admin_overview', array('title' => $menu['title'], 'name' => $menu['menu_name'], 'description' => $menu['description']))); $row[] = array('data' => l(t('list links'), 'admin/structure/menu/manage/' . $menu['menu_name'])); $row[] = array('data' => l(t('edit menu'), 'admin/structure/menu/manage/' . $menu['menu_name'] . '/edit')); $row[] = array('data' => l(t('add link'), 'admin/structure/menu/manage/' . $menu['menu_name'] . '/add')); $rows[] = $row; } - return theme('table', $header, $rows); + return theme('table', array('header' => $header, 'rows' => $rows)); } /** * Theme the menu title and description for admin page */ -function theme_menu_admin_overview($title, $name, $description) { - $output = check_plain($title); - $output .= '

      ' . filter_xss_admin($description) . '
      '; +function theme_menu_admin_overview($variables) { + $output = check_plain($variables['title']); + $output .= '
      ' . filter_xss_admin($variables['description']) . '
      '; return $output; } @@ -186,7 +186,9 @@ function menu_overview_form_submit($form * * @ingroup themeable */ -function theme_menu_overview_form($form) { +function theme_menu_overview_form($variables) { + $form = $variables['form']; + 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'); @@ -220,7 +222,7 @@ function theme_menu_overview_form($form) $element['plid']['#type'] = 'hidden'; $row = array(); - $row[] = theme('indentation', $element['#item']['depth'] - 1) . drupal_render($element['title']); + $row[] = theme('indentation', array('size' => $element['#item']['depth'] - 1)) . drupal_render($element['title']); $row[] = array('data' => drupal_render($element['hidden']), 'class' => array('checkbox')); $row[] = array('data' => drupal_render($element['expanded']), 'class' => array('checkbox')); $row[] = drupal_render($element['weight']) . drupal_render($element['plid']) . drupal_render($element['mlid']); @@ -235,7 +237,7 @@ function theme_menu_overview_form($form) if (empty($rows)) { $rows[] = array(array('data' => $form['#empty_text'], 'colspan' => '7')); } - $output .= theme('table', $header, $rows, array('id' => 'menu-overview')); + $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'menu-overview'))); $output .= drupal_render_children($form); return $output; } Index: modules/node/content_types.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v retrieving revision 1.95 diff -u -p -r1.95 content_types.inc --- modules/node/content_types.inc 28 Sep 2009 22:14:30 -0000 1.95 +++ modules/node/content_types.inc 6 Oct 2009 18:23:22 -0000 @@ -16,10 +16,10 @@ function node_overview_types() { $rows = array(); foreach ($names as $key => $name) { - $type = $types[$key]; + $type = $types[$key]; if (node_hook($type->type, 'form')) { $type_url_str = str_replace('_', '-', $type->type); - $row = array(theme('node_admin_overview', $name, $type)); + $row = array(theme('node_admin_overview', array('name' => $name, 'type' => $type))); // Set the edit column. $row[] = array('data' => l(t('edit'), 'admin/structure/types/manage/' . $type_url_str)); @@ -37,7 +37,7 @@ function node_overview_types() { if (empty($rows)) { $rows[] = array(array('data' => t('No content types available. Add content type.', array('@link' => url('admin/structure/types/add'))), 'colspan' => '5', 'class' => array('message'))); } - + $build['node_table'] = array( '#theme' => 'table', '#header' => $header, @@ -47,7 +47,10 @@ function node_overview_types() { return $build; } -function theme_node_admin_overview($name, $type) { +function theme_node_admin_overview($variables) { + $name = $variables['name']; + $type = $variables['type']; + $output = check_plain($name); $output .= ' (Machine name: ' . check_plain($type->type) . ')'; $output .= '
      ' . filter_xss_admin($type->description) . '
      '; @@ -196,7 +199,7 @@ function node_type_form($form, &$form_st '#description' => t('Enable the submitted by Username on date text.'), ); $form['display']['teaser_length'] = array( - '#type' => 'select', + '#type' => 'select', '#title' => t('Length of trimmed posts'), '#default_value' => variable_get('teaser_length_' . $type->type, 600), '#options' => drupal_map_assoc(array(0, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000), '_node_characters'), Index: modules/node/node.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v retrieving revision 1.67 diff -u -p -r1.67 node.admin.inc --- modules/node/node.admin.inc 18 Sep 2009 00:12:47 -0000 1.67 +++ modules/node/node.admin.inc 6 Oct 2009 18:23:22 -0000 @@ -192,8 +192,10 @@ function node_filter_form() { * * @ingroup themeable */ -function theme_node_filter_form($form) { +function theme_node_filter_form($variables) { + $form = $variables['form']; $output = ''; + $output .= '
      '; $output .= drupal_render($form['filters']); $output .= '
      '; @@ -206,8 +208,10 @@ function theme_node_filter_form($form) { * * @ingroup themeable */ -function theme_node_filters($form) { +function theme_node_filters($variables) { + $form = $variables['form']; $output = ''; + $output .= '
        '; if (!empty($form['current'])) { foreach (element_children($form['current']) as $key) { @@ -358,7 +362,7 @@ function _node_mass_update_batch_finishe else { drupal_set_message(t('An error occurred and processing did not complete.'), 'error'); $message = format_plural(count($results), '1 item successfully processed:', '@count items successfully processed:'); - $message .= theme('item_list', $results); + $message .= theme('item_list', array('items' => $results)); drupal_set_message($message); } } @@ -373,7 +377,7 @@ function node_admin_content($form, $form // Show the 'add new content' link. $form['add_content'] = array( '#access' => _node_add_access(), - '#markup' => theme('links', array(array('title' => t('Add new content'), 'href' => 'node/add')), array('class' => array('action-links'))), + '#markup' => theme('links', array('links' => array(array('title' => t('Add new content'), 'href' => 'node/add')), 'attributes' => array('class' => array('action-links')))), ); $form[] = node_filter_form(); $form['#submit'][] = 'node_filter_form_submit'; @@ -447,9 +451,9 @@ function node_admin_nodes() { foreach ($result as $node) { $nodes[$node->nid] = ''; $options = empty($node->language) ? array() : array('language' => $languages[$node->language]); - $form['title'][$node->nid] = array('#markup' => l($node->title, 'node/' . $node->nid, $options) . ' ' . theme('mark', node_mark($node->nid, $node->changed))); + $form['title'][$node->nid] = array('#markup' => l($node->title, 'node/' . $node->nid, $options) . ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed)))); $form['name'][$node->nid] = array('#markup' => check_plain(node_type_get_name($node))); - $form['username'][$node->nid] = array('#markup' => theme('username', $node)); + $form['username'][$node->nid] = array('#markup' => theme('username', array('account' => $node))); $form['status'][$node->nid] = array('#markup' => ($node->status ? t('published') : t('not published'))); $form['changed'][$node->nid] = array('#markup' => format_date($node->changed, 'short')); if ($multilanguage) { @@ -461,7 +465,7 @@ function node_admin_nodes() { '#type' => 'checkboxes', '#options' => $nodes, ); - $form['pager'] = array('#markup' => theme('pager', NULL)); + $form['pager'] = array('#markup' => theme('pager', array('tags' => NULL))); $form['#theme'] = 'node_admin_nodes'; return $form; } @@ -514,8 +518,10 @@ function node_admin_nodes_submit($form, * * @ingroup themeable */ -function theme_node_admin_nodes($form) { +function theme_node_admin_nodes($variables) { + $form = $variables['form']; $output = ''; + $output .= drupal_render($form['options']); $header = $form['header']['#value']; @@ -544,7 +550,7 @@ function theme_node_admin_nodes($form) { ); } - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); if ($form['pager']['#markup']) { $output .= drupal_render($form['pager']); Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1139 diff -u -p -r1.1139 node.module --- modules/node/node.module 5 Oct 2009 01:18:25 -0000 1.1139 +++ modules/node/node.module 6 Oct 2009 18:23:22 -0000 @@ -274,7 +274,7 @@ function node_title_list($result, $title $num_rows = TRUE; } - return $num_rows ? theme('node_list', $items, $title) : FALSE; + return $num_rows ? theme('node_list', array('items' => $items, 'title' => $title)) : FALSE; } /** @@ -282,8 +282,8 @@ function node_title_list($result, $title * * @ingroup themeable */ -function theme_node_list($items, $title = NULL) { - return theme('item_list', $items, $title); +function theme_node_list($variables) { + return theme('item_list', $variables); } /** @@ -1049,7 +1049,7 @@ function node_build($node, $build_mode = $build = $node->content; // We don't need duplicate rendering info in node->content. unset($node->content); - + $build += array( '#theme' => 'node', '#node' => $node, @@ -1164,7 +1164,7 @@ function template_preprocess_node(&$vari $node = $variables['node']; $variables['date'] = format_date($node->created); - $variables['name'] = theme('username', $node); + $variables['name'] = theme('username', array('account' => $node)); $variables['node_url'] = url('node/' . $node->nid); $variables['title'] = check_plain($node->title); $variables['page'] = (bool)menu_get_object(); @@ -1175,7 +1175,7 @@ function template_preprocess_node(&$vari // Flatten the node object's member fields. $variables = array_merge((array)$node, $variables); - + // Helpful $content variable for templates. foreach (element_children($variables['elements']) as $key) { $variables['content'][$key] = $variables['elements'][$key]; @@ -1187,7 +1187,7 @@ function template_preprocess_node(&$vari // Display post information only on certain node types. if (variable_get('node_submitted_' . $node->type, TRUE)) { $variables['display_submitted'] = TRUE; - $variables['user_picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : ''; + $variables['user_picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', array('account' => $node)) : ''; } else { $variables['display_submitted'] = FALSE; @@ -1222,8 +1222,8 @@ function template_preprocess_node(&$vari * * @ingroup themeable */ -function theme_node_log_message($log) { - return '
        ' . t('Log') . ':
        ' . $log . '
        '; +function theme_node_log_message($variables) { + return '
        ' . t('Log') . ':
        ' . $variables['log'] . '
        '; } /** @@ -1345,7 +1345,7 @@ function node_search_admin() { $form['content_ranking']['info'] = array( '#value' => '' . t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') . '' ); - + // Note: reversed to reflect that higher number = higher ranking. $options = drupal_map_assoc(range(0, 10)); foreach (module_invoke_all('ranking') as $var => $values) { @@ -1370,7 +1370,7 @@ function node_search_execute($keys = NUL ->condition('n.status', 1) ->addTag('node_access') ->searchExpression($keys, 'node'); - + // Insert special keywords. $query->setOption('type', 'n.type'); $query->setOption('language', 'n.language'); @@ -1381,10 +1381,10 @@ function node_search_execute($keys = NUL if (!$query->executeFirstPass()) { return array(); } - + // Add the ranking expressions. _node_rankings($query); - + // Add a count query. $inner_query = clone $query; $count_query = db_select($inner_query->fields('i', array('sid'))); @@ -1393,7 +1393,7 @@ function node_search_execute($keys = NUL $find = $query ->limit(10) ->execute(); - + // Load results. $results = array(); foreach ($find as $item) { @@ -1401,19 +1401,19 @@ function node_search_execute($keys = NUL $node = node_load($item->sid); node_build_content($node, 'search_result'); $node->rendered = drupal_render($node->content); - + // Fetch comments for snippet. $node->rendered .= ' ' . module_invoke('comment', 'node_update_index', $node); // Fetch terms for snippet. $node->rendered .= ' ' . module_invoke('taxonomy', 'node_update_index', $node); - + $extra = module_invoke_all('node_search_result', $node); - + $results[] = array( 'link' => url('node/' . $item->sid, array('absolute' => TRUE)), 'type' => check_plain(node_type_get_name($node)), 'title' => $node->title, - 'user' => theme('username', $node), + 'user' => theme('username', array('account' => $node)), 'date' => $node->changed, 'node' => $node, 'extra' => $extra, @@ -1522,7 +1522,9 @@ function node_user_cancel($edit, $accoun * * @ingroup themeable */ -function theme_node_search_admin($form) { +function theme_node_search_admin($variables) { + $form = $variables['form']; + $output = drupal_render($form['info']); $header = array(t('Factor'), t('Weight')); @@ -1533,7 +1535,7 @@ function theme_node_search_admin($form) $row[] = drupal_render($form['factors'][$key]); $rows[] = $row; } - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); $output .= drupal_render_children($form); return $output; @@ -1821,7 +1823,7 @@ function node_block_info() { */ function node_block_view($delta = '') { $block['subject'] = t('Syndicate'); - $block['content'] = theme('feed_icon', url('rss.xml'), t('Syndicate')); + $block['content'] = theme('feed_icon', array('url' => url('rss.xml'), 'title' => t('Syndicate'))); return $block; } @@ -1969,7 +1971,7 @@ function node_page_default() { $default_links[] = l(t('Change the default front page'), 'admin/config/system/site-information'); } if (!empty($default_links)) { - $default_message .= theme('item_list', $default_links); + $default_message .= theme('item_list', array('items' => $default_links)); } $build['default_message'] = array( Index: modules/node/node.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v retrieving revision 1.84 diff -u -p -r1.84 node.pages.inc --- modules/node/node.pages.inc 3 Oct 2009 17:45:26 -0000 1.84 +++ modules/node/node.pages.inc 6 Oct 2009 18:23:22 -0000 @@ -24,7 +24,7 @@ function node_add_page() { $item = array_shift($content); drupal_goto($item['href']); } - return theme('node_add_list', $content); + return theme('node_add_list', array('content' => $content)); } /** @@ -32,7 +32,8 @@ function node_add_page() { * * @ingroup themeable */ -function theme_node_add_list($content) { +function theme_node_add_list($variables) { + $content = $variables['content']; $output = ''; if ($content) { @@ -318,7 +319,9 @@ function node_form_build_preview($form, * * @ingroup themeable */ -function theme_node_form($form) { +function theme_node_form($variables) { + $form = $variables['form']; + $output = "\n
        \n"; $output .= "
        \n"; @@ -361,7 +364,7 @@ function node_preview($node) { if (!form_get_errors()) { $cloned_node = clone $node; $cloned_node->in_preview = TRUE; - $output = theme('node_preview', $cloned_node); + $output = theme('node_preview', array('node' => $cloned_node)); } drupal_set_title(t('Preview'), PASS_THROUGH); @@ -377,7 +380,9 @@ function node_preview($node) { * * @ingroup themeable */ -function theme_node_preview($node) { +function theme_node_preview($variables) { + $node = $variables['node']; + $output = '
        '; $preview_trimmed_version = FALSE; @@ -504,13 +509,13 @@ function node_revision_overview($node) { $operations = array(); if ($revision->current_vid > 0) { - $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid"), '!username' => theme('username', $revision))) + $row[] = array('data' => t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid"), '!username' => theme('username', array('account' => $revision)))) . (($revision->log != '') ? '

        ' . filter_xss($revision->log) . '

        ' : ''), 'class' => array('revision-current')); - $operations[] = array('data' => theme('placeholder', t('current revision')), 'class' => array('revision-current'), 'colspan' => 2); + $operations[] = array('data' => theme('placeholder', array('text' => t('current revision'))), 'class' => array('revision-current'), 'colspan' => 2); } else { - $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', $revision))) + $row[] = t('!date by !username', array('!date' => l(format_date($revision->timestamp, 'short'), "node/$node->nid/revisions/$revision->vid/view"), '!username' => theme('username', array('account' => $revision)))) . (($revision->log != '') ? '

        ' . filter_xss($revision->log) . '

        ' : ''); if ($revert_permission) { $operations[] = l(t('revert'), "node/$node->nid/revisions/$revision->vid/revert"); @@ -521,7 +526,7 @@ function node_revision_overview($node) { } $rows[] = array_merge($row, $operations); } - + $build['node_revisions_table'] = array( '#theme' => 'table', '#rows' => $rows, Index: modules/openid/openid.module =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v retrieving revision 1.61 diff -u -p -r1.61 openid.module --- modules/openid/openid.module 22 Sep 2009 07:50:16 -0000 1.61 +++ modules/openid/openid.module 6 Oct 2009 18:23:22 -0000 @@ -107,7 +107,7 @@ function _openid_user_login_form_alter(& ); $form['openid_links'] = array( - '#markup' => theme('item_list', $items), + '#markup' => theme('item_list', array('items' => $items)), '#weight' => 1, ); Index: modules/poll/poll.module =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v retrieving revision 1.315 diff -u -p -r1.315 poll.module --- modules/poll/poll.module 2 Oct 2009 00:04:20 -0000 1.315 +++ modules/poll/poll.module 6 Oct 2009 18:23:22 -0000 @@ -744,11 +744,11 @@ function poll_view_results($node, $build foreach ($node->choice as $i => $choice) { if (!empty($choice['chtext'])) { $chvotes = isset($choice['chvotes']) ? $choice['chvotes'] : NULL; - $poll_results .= theme('poll_bar', $choice['chtext'], $chvotes, $total_votes, isset($node->vote) && $node->vote == $i, $block); + $poll_results .= theme('poll_bar', array('title' => $choice['chtext'], 'votes' => $chvotes, 'total_votes' => $total_votes, 'vote' => isset($node->vote) && $node->vote == $i, 'block' => $block)); } } - return theme('poll_results', $node->title, $poll_results, $total_votes, isset($node->links) ? $node->links : array(), $block, $node->nid, isset($node->vote) ? $node->vote : NULL); + return theme('poll_results', array('raw_title' => $node->title, 'results' => $poll_results, 'votes' => $total_votes, 'raw_links' => isset($node->links) ? $node->links : array(), 'block' => $block, 'nid' => $node->nid, 'vote' => isset($node->vote) ? $node->vote : NULL)); } @@ -757,7 +757,9 @@ function poll_view_results($node, $build * * @ingroup themeable */ -function theme_poll_choices($form) { +function theme_poll_choices($variables) { + $form = $variables['form']; + drupal_add_tabledrag('poll-choice-table', 'order', 'sibling', 'poll-weight'); $delta = 0; @@ -793,7 +795,7 @@ function theme_poll_choices($form) { $rows[] = $row; } - $output = theme('table', $headers, $rows, array('id' => 'poll-choice-table')); + $output = theme('table', array('header' => $headers, 'rows' => $rows, 'attributes' => array('id' => 'poll-choice-table'))); $output .= drupal_render_children($form); return $output; } @@ -812,7 +814,7 @@ function theme_poll_choices($form) { * @see theme_poll_results() */ function template_preprocess_poll_results(&$variables) { - $variables['links'] = theme('links', $variables['raw_links']); + $variables['links'] = theme('links', array('links' => $variables['raw_links'])); if (isset($variables['vote']) && $variables['vote'] > -1 && user_access('cancel own vote')) { $variables['cancel_form'] = drupal_render(drupal_get_form('poll_cancel_form', $variables['nid'])); } Index: modules/poll/poll.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.pages.inc,v retrieving revision 1.20 diff -u -p -r1.20 poll.pages.inc --- modules/poll/poll.pages.inc 29 Jul 2009 06:39:34 -0000 1.20 +++ modules/poll/poll.pages.inc 6 Oct 2009 18:23:22 -0000 @@ -42,7 +42,7 @@ function poll_page() { $output .= '
      • ' . l($node->title, "node/$node->nid") . ' - ' . format_plural($node->votes, '1 vote', '@count votes') . ' - ' . ($node->active ? t('open') : t('closed')) . '
      • '; } $output .= '
      '; - $output .= theme("pager", NULL); + $output .= theme("pager", array('tags' => NULL)); return $output; } @@ -72,14 +72,14 @@ function poll_votes($node) { $rows = array(); foreach ($queried_votes as $vote) { $rows[] = array( - $vote->name ? theme('username', $vote) : check_plain($vote->hostname), + $vote->name ? theme('username', array('account' => $vote)) : check_plain($vote->hostname), check_plain($vote->chtext), format_date($vote->timestamp), ); } $build['poll_votes_table'] = array( - '#theme' => 'table', - '#header' => $header, + '#theme' => 'table', + '#header' => $header, '#rows' => $rows, '#prefix' => t('This table lists all the recorded votes for this poll. If anonymous users are allowed to vote, they will be identified by the IP address of the computer they used when they voted.'), ); Index: modules/profile/profile.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.admin.inc,v retrieving revision 1.32 diff -u -p -r1.32 profile.admin.inc --- modules/profile/profile.admin.inc 21 Sep 2009 07:56:08 -0000 1.32 +++ modules/profile/profile.admin.inc 6 Oct 2009 18:23:22 -0000 @@ -95,7 +95,9 @@ function profile_admin_overview_submit($ * @ingroup themeable * @see profile_admin_overview() */ -function theme_profile_admin_overview($form) { +function theme_profile_admin_overview($variables) { + $form = $variables['form']; + drupal_add_css(drupal_get_path('module', 'profile') . '/profile.css'); // Add javascript if there's more than one field. if (isset($form['submit'])) { @@ -156,7 +158,7 @@ function theme_profile_admin_overview($f } $header[] = array('data' => t('Operations'), 'colspan' => 2); - $output = theme('table', $header, $rows, array('id' => 'profile-fields')); + $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'profile-fields'))); $output .= drupal_render_children($form); return $output; Index: modules/profile/profile.module =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v retrieving revision 1.276 diff -u -p -r1.276 profile.module --- modules/profile/profile.module 22 Sep 2009 07:50:16 -0000 1.276 +++ modules/profile/profile.module 6 Oct 2009 18:23:22 -0000 @@ -193,7 +193,7 @@ function profile_block_view($delta = '') if (!empty($fields)) { $profile = _profile_update_user_fields($fields, $account); - $output .= theme('profile_block', $account, $profile, TRUE); + $output .= theme('profile_block', array('account' => $account, 'fields' => $profile)); } if (isset($use_fields['user_profile']) && $use_fields['user_profile']) { @@ -525,7 +525,7 @@ function profile_category_access($accoun */ function template_preprocess_profile_block(&$variables) { - $variables['user_picture'] = theme('user_picture', $variables['account']); + $variables['user_picture'] = theme('user_picture', array('account' => $variables['account'])); $variables['profile'] = array(); // Supply filtered version of $fields that have values. foreach ($variables['fields'] as $field) { @@ -549,8 +549,8 @@ function template_preprocess_profile_blo */ function template_preprocess_profile_listing(&$variables) { - $variables['user_picture'] = theme('user_picture', $variables['account']); - $variables['name'] = theme('username', $variables['account']); + $variables['user_picture'] = theme('user_picture', array('account' => $variables['account'])); + $variables['name'] = theme('username', array('account' => $variables['account'])); $variables['profile'] = array(); // Supply filtered version of $fields that have values. foreach ($variables['fields'] as $field) { Index: modules/profile/profile.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.pages.inc,v retrieving revision 1.20 diff -u -p -r1.20 profile.pages.inc --- modules/profile/profile.pages.inc 21 Sep 2009 07:56:08 -0000 1.20 +++ modules/profile/profile.pages.inc 6 Oct 2009 18:23:22 -0000 @@ -71,13 +71,13 @@ function profile_browse() { $content = ''; foreach ($users as $account) { $profile = _profile_update_user_fields($fields, $account); - $content .= theme('profile_listing', $account, $profile); + $content .= theme('profile_listing', array('account' => $account, 'fields' => $profile)); } - $output = theme('profile_wrapper', $content); - $output .= theme('pager', NULL); + $output = theme('profile_wrapper', array('content' => $content)); + $output .= theme('pager', array('tags' => NULL)); if ($field->type == 'selection' || $field->type == 'list' || $field->type == 'textfield') { - $title = strtr(check_plain($field->page), array('%value' => theme('placeholder', $value))); + $title = strtr(check_plain($field->page), array('%value' => theme('placeholder', array('text' => $value)))); } else { $title = check_plain($field->page); @@ -108,10 +108,10 @@ function profile_browse() { $content = ''; foreach ($users as $account) { $profile = _profile_update_user_fields($fields, $account); - $content .= theme('profile_listing', $account, $profile); + $content .= theme('profile_listing', array('account' => $account, 'fields' => $profile)); } - $output = theme('profile_wrapper', $content); - $output .= theme('pager', NULL); + $output = theme('profile_wrapper', array('content' => $content)); + $output .= theme('pager', array('tags' => NULL)); drupal_set_title(t('User list')); return $output; Index: modules/search/search.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.api.php,v retrieving revision 1.16 diff -u -p -r1.16 search.api.php --- modules/search/search.api.php 18 Sep 2009 00:12:47 -0000 1.16 +++ modules/search/search.api.php 6 Oct 2009 18:23:22 -0000 @@ -16,7 +16,7 @@ * * This hook allows a module to perform searches on content it defines * (custom node types, users, or comments, for example) when a site search - * is performed. + * is performed. * * Note that you can use form API to extend the search. You will need to use * hook_form_alter() to add any additional required form elements. You can @@ -192,7 +192,7 @@ function hook_search_execute($keys = NUL 'link' => url('node/' . $item->sid, array('absolute' => TRUE)), 'type' => check_plain(node_type_get_name($node)), 'title' => $node->title, - 'user' => theme('username', $node), + 'user' => theme('username', array('account' => $node)), 'date' => $node->changed, 'node' => $node, 'extra' => $extra, Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.318 diff -u -p -r1.318 search.module --- modules/search/search.module 21 Sep 2009 06:44:14 -0000 1.318 +++ modules/search/search.module 6 Oct 2009 18:23:22 -0000 @@ -965,7 +965,7 @@ function search_data($keys = NULL, $type return module_invoke($type, 'search_page', $results); } else { - return theme('search_results', $results, $type); + return theme('search_results', array('results' => $results, 'type' => $type)); } } } Index: modules/search/search.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.pages.inc,v retrieving revision 1.11 diff -u -p -r1.11 search.pages.inc --- modules/search/search.pages.inc 25 Aug 2009 10:27:14 -0000 1.11 +++ modules/search/search.pages.inc 6 Oct 2009 18:23:22 -0000 @@ -56,8 +56,8 @@ function search_view($type = 'node') { * @return * A string containing the listing output. */ -function theme_search_results_listing($title, $content) { - $output = '

      ' . $title . '

      ' . $content . '
      '; +function theme_search_results_listing($variables) { + $output = '

      ' . $variables['title'] . '

      ' . $variables['content'] . '
      '; return $output; } @@ -73,9 +73,9 @@ function theme_search_results_listing($t function template_preprocess_search_results(&$variables) { $variables['search_results'] = ''; foreach ($variables['results'] as $result) { - $variables['search_results'] .= theme('search_result', $result, $variables['type']); + $variables['search_results'] .= theme('search_result', array('result' => $result, 'type' => $variables['type'])); } - $variables['pager'] = theme('pager', NULL); + $variables['pager'] = theme('pager', array('tags' => NULL)); // Provide alternate search results template. $variables['template_files'][] = 'search-results-' . $variables['type']; } Index: modules/simpletest/simpletest.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v retrieving revision 1.75 diff -u -p -r1.75 simpletest.module --- modules/simpletest/simpletest.module 29 Sep 2009 15:13:56 -0000 1.75 +++ modules/simpletest/simpletest.module 6 Oct 2009 18:23:22 -0000 @@ -209,7 +209,7 @@ function _simpletest_batch_operation($te } $context['message'] = t('Processed test @num of @max - %test.', array('%test' => $info['name'], '@num' => $max - $size, '@max' => $max)); $context['message'] .= '
      Overall results: ' . _simpletest_format_summary_line($test_results) . '
      '; - $context['message'] .= theme('item_list', $items); + $context['message'] .= theme('item_list', array('items' => $items)); // Save working values for the next iteration. $context['sandbox']['tests'] = $test_list; Index: modules/simpletest/simpletest.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.pages.inc,v retrieving revision 1.17 diff -u -p -r1.17 simpletest.pages.inc --- modules/simpletest/simpletest.pages.inc 18 Sep 2009 00:12:47 -0000 1.17 +++ modules/simpletest/simpletest.pages.inc 6 Oct 2009 18:23:22 -0000 @@ -63,7 +63,9 @@ function simpletest_test_form($form) { * @param $table Form array that represent a table. * @return HTML output. */ -function theme_simpletest_test_table($table) { +function theme_simpletest_test_table($variables) { + $table = $variables['table']; + drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css'); drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js'); @@ -77,8 +79,8 @@ function theme_simpletest_test_table($ta // Define the images used to expand/collapse the test groups. $js = array( 'images' => array( - theme('image', 'misc/menu-collapsed.png', 'Expand', 'Expand'), - theme('image', 'misc/menu-expanded.png', 'Collapsed', 'Collapsed'), + theme('image', array('path' => 'misc/menu-collapsed.png', 'alt' => 'Expand', 'title' => 'Expand')), + theme('image', array('path' => 'misc/menu-expanded.png', 'alt' => 'Collapsed', 'title' => 'Collapsed')), ), ); @@ -140,7 +142,7 @@ function theme_simpletest_test_table($ta $test['#name'] = $test_name; $row[] = drupal_render($test); - $row[] = theme('indentation', 1) . ''; + $row[] = theme('indentation', array('size' => 1)) . ''; $row[] = '
      ' . $description . '
      '; $rows[] = array('data' => $row, 'class' => array($test_class . '-test', ($collapsed ? 'js-hide' : ''))); @@ -156,7 +158,7 @@ function theme_simpletest_test_table($ta return '' . t('No tests to display.') . ''; } else { - return theme('table', $header, $rows, array('id' => 'simpletest-form-table')); + return theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'simpletest-form-table'))); } } @@ -358,7 +360,8 @@ function simpletest_result_form_submit($ * * @return HTML output. */ -function theme_simpletest_result_summary($form) { +function theme_simpletest_result_summary($variables) { + $form = $variables['form']; return '
      ' . _simpletest_format_summary_line($form) . '
      '; } @@ -398,10 +401,10 @@ function simpletest_result_status_image( if (!isset($map)) { $map = array( - 'pass' => theme('image', 'misc/watchdog-ok.png', t('Pass')), - 'fail' => theme('image', 'misc/watchdog-error.png', t('Fail')), - 'exception' => theme('image', 'misc/watchdog-warning.png', t('Exception')), - 'debug' => theme('image', 'misc/watchdog-warning.png', t('Debug')), + 'pass' => theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t('Pass'))), + 'fail' => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('Fail'))), + 'exception' => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('Exception'))), + 'debug' => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('Debug'))), ); } if (isset($map[$status])) { Index: modules/simpletest/tests/common_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common_test.module,v retrieving revision 1.3 diff -u -p -r1.3 common_test.module --- modules/simpletest/tests/common_test.module 5 Sep 2009 13:05:30 -0000 1.3 +++ modules/simpletest/tests/common_test.module 6 Oct 2009 18:23:23 -0000 @@ -84,8 +84,8 @@ function common_test_theme() { /** * Theme function for testing drupal_render() theming. */ -function theme_common_test_foo($foo, $bar) { - return $foo . $bar; +function theme_common_test_foo($variables) { + return $variables['foo'] . $variables['bar']; } /** Index: modules/simpletest/tests/field_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/field_test.module,v retrieving revision 1.27 diff -u -p -r1.27 field_test.module --- modules/simpletest/tests/field_test.module 29 Sep 2009 15:13:56 -0000 1.27 +++ modules/simpletest/tests/field_test.module 6 Oct 2009 18:23:23 -0000 @@ -570,7 +570,9 @@ 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) { + $element = $variables['element']; + $value = $element['#item']['value']; $settings = $element['#settings']; @@ -580,7 +582,9 @@ function theme_field_formatter_field_tes /** * Theme function for 'field_test_multiple' formatter. */ -function theme_field_formatter_field_test_multiple($element) { +function theme_field_formatter_field_test_multiple($variables) { + $element = $variables['element']; + $settings = $element['#settings']; $items = array(); @@ -968,7 +972,7 @@ function field_test_field_storage_create if ($field['storage']['type'] == 'field_test_storage_failure') { throw new Exception('field_test_storage_failure engine always fails to create fields'); } - + $data = _field_test_storage_data(); $data[$field['id']] = array( Index: modules/simpletest/tests/theme.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/theme.test,v retrieving revision 1.6 diff -u -p -r1.6 theme.test --- modules/simpletest/tests/theme.test 15 Sep 2009 17:10:39 -0000 1.6 +++ modules/simpletest/tests/theme.test 6 Oct 2009 18:23:23 -0000 @@ -63,14 +63,14 @@ class ThemeTableUnitTest extends DrupalW 'group' => 'Theme', ); } - + /** * Tableheader.js provides 'sticky' table headers, and is included by default. */ function testThemeTableStickyHeaders() { $header = array('one', 'two', 'three'); $rows = array(array(1,2,3), array(4,5,6), array(7,8,9)); - $this->content = theme('table', $header, $rows); + $this->content = theme('table', array('header' => $header, 'rows' => $rows)); $js = drupal_add_js(); $this->assertTrue(isset($js['misc/tableheader.js']), t('tableheader.js was included when $sticky = TRUE.')); $this->assertRaw('sticky-enabled', t('Table has a class of sticky-enabled when $sticky = TRUE.')); @@ -86,7 +86,7 @@ class ThemeTableUnitTest extends DrupalW $attributes = array(); $caption = NULL; $colgroups = array(); - $this->content = theme('table', $header, $rows, $attributes, $caption, $colgroups, FALSE); + $this->content = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes, 'caption' => $caption, 'colgroups' => $colgroups, 'sticky' => FALSE)); $js = drupal_add_js(); $this->assertFalse(isset($js['misc/tableheader.js']), t('tableheader.js was not included because $sticky = FALSE.')); $this->assertNoRaw('sticky-enabled', t('Table does not have a class of sticky-enabled because $sticky = FALSE.')); Index: modules/statistics/statistics.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.admin.inc,v retrieving revision 1.33 diff -u -p -r1.33 statistics.admin.inc --- modules/statistics/statistics.admin.inc 29 Sep 2009 15:31:16 -0000 1.33 +++ modules/statistics/statistics.admin.inc 6 Oct 2009 18:23:23 -0000 @@ -31,7 +31,7 @@ function statistics_recent_hits() { $rows[] = array( array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')), _statistics_format_item($log->title, $log->path), - theme('username', $log), + theme('username', array('account' => $log)), l(t('details'), "admin/reports/access/$log->aid")); } @@ -40,8 +40,8 @@ function statistics_recent_hits() { } $build['statistics_table'] = array( - '#theme' => 'table', - '#header' => $header, + '#theme' => 'table', + '#header' => $header, '#rows' => $rows, ); $build['statistics_pager'] = array('#theme' => 'pager'); @@ -88,8 +88,8 @@ function statistics_top_pages() { drupal_set_title(t('Top pages in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))), PASS_THROUGH); $build['statistics_top_pages_table'] = array( - '#theme' => 'table', - '#header' => $header, + '#theme' => 'table', + '#header' => $header, '#rows' => $rows, ); $build['statistics_top_pages_pager'] = array('#theme' => 'pager'); @@ -133,7 +133,7 @@ function statistics_top_visitors() { $destination = drupal_get_destination(); foreach ($result as $account) { $ban_link = $account->iid ? l(t('unblock IP address'), "admin/config/people/ip-blocking/delete/$account->iid", array('query' => $destination)) : l(t('block IP address'), "admin/config/people/ip-blocking/$account->hostname", array('query' => $destination)); - $rows[] = array($account->hits, ($account->uid ? theme('username', $account) : $account->hostname), format_interval(round($account->total / 1000)), (user_access('block IP addresses') && !$account->uid) ? $ban_link : ''); + $rows[] = array($account->hits, ($account->uid ? theme('username', array('account' => $account)) : $account->hostname), format_interval(round($account->total / 1000)), (user_access('block IP addresses') && !$account->uid) ? $ban_link : ''); } if (empty($rows)) { @@ -142,8 +142,8 @@ function statistics_top_visitors() { drupal_set_title(t('Top visitors in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))), PASS_THROUGH); $build['statistics_top_visitors_table'] = array( - '#theme' => 'table', - '#header' => $header, + '#theme' => 'table', + '#header' => $header, '#rows' => $rows, ); $build['statistics_top_visitors_pager'] = array('#theme' => 'pager'); @@ -191,8 +191,8 @@ function statistics_top_referrers() { } $build['statistics_top_referrers_table'] = array( - '#theme' => 'table', - '#header' => $header, + '#theme' => 'table', + '#header' => $header, '#rows' => $rows, ); $build['statistics_top_referrers_pager'] = array('#theme' => 'pager'); @@ -225,7 +225,7 @@ function statistics_access_log($aid) { ); $rows[] = array( array('data' => t('User'), 'header' => TRUE), - theme('username', $access) + theme('username', array('account' => $access)) ); $rows[] = array( array('data' => t('Hostname'), 'header' => TRUE), @@ -233,7 +233,7 @@ function statistics_access_log($aid) { ); $build['statistics_table'] = array( - '#theme' => 'table', + '#theme' => 'table', '#rows' => $rows, ); return $build; Index: modules/statistics/statistics.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/statistics/statistics.pages.inc,v retrieving revision 1.16 diff -u -p -r1.16 statistics.pages.inc --- modules/statistics/statistics.pages.inc 25 Aug 2009 10:27:15 -0000 1.16 +++ modules/statistics/statistics.pages.inc 6 Oct 2009 18:23:23 -0000 @@ -33,7 +33,7 @@ function statistics_node_tracker() { $rows[] = array( array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')), _statistics_link($log->url), - theme('username', $log), + theme('username', array('account' => $log)), l(t('details'), "admin/reports/access/$log->aid"), ); } @@ -44,8 +44,8 @@ function statistics_node_tracker() { drupal_set_title($node->title); $build['statistics_table'] = array( - '#theme' => 'table', - '#header' => $header, + '#theme' => 'table', + '#header' => $header, '#rows' => $rows ); $build['statistics_pager'] = array('#theme' => 'pager'); @@ -85,8 +85,8 @@ function statistics_user_tracker() { drupal_set_title($account->name); $build['statistics_table'] = array( - '#theme' => 'table', - '#header' => $header, + '#theme' => 'table', + '#header' => $header, '#rows' => $rows ); $build['statistics_pager'] = array('#theme' => 'pager'); Index: modules/syslog/syslog.module =================================================================== RCS file: /cvs/drupal/drupal/modules/syslog/syslog.module,v retrieving revision 1.25 diff -u -p -r1.25 syslog.module --- modules/syslog/syslog.module 27 Aug 2009 07:18:06 -0000 1.25 +++ modules/syslog/syslog.module 6 Oct 2009 18:23:23 -0000 @@ -77,7 +77,7 @@ function syslog_watchdog(array $log_entr openlog('drupal', LOG_NDELAY, variable_get('syslog_facility', $default_facility)); } - syslog($log_entry['severity'], theme('syslog_format', $log_entry)); + syslog($log_entry['severity'], theme('syslog_format', array('entry' => $log_entry))); } function syslog_theme() { @@ -93,7 +93,8 @@ function syslog_theme() { * * @ingroup themeable */ -function theme_syslog_format($entry) { +function theme_syslog_format($variables) { + $entry = $variables['entry']; global $base_url; $message = $base_url; Index: modules/system/page.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/modules/system/page.tpl.php,v retrieving revision 1.35 diff -u -p -r1.35 page.tpl.php --- modules/system/page.tpl.php 5 Oct 2009 02:43:01 -0000 1.35 +++ modules/system/page.tpl.php 6 Oct 2009 18:23:23 -0000 @@ -49,7 +49,7 @@ * - $page['sidebar_second']: Items for the second sidebar. * - $page['header']: Items for the header region. * - $page['footer']: Items for the footer region. - * + * * @see template_preprocess() * @see template_preprocess_page() * @see template_process() @@ -92,7 +92,7 @@ @@ -129,7 +129,7 @@
      Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.208 diff -u -p -r1.208 system.admin.inc --- modules/system/system.admin.inc 6 Oct 2009 01:38:55 -0000 1.208 +++ modules/system/system.admin.inc 6 Oct 2009 18:23:23 -0000 @@ -56,7 +56,7 @@ function system_main_admin_page($arg = N } else { // Theme items below. - $block['content'] .= theme('admin_block_content', $content); + $block['content'] .= theme('admin_block_content', array('content' => $content)); } } // Prepare for sorting as in function _menu_tree_check_access(). @@ -66,7 +66,7 @@ function system_main_admin_page($arg = N } if ($blocks) { ksort($blocks); - return theme('admin_page', $blocks); + return theme('admin_page', array('blocks' => $blocks)); } else { return t('You do not have any administrative items.'); @@ -105,7 +105,7 @@ function system_admin_config_page() { $function = $item['block_callback']; $block['content'] .= $function(); } - $block['content'] .= theme('admin_block_content', system_admin_menu_block($item)); + $block['content'] .= theme('admin_block_content', array('content' => system_admin_menu_block($item))); // Prepare for sorting as in function _menu_tree_check_access(). // The weight is offset so it is always positive, with a uniform 5-digits. $blocks[(50000 + $item['weight']) . ' ' . $item['title'] . ' ' . $item['mlid']] = $block; @@ -113,7 +113,7 @@ function system_admin_config_page() { } if ($blocks) { ksort($blocks); - return theme('admin_page', $blocks); + return theme('admin_page', array('blocks' => $blocks)); } else { return t('You do not have any administrative items.'); @@ -133,7 +133,7 @@ function system_admin_config_page() { function system_admin_menu_block_page() { $item = menu_get_item(); if ($content = system_admin_menu_block($item)) { - $output = theme('admin_block_content', $content); + $output = theme('admin_block_content', array('content' => $content)); } else { $output = t('You do not have any administrative items.'); @@ -172,7 +172,7 @@ function system_admin_by_module() { $menu_items[$file->info['name']] = array($file->info['description'], $admin_tasks); } } - return theme('system_admin_by_module', $menu_items); + return theme('system_admin_by_module', array('menu_items' => $menu_items)); } /** @@ -187,7 +187,7 @@ function system_settings_overview() { $item = menu_get_item('admin/config'); $content = system_admin_menu_block($item); - $output = theme('admin_block_content', $content); + $output = theme('admin_block_content', array('content' => $content)); return $output; } @@ -232,7 +232,7 @@ function system_themes_form() { break; } } - $screenshot = $screenshot ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $theme->info['name'])), '', array('class' => array('screenshot')), FALSE) : t('no screenshot'); + $screenshot = $screenshot ? theme('image', array('path' => $screenshot, 'alt' => t('Screenshot for %theme theme', array('%theme' => $theme->info['name'])), 'title' => '', 'attributes' => array('class' => array('screenshot')), 'getsize' => FALSE)) : t('no screenshot'); $form[$theme->name]['screenshot'] = array('#markup' => $screenshot); $form[$theme->name]['info'] = array( @@ -699,7 +699,7 @@ function system_modules($form, $form_sta if ($help_arg && $module->status && in_array($filename, module_implements('help'))) { if (module_invoke($filename, 'help', "admin/help#$filename", $help_arg)) { // Module has a help page. - $extra['help'] = theme('more_help_link', url("admin/help/$filename")); + $extra['help'] = theme('more_help_link', array('url' => url("admin/help/$filename"))); } } // Mark dependents disabled so the user cannot remove required modules. @@ -816,9 +816,9 @@ function _system_modules_build_row($info } else { $form['enable'] = array( - '#markup' => theme('image', 'misc/watchdog-error.png', t('incompatible'), $status_short), + '#markup' => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('incompatible'), 'title' => $status_short)), ); - $form['description']['#markup'] .= theme('system_modules_incompatible', $status_long); + $form['description']['#markup'] .= theme('system_modules_incompatible', array('message' => $status_long)); } // Show a "more help" link for modules that have them. @@ -854,7 +854,7 @@ function system_modules_confirm_form($mo ); $items[] = format_plural(count($info['requires']), 'You must enable the @required module to install @module.', 'You must enable the @required modules to install @module.', $t_argument); } - $form['text'] = array('#markup' => theme('item_list', $items)); + $form['text'] = array('#markup' => theme('item_list', array('items' => $items))); if ($form) { // Set some default form values @@ -1113,7 +1113,7 @@ function system_modules_uninstall_confir if (isset($uninstall)) { $form['#confirmed'] = TRUE; $form['uninstall']['#tree'] = TRUE; - $form['modules'] = array('#markup' => '

      ' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

      ' . theme('item_list', $uninstall)); + $form['modules'] = array('#markup' => '

      ' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

      ' . theme('item_list', array('items' => $uninstall))); $form = confirm_form( $form, t('Confirm uninstall'), @@ -1900,7 +1900,7 @@ function system_status($check = FALSE) { ->condition('pass', '') ->condition('status', 0) ->execute(); - return theme('status_report', $requirements); + return theme('status_report', array('requirements' => $requirements)); } /** @@ -1932,7 +1932,7 @@ function system_php() { function system_batch_page() { require_once DRUPAL_ROOT . '/includes/batch.inc'; $output = _batch_page(); - + // Use the same theme that the page that started the batch. $batch = &batch_get(); $GLOBALS['custom_theme'] = $batch['theme']; @@ -1958,7 +1958,9 @@ 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) { + $block = $variables['block']; + // Don't display the block if it has no content to display. if (empty($block['show'])) { return ''; @@ -1999,7 +2001,9 @@ EOT; * include a 'title', a 'description' and a formatted 'content'. * @ingroup themeable */ -function theme_admin_block_content($content) { +function theme_admin_block_content($variables) { + $content = $variables['content']; + if (!$content) { return ''; } @@ -2032,12 +2036,14 @@ function theme_admin_block_content($cont * in. This is usually 'left' or 'right'. * @ingroup themeable */ -function theme_admin_page($blocks) { +function theme_admin_page($variables) { + $blocks = $variables['blocks']; + $stripe = 0; $container = array(); foreach ($blocks as $block) { - if ($block_output = theme('admin_block', $block)) { + if ($block_output = theme('admin_block', array('block' => $block))) { if (empty($block['position'])) { // perform automatic striping. $block['position'] = ++$stripe % 2 ? 'left' : 'right'; @@ -2068,7 +2074,9 @@ 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) { + $menu_items = $variables['menu_items']; + $stripe = 0; $output = ''; $container = array('left' => '', 'right' => ''); @@ -2083,11 +2091,11 @@ function theme_system_admin_by_module($m if (count($items)) { $block = array(); $block['title'] = $module; - $block['content'] = theme('item_list', $items); + $block['content'] = theme('item_list', array('items' => $items)); $block['description'] = t($description); $block['show'] = TRUE; - if ($block_output = theme('admin_block', $block)) { + if ($block_output = theme('admin_block', array('block' => $block))) { if (!isset($block['position'])) { // Perform automatic striping. $block['position'] = $position; @@ -2116,7 +2124,9 @@ function theme_system_admin_by_module($m * An array of requirements. * @ingroup themeable */ -function theme_status_report($requirements) { +function theme_status_report($variables) { + $requirements = $variables['requirements']; + $i = 0; $output = ''; foreach ($requirements as $requirement) { @@ -2153,7 +2163,9 @@ function theme_status_report($requiremen * An associative array containing the structure of the form. * @ingroup themeable */ -function theme_system_modules_fieldset($form) { +function theme_system_modules_fieldset($variables) { + $form = $variables['form']; + // Individual table headers. $rows = array(); // Iterate through all the modules, which are @@ -2188,7 +2200,7 @@ function theme_system_modules_fieldset($ $rows[] = $row; } - return theme('table', $form['#header'], $rows); + return theme('table', array('header' => $form['#header'], 'rows' => $rows)); } /** @@ -2200,8 +2212,8 @@ function theme_system_modules_fieldset($ * @return * An HTML string for the message. */ -function theme_system_modules_incompatible($message) { - return '
      ' . $message . '
      '; +function theme_system_modules_incompatible($variables) { + return '
      ' . $variables['message'] . '
      '; } /** @@ -2213,7 +2225,9 @@ function theme_system_modules_incompatib * @return * An HTML string representing the table. */ -function theme_system_modules_uninstall($form) { +function theme_system_modules_uninstall($variables) { + $form = $variables['form']; + // No theming for the confirm form. if (isset($form['confirm'])) { return drupal_render($form); @@ -2240,7 +2254,7 @@ function theme_system_modules_uninstall( $rows[] = array(array('data' => t('No modules are available to uninstall.'), 'colspan' => '3', 'align' => 'center', 'class' => array('message'))); } - $output = theme('table', $header, $rows); + $output = theme('table', array('header' => $header, 'rows' => $rows)); $output .= drupal_render_children($form); return $output; @@ -2253,7 +2267,9 @@ function theme_system_modules_uninstall( * An associative array containing the structure of the form. * @ingroup themeable */ -function theme_system_themes_form($form) { +function theme_system_themes_form($variables) { + $form = $variables['form']; + foreach (element_children($form) as $key) { // Only look for themes if (!isset($form[$key]['info'])) { @@ -2267,12 +2283,12 @@ function theme_system_themes_form($form) // Make sure it is compatible and render the checkbox if so. if (isset($form['status']['#incompatible_themes_core'][$key])) { unset($form['status'][$key]); - $status = theme('image', 'misc/watchdog-error.png', t('incompatible'), t('Incompatible with this version of Drupal core')); + $status = theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('incompatible'), 'title' => t('Incompatible with this version of Drupal core'))); $description .= '
      ' . t('This version is incompatible with the !core_version version of Drupal core.', array('!core_version' => VERSION)) . '
      '; } elseif (isset($form['status']['#incompatible_themes_php'][$key])) { unset($form['status'][$key]); - $status = theme('image', 'misc/watchdog-error.png', t('incompatible'), t('Incompatible with this version of PHP')); + $status = theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('incompatible'), 'title' => t('Incompatible with this version of PHP'))); $php_required = $form['status']['#incompatible_themes_php'][$key]; if (substr_count($php_required, '.') < 2) { $php_required .= '.*'; @@ -2300,7 +2316,7 @@ function theme_system_themes_form($form) } $header = array(t('Screenshot'), t('Name'), t('Version'), t('Enabled'), t('Default'), t('Operations')); - $output = theme('table', $header, $rows); + $output = theme('table', array('header' => $header, 'rows' => $rows)); $output .= drupal_render_children($form); return $output; } @@ -2348,12 +2364,12 @@ function system_actions_manage() { } if ($row) { - $pager = theme('pager', NULL); + $pager = theme('pager', array('tags' => NULL)); if (!empty($pager)) { $row[] = array(array('data' => $pager, 'colspan' => '3')); } $build['system_actions_header'] = array('#markup' => '

      ' . t('Actions available to Drupal:') . '

      '); - $build['system_actions_table'] = array('#markup' => theme('table', $header, $row)); + $build['system_actions_table'] = array('#markup' => theme('table', array('header' => $header, 'rows' => $row))); } if ($actions_map) { Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.801 diff -u -p -r1.801 system.module --- modules/system/system.module 5 Oct 2009 02:43:01 -0000 1.801 +++ modules/system/system.module 6 Oct 2009 18:23:23 -0000 @@ -1465,10 +1465,10 @@ function system_preprocess_page(&$variab list($version, ) = explode('.', VERSION); // Emit the META tag in the HTML HEAD section - theme('meta_generator_html', $version); + theme('meta_generator_html', array('version' => $version)); // Emit the HTTP Header too - theme('meta_generator_header', $version); + theme('meta_generator_header', array('version' => $version)); $variables['head'] = drupal_get_html_head(); } @@ -1592,7 +1592,7 @@ function system_block_configure($delta = $form['wrapper']['preview'] = array( '#type' => 'item', '#title' => 'Preview', - '#markup' => theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system'), array('class' => array('powered-by-preview')), FALSE), + '#markup' => theme('image', array('path' => $image_path, 'alt' => t('Powered by Drupal, an open source content management system'), 'title' => t('Powered by Drupal, an open source content management system'), 'attributes' => array('class' => array('powered-by-preview')), 'getsize' => FALSE)), ); return $form; } @@ -1625,7 +1625,7 @@ function system_block_view($delta = '') case 'powered-by': $image_path = 'misc/' . variable_get('drupal_badge_color', 'powered-blue') . '-' . variable_get('drupal_badge_size', '80x15') . '.png'; $block['subject'] = NULL; - $block['content'] = theme('system_powered_by', $image_path); + $block['content'] = theme('system_powered_by', array('image_path' => $image_path)); return $block; case 'help': $block['subject'] = NULL; @@ -1664,7 +1664,7 @@ function system_admin_menu_block($item) $has_subitems = FALSE; $result = db_query(" SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.theme_callback, m.theme_arguments, m.type, m.description, m.path, m.weight as router_weight, ml.* - FROM {menu_router} m + FROM {menu_router} m LEFT JOIN {menu_links} ml ON m.path = ml.router_path WHERE (ml.plid = :plid AND ml.menu_name = :name AND hidden = 0) OR (m.tab_parent = :path AND m.type IN (:local_task, :default_task))", array(':plid' => $item['mlid'], ':name' => $item['menu_name'], ':path' => $item['path'], ':local_task' => MENU_LOCAL_TASK, ':default_task' => MENU_DEFAULT_LOCAL_TASK), array('fetch' => PDO::FETCH_ASSOC)); foreach ($result as $link) { @@ -1698,7 +1698,7 @@ function system_admin_menu_block($item) } } if ($has_subitems) { - // If we've had at least one non-tab subitem, remove the link for the + // If we've had at least one non-tab subitem, remove the link for the // default task, since that is already broken down to subitems. unset($content[$default_task]); } @@ -2691,8 +2691,8 @@ function system_timezone($abbreviation = * * @ingroup themeable */ -function theme_system_powered_by($image_path) { - $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')); +function theme_system_powered_by($variables) { + $image = theme('image', array('path' => $variables['image_path'], 'alt' => t('Powered by Drupal, an open source content management system'), 'title' => t('Powered by Drupal, an open source content management system'))); return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE)); } @@ -2719,8 +2719,8 @@ function theme_system_compact_link() { * * @ingroup themeable */ -function theme_meta_generator_html($version = VERSION) { - drupal_add_html_head(''); +function theme_meta_generator_html($variables) { + drupal_add_html_head(''); } /** @@ -2728,8 +2728,8 @@ function theme_meta_generator_html($vers * * @ingroup themeable */ -function theme_meta_generator_header($version = VERSION) { - drupal_add_http_header('X-Generator', 'Drupal ' . $version . ' (http://drupal.org)'); +function theme_meta_generator_header($variables) { + drupal_add_http_header('X-Generator', 'Drupal ' . $variables['version'] . ' (http://drupal.org)'); } /** @@ -2798,7 +2798,7 @@ function system_page_build(&$page) { ), ), // Trigger cron run for clients not supporting JavaScript (fall-back). - '#markup' => theme('system_run_cron_image', 'system/run-cron-image'), + '#markup' => theme('system_run_cron_image', array('image_path' => 'system/run-cron-image')), ); } @@ -2893,7 +2893,7 @@ function system_run_cron_image_access() * @see system_run_cron_image() * @ingroup themeable */ -function theme_system_run_cron_image($image_path) { - return ''; +function theme_system_run_cron_image($variables) { + return ''; } Index: modules/taxonomy/taxonomy.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v retrieving revision 1.70 diff -u -p -r1.70 taxonomy.admin.inc --- modules/taxonomy/taxonomy.admin.inc 21 Sep 2009 06:44:14 -0000 1.70 +++ modules/taxonomy/taxonomy.admin.inc 6 Oct 2009 18:23:23 -0000 @@ -62,7 +62,9 @@ function taxonomy_overview_vocabularies_ * @ingroup themeable * @see taxonomy_overview_vocabularies() */ -function theme_taxonomy_overview_vocabularies($form) { +function theme_taxonomy_overview_vocabularies($variables) { + $form = $variables['form']; + $rows = array(); foreach (element_children($form) as $key) { @@ -93,7 +95,7 @@ function theme_taxonomy_overview_vocabul drupal_add_tabledrag('taxonomy', 'order', 'sibling', 'vocabulary-weight'); } $header[] = array('data' => t('Operations'), 'colspan' => '3'); - return theme('table', $header, $rows, array('id' => 'taxonomy')) . drupal_render_children($form); + return theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'taxonomy'))) . drupal_render_children($form); } /** @@ -587,7 +589,9 @@ function taxonomy_overview_terms_submit( * @ingroup themeable * @see taxonomy_overview_terms() */ -function theme_taxonomy_overview_terms($form) { +function theme_taxonomy_overview_terms($variables) { + $form = $variables['form']; + $page_increment = $form['#page_increment']; $page_entries = $form['#page_entries']; $back_peddle = $form['#back_peddle']; @@ -609,7 +613,7 @@ function theme_taxonomy_overview_terms($ $term = &$form[$key]; $row = array(); - $row[] = (isset($term['#term']['depth']) && $term['#term']['depth'] > 0 ? theme('indentation', $term['#term']['depth']) : '') . drupal_render($term['view']); + $row[] = (isset($term['#term']['depth']) && $term['#term']['depth'] > 0 ? theme('indentation', array('size' => $term['#term']['depth'])) : ''). drupal_render($term['view']); if ($form['#parent_fields']) { $term['tid']['#attributes']['class'] = array('term-id'); $term['parent']['#attributes']['class'] = array('term-parent'); @@ -659,9 +663,9 @@ function theme_taxonomy_overview_terms($ } $header = array(t('Name'), t('Operations')); - $output = theme('table', $header, $rows, array('id' => 'taxonomy')); + $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'taxonomy'))); $output .= drupal_render_children($form); - $output .= theme('pager', NULL); + $output .= theme('pager', array('tags' => NULL)); return $output; } Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.513 diff -u -p -r1.513 taxonomy.module --- modules/taxonomy/taxonomy.module 26 Sep 2009 15:57:39 -0000 1.513 +++ modules/taxonomy/taxonomy.module 6 Oct 2009 18:23:23 -0000 @@ -1454,8 +1454,8 @@ function _taxonomy_term_select($title, $ * * @ingroup themeable */ -function theme_taxonomy_term_select($element) { - return theme('select', $element); +function theme_taxonomy_term_select($variables) { + return theme('select', $variables['element']); } /** @@ -1854,16 +1854,16 @@ function taxonomy_field_formatter_info() /** * Theme function for 'link' term field formatter. */ -function theme_field_formatter_taxonomy_term_link($element) { - $term = $element['#item']['taxonomy_term']; +function theme_field_formatter_taxonomy_term_link($variables) { + $term = $variables['element']['#item']['taxonomy_term']; return l($term->name, taxonomy_term_path($term)); } /** * Theme function for 'plain' term field formatter. */ -function theme_field_formatter_taxonomy_term_plain($element) { - $term = $element['#item']['taxonomy_term']; +function theme_field_formatter_taxonomy_term_plain($variables) { + $term = $variables['element']['#item']['taxonomy_term']; return $term->name; } Index: modules/taxonomy/taxonomy.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v retrieving revision 1.36 diff -u -p -r1.36 taxonomy.pages.inc --- modules/taxonomy/taxonomy.pages.inc 21 Sep 2009 07:56:08 -0000 1.36 +++ modules/taxonomy/taxonomy.pages.inc 6 Oct 2009 18:23:23 -0000 @@ -45,7 +45,7 @@ function taxonomy_term_page($term) { $nodes = node_load_multiple($nids); $build += node_build_multiple($nodes); $build['pager'] = array( - '#markup' => theme('pager', NULL), + '#markup' => theme('pager', array('tags' => NULL)), '#weight' => 5, ); } Index: modules/tracker/tracker.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/tracker/tracker.pages.inc,v retrieving revision 1.25 diff -u -p -r1.25 tracker.pages.inc --- modules/tracker/tracker.pages.inc 5 Sep 2009 15:05:05 -0000 1.25 +++ modules/tracker/tracker.pages.inc 6 Oct 2009 18:23:23 -0000 @@ -61,8 +61,8 @@ function tracker_page($account = NULL, $ $rows[] = array( check_plain(node_type_get_name($node->type)), - l($node->title, 'node/' . $node->nid) . ' ' . theme('mark', node_mark($node->nid, $node->changed)), - theme('username', $node), + l($node->title, 'node/' . $node->nid) . ' ' . theme('mark', array('type' => node_mark($node->nid, $node->changed))), + theme('username', array('account' => $node)), array('class' => array('replies'), 'data' => $comments), t('!time ago', array('!time' => format_interval(REQUEST_TIME - $node->last_activity))) ); Index: modules/trigger/trigger.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.admin.inc,v retrieving revision 1.18 diff -u -p -r1.18 trigger.admin.inc --- modules/trigger/trigger.admin.inc 19 Sep 2009 11:07:36 -0000 1.18 +++ modules/trigger/trigger.admin.inc 6 Oct 2009 18:23:23 -0000 @@ -262,7 +262,9 @@ function trigger_assign_form_submit($for * * @ingroup themeable */ -function theme_trigger_display($element) { +function theme_trigger_display($variables) { + $element = $variables['element']; + $header = array(); $rows = array(); if (isset($element['assigned']) && count($element['assigned']['#value'])) { @@ -277,7 +279,7 @@ function theme_trigger_display($element) } if (count($rows)) { - $output = theme('table', $header, $rows) . drupal_render_children($element); + $output = theme('table', array('header' => $header, 'rows' => $rows)) . drupal_render_children($element); } else { $output = drupal_render_children($element); Index: modules/trigger/trigger.module =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v retrieving revision 1.48 diff -u -p -r1.48 trigger.module --- modules/trigger/trigger.module 19 Sep 2009 11:07:36 -0000 1.48 +++ modules/trigger/trigger.module 6 Oct 2009 18:23:23 -0000 @@ -180,7 +180,7 @@ function trigger_get_assigned_actions($h function trigger_theme() { return array( 'trigger_display' => array( - 'arguments' => array('element'), + 'arguments' => array('element' => NULL), 'file' => 'trigger.admin.inc', ), ); Index: modules/update/update.report.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.report.inc,v retrieving revision 1.22 diff -u -p -r1.22 update.report.inc --- modules/update/update.report.inc 5 Oct 2009 02:26:36 -0000 1.22 +++ modules/update/update.report.inc 6 Oct 2009 18:23:23 -0000 @@ -13,10 +13,10 @@ function update_status() { if ($available = update_get_available(TRUE)) { module_load_include('inc', 'update', 'update.compare'); $data = update_calculate_project_data($available); - return theme('update_report', $data); + return theme('update_report', array('data' => $data)); } else { - return theme('update_report', _update_no_data()); + return theme('update_report', array('data' => _update_no_data())); } } @@ -25,7 +25,9 @@ function update_status() { * * @ingroup themeable */ -function theme_update_report($data) { +function theme_update_report($variables) { + $data = $variables['data']; + $last = variable_get('update_last_check', 0); $output = '
      ' . ($last ? t('Last checked: @timestamp (@time ago)', array('@time' => format_interval(REQUEST_TIME - $last), '@timestamp' => format_date($last))) : t('Last checked: never')); $output .= ' (' . l(t('Check manually'), 'admin/reports/updates/check') . ')'; @@ -45,24 +47,24 @@ function theme_update_report($data) { switch ($project['status']) { case UPDATE_CURRENT: $class = 'ok'; - $icon = theme('image', 'misc/watchdog-ok.png', t('ok'), t('ok')); + $icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t('ok'), 'title' => t('ok'))); break; case UPDATE_UNKNOWN: case UPDATE_NOT_FETCHED: $class = 'unknown'; - $icon = theme('image', 'misc/watchdog-warning.png', t('warning'), t('warning')); + $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning'))); break; case UPDATE_NOT_SECURE: case UPDATE_REVOKED: case UPDATE_NOT_SUPPORTED: $class = 'error'; - $icon = theme('image', 'misc/watchdog-error.png', t('error'), t('error')); + $icon = theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('error'), 'title' => t('error'))); break; case UPDATE_NOT_CHECKED: case UPDATE_NOT_CURRENT: default: $class = 'warning'; - $icon = theme('image', 'misc/watchdog-warning.png', t('warning'), t('warning')); + $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning'))); break; } @@ -136,31 +138,31 @@ function theme_update_report($data) { ) { $version_class[] = 'version-recommended-strong'; } - $row .= theme('update_version', $project['releases'][$project['recommended']], t('Recommended version:'), $version_class); + $row .= theme('update_version', array('version' => $project['releases'][$project['recommended']], 'tag' => t('Recommended version:'), 'class' => $version_class)); } // Now, print any security updates. if (!empty($project['security updates'])) { foreach ($project['security updates'] as $security_update) { - $row .= theme('update_version', $security_update, t('Security update:'), 'version-security' . $security_class); + $row .= theme('update_version', array('version' => $security_update, 'tag' => t('Security update:'), 'class' => 'version-security' . $security_class)); } } } if ($project['recommended'] !== $project['latest_version']) { - $row .= theme('update_version', $project['releases'][$project['latest_version']], t('Latest version:'), array('version-latest')); + $row .= theme('update_version', array('version' => $project['releases'][$project['latest_version']], 'tag' => t('Latest version:'), 'class' => array('version-latest'))); } if ($project['install_type'] == 'dev' && $project['status'] != UPDATE_CURRENT && isset($project['dev_version']) && $project['recommended'] !== $project['dev_version']) { - $row .= theme('update_version', $project['releases'][$project['dev_version']], t('Development version:'), array('version-latest')); + $row .= theme('update_version', array('version' => $project['releases'][$project['dev_version']], 'tag' => t('Development version:'), 'class' => array('version-latest'))); } } if (isset($project['also'])) { foreach ($project['also'] as $also) { - $row .= theme('update_version', $project['releases'][$also], t('Also available:'), array('version-also-available')); + $row .= theme('update_version', array('version' => $project['releases'][$also], 'tag' => t('Also available:'), 'class' => array('version-also-available'))); } } @@ -172,7 +174,7 @@ function theme_update_report($data) { foreach ($project['extra'] as $key => $value) { $row .= '
      '; $row .= check_plain($value['label']) . ': '; - $row .= theme('placeholder', $value['data']); + $row .= theme('placeholder', array('text' => $value['data'])); $row .= "
      \n"; } $row .= "
      \n"; // extra div. @@ -187,7 +189,7 @@ function theme_update_report($data) { $row .= t('Includes:'); $includes_items[] = t('Enabled: %includes', array('%includes' => implode(', ', $project['includes']))); $includes_items[] = t('Disabled: %disabled', array('%disabled' => implode(', ', $project['disabled']))); - $row .= theme('item_list', $includes_items); + $row .= theme('item_list', array('items' => $includes_items)); } else { $row .= t('Includes: %includes', array('%includes' => implode(', ', $project['includes']))); @@ -217,7 +219,7 @@ function theme_update_report($data) { if (!empty($rows[$type_name])) { ksort($rows[$type_name]); $output .= "\n

      " . $type_label . "

      \n"; - $output .= theme('table', $header, $rows[$type_name], array('class' => array('update'))); + $output .= theme('table', array('header' => $header, 'rows' => $rows[$type_name], 'attributes' => array('class' => array('update')))); } } drupal_add_css(drupal_get_path('module', 'update') . '/update.css'); @@ -229,7 +231,11 @@ function theme_update_report($data) { * * @ingroup themeable */ -function theme_update_version($version, $tag, $class) { +function theme_update_version($variables) { + $version = $variables['version']; + $tag = $variables['tag']; + $class = $variables['class']; + $output = ''; $output .= '
      '; $output .= ''; @@ -248,7 +254,7 @@ function theme_update_version($version, 'title' => t('Release notes'), 'href' => $version['release_link'], ); - $output .= theme('links', $links); + $output .= theme('links', array('links' => $links)); $output .= ''; $output .= ''; $output .= "
      \n"; Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.260 diff -u -p -r1.260 upload.module --- modules/upload/upload.module 25 Sep 2009 14:24:34 -0000 1.260 +++ modules/upload/upload.module 6 Oct 2009 18:23:23 -0000 @@ -436,7 +436,9 @@ function upload_node_search_result($node * * @ingroup themeable */ -function theme_upload_attachments($elements) { +function theme_upload_attachments($variables) { + $elements = $variables['elements']; + $header = array(t('Attachment'), t('Size')); $rows = array(); foreach ($elements['#files'] as $file) { @@ -448,7 +450,7 @@ function theme_upload_attachments($eleme } } if (count($rows)) { - return theme('table', $header, $rows, array('class' => array('attachments'))); + return theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => array('attachments')))); } } @@ -600,7 +602,9 @@ function _upload_form($node) { * * @ingroup themeable */ -function theme_upload_form_current($form) { +function theme_upload_form_current($variables) { + $form = $variables['form']; + $header = array('', t('Delete'), t('List'), t('Description'), t('Weight'), t('Size')); drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); @@ -616,7 +620,7 @@ function theme_upload_form_current($form $row[] = drupal_render($form[$key]['size']); $rows[] = array('data' => $row, 'class' => array('draggable')); } - $output = theme('table', $header, $rows, array('id' => 'upload-attachments')); + $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'upload-attachments'))); $output .= drupal_render_children($form); return $output; } @@ -627,9 +631,9 @@ function theme_upload_form_current($form * * @ingroup themeable */ -function theme_upload_form_new($form) { +function theme_upload_form_new($variables) { drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); - $output = drupal_render_children($form); + $output = drupal_render_children($variables['form']); return $output; } Index: modules/user/user.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v retrieving revision 1.81 diff -u -p -r1.81 user.admin.inc --- modules/user/user.admin.inc 2 Oct 2009 14:49:10 -0000 1.81 +++ modules/user/user.admin.inc 6 Oct 2009 18:23:23 -0000 @@ -180,7 +180,7 @@ function user_admin_account() { $accounts = array(); foreach ($result as $account) { $accounts[$account->uid] = ''; - $form['name'][$account->uid] = array('#markup' => theme('username', $account)); + $form['name'][$account->uid] = array('#markup' => theme('username', array('account' => $account))); $form['status'][$account->uid] = array('#markup' => $status[$account->status]); $users_roles = array(); $roles_result = db_query('SELECT rid FROM {users_roles} WHERE uid = :uid', array(':uid' => $account->uid)); @@ -188,7 +188,7 @@ function user_admin_account() { $users_roles[] = $roles[$user_role->rid]; } asort($users_roles); - $form['roles'][$account->uid][0] = array('#markup' => theme('item_list', $users_roles)); + $form['roles'][$account->uid][0] = array('#markup' => theme('item_list', array('items' => $users_roles))); $form['member_for'][$account->uid] = array('#markup' => format_interval(REQUEST_TIME - $account->created)); $form['last_access'][$account->uid] = array('#markup' => $account->access ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $account->access))) : t('never')); $form['operations'][$account->uid] = array('#markup' => l(t('edit'), "user/$account->uid/edit", array('query' => $destination))); @@ -197,7 +197,7 @@ function user_admin_account() { '#type' => 'checkboxes', '#options' => $accounts ); - $form['pager'] = array('#markup' => theme('pager', NULL)); + $form['pager'] = array('#markup' => theme('pager', array('tags' => NULL))); return $form; } @@ -677,7 +677,9 @@ function user_admin_permissions_submit($ * * @ingroup themeable */ -function theme_user_admin_permissions($form) { +function theme_user_admin_permissions($variables) { + $form = $variables['form']; + $roles = user_roles(); foreach (element_children($form['permission']) as $key) { $row = array(); @@ -702,7 +704,7 @@ function theme_user_admin_permissions($f $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => array('checkbox')); } $output = theme('system_compact_link'); - $output .= theme('table', $header, $rows, array('id' => 'permissions')); + $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'permissions'))); $output .= drupal_render_children($form); return $output; } @@ -765,7 +767,7 @@ function user_admin_role_validate($form, if ($form_state['values']['name']) { if ($form_state['values']['op'] == t('Save role')) { $role = user_role_load($form_state['values']['name']); - if ($role && $role->rid != $form_state['values']['rid']) { + if ($role && $role->rid != $form_state['values']['rid']) { form_set_error('name', t('The role name %name already exists. Please choose another role name.', array('%name' => $form_state['values']['name']))); } } @@ -803,7 +805,9 @@ function user_admin_role_submit($form, & * * @ingroup themeable */ -function theme_user_admin_account($form) { +function theme_user_admin_account($variables) { + $form = $variables['form']; + // Overview table: $header = array( theme('table_select_header_cell'), @@ -833,7 +837,7 @@ function theme_user_admin_account($form) $rows[] = array(array('data' => t('No users available.'), 'colspan' => '7')); } - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); if ($form['pager']['#markup']) { $output .= drupal_render($form['pager']); } @@ -848,7 +852,9 @@ function theme_user_admin_account($form) * * @ingroup themeable */ -function theme_user_admin_new_role($form) { +function theme_user_admin_new_role($variables) { + $form = $variables['form']; + $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); @@ -862,7 +868,7 @@ function theme_user_admin_new_role($form $rows[] = array(drupal_render($form['name']), array('data' => drupal_render($form['submit']), 'colspan' => 2)); $output = drupal_render_children($form); - $output .= theme('table', $header, $rows); + $output .= theme('table', array('header' => $header, 'rows' => $rows)); return $output; } @@ -872,7 +878,9 @@ function theme_user_admin_new_role($form * * @ingroup themeable */ -function theme_user_filter_form($form) { +function theme_user_filter_form($variables) { + $form = $variables['form']; + $output = '
      '; $output .= drupal_render($form['filters']); $output .= '
      '; @@ -885,7 +893,9 @@ function theme_user_filter_form($form) { * * @ingroup themeable */ -function theme_user_filters($form) { +function theme_user_filters($variables) { + $form = $variables['form']; + $output = '
        '; if (!empty($form['current'])) { foreach (element_children($form['current']) as $key) { Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.1055 diff -u -p -r1.1055 user.module --- modules/user/user.module 2 Oct 2009 14:49:10 -0000 1.1055 +++ modules/user/user.module 6 Oct 2009 18:23:23 -0000 @@ -840,7 +840,7 @@ function user_element_info() { */ function user_user_view($account) { $account->content['user_picture'] = array( - '#markup' => theme('user_picture', $account), + '#markup' => theme('user_picture', array('account' => $account)), '#weight' => -10, ); if (!isset($account->content['summary'])) { @@ -958,7 +958,7 @@ function user_login_block($form) { $items[] = l(t('Create new account'), 'user/register', array('attributes' => array('title' => t('Create a new user account.')))); } $items[] = l(t('Request new password'), 'user/password', array('attributes' => array('title' => t('Request new password via e-mail.')))); - $form['links'] = array('#markup' => theme('item_list', $items)); + $form['links'] = array('#markup' => theme('item_list', array('items' => $items))); return $form; } @@ -1045,7 +1045,7 @@ function user_block_view($delta = '') { if (user_access('access content')) { // Retrieve a list of new users who have subsequently accessed the site successfully. $items = db_query_range('SELECT uid, name FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5))->fetchAll(); - $output = theme('user_list', $items); + $output = theme('user_list', array('users' => $items)); $block['subject'] = t('Who\'s new'); $block['content'] = $output; @@ -1081,7 +1081,7 @@ function user_block_view($delta = '') { $max_users = variable_get('user_block_max_list_count', 10); if ($authenticated_count && $max_users) { $items = db_query_range('SELECT u.uid, u.name, MAX(s.timestamp) AS max_timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= :interval AND s.uid > 0 GROUP BY u.uid, u.name ORDER BY max_timestamp DESC', 0, $max_users, array(':interval' => $interval))->fetchAll(); - $output .= theme('user_list', $items, t('Online users')); + $output .= theme('user_list', array('users' => $items, 'titles' => t('Online users'))); } $block['subject'] = t('Who\'s online'); @@ -1125,10 +1125,10 @@ function template_preprocess_user_pictur if (isset($filepath)) { $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous')))); if (module_exists('image') && $style = variable_get('user_picture_style', '')) { - $variables['user_picture'] = theme('image_style', $style, $filepath, $alt, $alt, array(), FALSE); + $variables['user_picture'] = theme('image_style', array('style_name' => $style, 'path' => $filepath, 'alt' => $alt, 'title' => $alt, 'attributes' => array(), 'getsize' => FALSE)); } else { - $variables['user_picture'] = theme('image', $filepath, $alt, $alt, array(), FALSE); + $variables['user_picture'] = theme('image', array('path' => $filepath, 'alt' => $alt, 'title' => $alt, 'attributes' => array(), 'getsize' => FALSE)); } if (!empty($account->uid) && user_access('access user profiles')) { $attributes = array('attributes' => array('title' => t('View user profile.')), 'html' => TRUE); @@ -1148,13 +1148,16 @@ function template_preprocess_user_pictur * * @ingroup themeable */ -function theme_user_list($users, $title = NULL) { +function theme_user_list($variables) { + $users = $variables['users']; + $title = $variables['title']; + if (!empty($users)) { foreach ($users as $user) { - $items[] = theme('username', $user); + $items[] = theme('username', array('account' => $user)); } } - return theme('item_list', $items, $title); + return theme('item_list', array('items' => $items, 'title' => $title)); } function user_is_anonymous() { @@ -1911,7 +1914,7 @@ function user_edit_form(&$form, &$form_s '#value' => isset($account->picture) ? $account->picture : NULL, ); $form['picture']['picture_current'] = array( - '#markup' => theme('user_picture', $account), + '#markup' => theme('user_picture', array('account' => $account)), ); $form['picture']['picture_delete'] = array( '#type' => 'checkbox', @@ -2057,7 +2060,7 @@ function _user_cancel($edit, $account, $ * The user account of the profile being viewed. * * To theme user profiles, copy modules/user/user-profile.tpl.php - * to your theme directory, and edit it as instructed in that file's comments. + * to your theme directory, and edit it as instructed in that file's comments. * * @param $account * A user object. @@ -2072,7 +2075,7 @@ function user_build($account) { $build = $account->content; // We don't need duplicate rendering info in account->content. unset($account->content); - + $build += array( '#theme' => 'user_profile', '#account' => $account, @@ -2838,8 +2841,10 @@ function user_comment_view($comment) { * * @ingroup themeable */ -function theme_user_signature($signature) { +function theme_user_signature($variables) { + $signature = $variables['signature']; $output = ''; + if ($signature) { $output .= '
        '; $output .= '
        '; Index: themes/garland/template.php =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/template.php,v retrieving revision 1.32 diff -u -p -r1.32 template.php --- themes/garland/template.php 5 Oct 2009 02:43:01 -0000 1.32 +++ themes/garland/template.php 6 Oct 2009 18:23:24 -0000 @@ -8,7 +8,9 @@ * An array containing the breadcrumb links. * @return a string containing the breadcrumb output. */ -function garland_breadcrumb($breadcrumb) { +function garland_breadcrumb($variables) { + $breadcrumb = $variables['breadcrumb']; + if (!empty($breadcrumb)) { // Provide a navigational heading to give context for breadcrumb links to // screen-reader users. Make the heading invisible with .element-invisible. @@ -36,31 +38,33 @@ function garland_process_html(&$vars) { function garland_preprocess_page(&$vars) { $vars['tabs2'] = menu_secondary_local_tasks(); if (isset($vars['main_menu'])) { - $vars['primary_nav'] = theme('links', $vars['main_menu'], - array( + $vars['primary_nav'] = theme('links', array( + 'links' => $vars['main_menu'], + 'attributes' => array( 'class' => array('links', 'main-menu'), ), - array( + 'heading' => array( 'text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'), ) - ); + )); } else { $vars['primary_nav'] = FALSE; } if (isset($vars['secondary_menu'])) { - $vars['secondary_nav'] = theme('links', $vars['secondary_menu'], - array( + $vars['secondary_nav'] = theme('links', array( + 'links' => $vars['secondary_menu'], + 'attributes' => array( 'class' => array('links', 'secondary-menu'), ), - array( + 'heading' => array( 'text' => t('Secondary menu'), 'level' => 'h2', 'class' => array('element-invisible'), ) - ); + )); } else { $vars['secondary_nav'] = FALSE; Index: themes/seven/template.php =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/template.php,v retrieving revision 1.6 diff -u -p -r1.6 template.php --- themes/seven/template.php 15 Sep 2009 17:10:39 -0000 1.6 +++ themes/seven/template.php 6 Oct 2009 18:23:24 -0000 @@ -15,7 +15,8 @@ function seven_preprocess_page(&$vars) { /** * Display the list of available node types for node creation. */ -function seven_node_add_list($content) { +function seven_node_add_list($variables) { + $content = $variables['content']; $output = ''; if ($content) { $output = '
          '; @@ -35,7 +36,8 @@ function seven_node_add_list($content) { * * Use unordered list markup in both compact and extended move. */ -function seven_admin_block_content($content) { +function seven_admin_block_content($variables) { + $content = $variables['content']; $output = ''; if (!empty($content)) { $output = system_admin_compact_mode() ? '
            ' : '
              '; @@ -57,13 +59,14 @@ function seven_admin_block_content($cont * * Use our own image versions, so they show up as black and not gray on gray. */ -function seven_tablesort_indicator($style) { +function seven_tablesort_indicator($variables) { + $style = $variables['style']; $theme_path = drupal_get_path('theme', 'seven'); if ($style == "asc") { - return theme('image', $theme_path . '/images/arrow-asc.png', t('sort icon'), t('sort ascending')); + return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort icon'), 'title' => t('sort ascending'))); } else { - return theme('image', $theme_path . '/images/arrow-desc.png', t('sort icon'), t('sort descending')); + return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort icon'), 'title' => t('sort descending'))); } } @@ -72,7 +75,8 @@ function seven_tablesort_indicator($styl * * Add span to legend tag, so we can style it to be inside the fieldset. */ -function seven_fieldset($element) { +function seven_fieldset($variables) { + $element = $variables['element']; if (!empty($element['#collapsible'])) { drupal_add_js('misc/collapse.js');