? test.php ? theme.php ? modules/field/modules/number/number.widget.inc ? sites/all/modules/test569362.zip ? sites/default/private Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.206 diff -u -p -r1.206 install.php --- install.php 14 Sep 2009 07:33:55 -0000 1.206 +++ install.php 15 Sep 2009 19:00:43 -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,7 +679,7 @@ 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', install_tasks_to_display($install_state), $active_task)); } print theme($install_state['database_tables_exist'] ? 'maintenance_page' : 'install_page', $output); exit; @@ -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(&$f 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; @@ -1674,7 +1675,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: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.988 diff -u -p -r1.988 common.inc --- includes/common.inc 11 Sep 2009 15:12:29 -0000 1.988 +++ includes/common.inc 15 Sep 2009 19:00:43 -0000 @@ -3246,7 +3246,7 @@ function drupal_get_js($scope = 'header' * @see drupal_render(). */ function drupal_process_attached($elements, $weight = JS_DEFAULT, $dependency_check = FALSE) { - // If there is nothing to process then return. + // If there is nothing to process then return. if (empty($elements['#attached'])) { return; } @@ -4287,7 +4287,7 @@ function show(&$element) { * * @see drupal_render() * @see drupal_render_cache_set() - * + * * @param $elements * A renderable array. * @return @@ -4324,7 +4324,7 @@ function drupal_render_cache_get($elemen * A renderable array. */ function drupal_render_cache_set($markup, $elements) { - // Create the cache ID for the element + // Create the cache ID for the element if (!in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD')) || !$cid = drupal_render_cid_create($elements)) { return FALSE; } @@ -4634,7 +4634,7 @@ function drupal_common_theme() { 'arguments' => array('tree' => NULL), ), 'menu_item' => array( - 'arguments' => array('link' => NULL, 'has_children' => NULL, 'menu' => ''), + 'arguments' => array('link' => NULL, 'has_children' => NULL, 'menu' => '', 'in_active_trail' => FALSE, 'extra_class' => NULL), ), 'menu_local_task' => array( 'arguments' => array('link' => NULL, 'active' => FALSE), Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.372 diff -u -p -r1.372 form.inc --- includes/form.inc 11 Sep 2009 04:09:26 -0000 1.372 +++ includes/form.inc 15 Sep 2009 19:00:43 -0000 @@ -1517,7 +1517,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')); @@ -1631,7 +1632,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'])) { @@ -1660,7 +1662,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) . ''; } @@ -1970,7 +1975,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"; @@ -1996,7 +2002,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 = '\n"; @@ -2388,7 +2400,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"; } @@ -2427,7 +2441,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'); @@ -2464,7 +2479,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"; @@ -2482,7 +2498,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 @@ -2507,7 +2524,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); } @@ -2523,7 +2541,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'] . '" ' : ''; @@ -2560,7 +2579,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"; } @@ -2576,7 +2596,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(); @@ -2891,7 +2912,7 @@ function batch_process($redirect = NULL, $batch =& batch_get(); drupal_theme_initialize(); - + if (isset($batch)) { // Add process information $url = isset($url) ? $url : 'batch'; Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.226 diff -u -p -r1.226 locale.inc --- includes/locale.inc 22 Aug 2009 14:34:17 -0000 1.226 +++ includes/locale.inc 15 Sep 2009 19:00:43 -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. Index: includes/menu.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/menu.inc,v retrieving revision 1.344 diff -u -p -r1.344 menu.inc --- includes/menu.inc 11 Sep 2009 15:05:42 -0000 1.344 +++ includes/menu.inc 15 Sep 2009 19:00:43 -0000 @@ -1258,12 +1258,13 @@ function _menu_tree_data(&$links, $paren * * @ingroup themeable */ -function theme_menu_item_link($link) { - if (empty($link['localized_options'])) { - $link['localized_options'] = array(); +function theme_menu_item_link($variables) { + $item = $variables['item']; + if (empty($item['localized_options'])) { + $item['localized_options'] = array(); } - return l($link['title'], $link['href'], $link['localized_options']); + return l($item['title'], $item['href'], $item['localized_options']); } /** @@ -1271,8 +1272,8 @@ function theme_menu_item_link($link) { * * @ingroup themeable */ -function theme_menu_tree($tree) { - return ''; +function theme_menu_tree($variables) { + return ''; } /** @@ -1299,7 +1300,10 @@ function theme_menu_tree($tree) { * Extra classes that should be added to the class of the list item. * Defaults to NULL. */ -function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) { +function theme_menu_item($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf')); if (!empty($extra_class)) { $class .= ' ' . $extra_class; @@ -1315,7 +1319,10 @@ function theme_menu_item($link, $has_chi * * @ingroup themeable */ -function theme_menu_local_task($link, $active = FALSE) { +function theme_menu_local_task($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return '
  • ' . $link . "
  • \n"; } @@ -1324,8 +1331,8 @@ function theme_menu_local_task($link, $a * * @ingroup themeable */ -function theme_menu_local_action($link) { - return '
  • ' . $link . "
  • \n"; +function theme_menu_local_action($variables) { + return '
  • ' . $variables['link'] . "
  • \n"; } /** Index: includes/pager.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/pager.inc,v retrieving revision 1.71 diff -u -p -r1.71 pager.inc --- includes/pager.inc 26 Aug 2009 04:58:23 -0000 1.71 +++ includes/pager.inc 15 Sep 2009 19:00:43 -0000 @@ -275,7 +275,11 @@ function pager_get_querystring() { * * @ingroup themeable */ -function theme_pager($tags = array(), $element = 0, $parameters = array(), $quantity = 9) { +function theme_pager($variables) { + extract($variables, EXTR_SKIP); + // $tags = array(), $element = 0, $parameters = array(), $quantity = 9 + // @todo remove extract() if possible and check hook_theme defaults. + global $pager_page_array, $pager_total; // Calculate various markers within this pager piece: @@ -399,7 +403,11 @@ function theme_pager($tags = array(), $e * * @ingroup themeable */ -function theme_pager_first($text, $element = 0, $parameters = array()) { +function theme_pager_first($variables) { + extract($variables, EXTR_SKIP); + // $text, $element = 0, $parameters = array() + // @todo remove extract() if possible and check hook_theme defaults. + global $pager_page_array; $output = ''; @@ -427,7 +435,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) { + extract($variables, EXTR_SKIP); + // $text, $element = 0, $interval = 1, $parameters = array() + // @todo remove extract() if possible and check hook_theme defaults. + global $pager_page_array; $output = ''; @@ -464,7 +476,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) { + extract($variables, EXTR_SKIP); + // $text, $element = 0, $interval = 1, $parameters = array() + // @todo remove extract() if possible and check hook_theme defaults. + global $pager_page_array, $pager_total; $output = ''; @@ -498,7 +514,11 @@ function theme_pager_next($text, $elemen * * @ingroup themeable */ -function theme_pager_last($text, $element = 0, $parameters = array()) { +function theme_pager_last($variables) { + extract($variables, EXTR_SKIP); + // $text, $element = 0, $parameters = array() + // @todo remove extract() if possible and check hook_theme defaults. + global $pager_page_array, $pager_total; $output = ''; @@ -527,7 +547,11 @@ 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) { + extract($variables, EXTR_SKIP); + // $text, $page_new, $element, $parameters = array(), $attributes = array() + // @todo remove extract() if possible and check hook_theme defaults. + $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/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.523 diff -u -p -r1.523 theme.inc --- includes/theme.inc 11 Sep 2009 15:17:00 -0000 1.523 +++ includes/theme.inc 15 Sep 2009 19:00:44 -0000 @@ -766,99 +766,73 @@ 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(); - foreach ($info['arguments'] as $name => $default) { - $new_args[] = isset($args[0]["#$name"]) ? $args[0]["#$name"] : $default; - } - $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++; - } - } + // If a theme hook 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(); + foreach ($info['arguments'] as $name => $default) { + $new_args[] = isset($args[0]["#$name"]) ? $args[0]["#$name"] : $default; + } + $args = $new_args; + } + + // Populate $variables with the arguments. + $variables = array(); + if (!empty($info['arguments'])) { + $count = 0; + foreach ($info['arguments'] as $name => $default) { + $variables[$name] = isset($args[$count]) ? $args[$count] : $default; + $count++; + } + } - // Get suggestions for alternate functions out of the variables that - // were set. This lets us dynamically choose a function from a list. - // The order is FILO, so this array is ordered from least appropriate - // functions to most appropriate last. - $suggestions = array(); - if (isset($variables['theme_functions'])) { - $suggestions = $variables['theme_functions']; - } - 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'; @@ -878,44 +852,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; @@ -1329,8 +1291,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']) . ''; } /** @@ -1346,7 +1309,8 @@ function theme_placeholder($text) { * @return * A string containing the messages. */ -function theme_status_messages($display = NULL) { +function theme_status_messages($variables) { + $display = isset($variables['display']) ? $variables['display'] : NULL; $output = ''; $status_heading = array( 'status' => t('Status message'), @@ -1403,7 +1367,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) { + extract($variables, EXTR_SKIP); + // Extracts $links, $attributes, $heading. + // @todo remove extract() if possible and check hook_theme defaults. global $language; $output = ''; @@ -1492,7 +1459,10 @@ 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) { + extract($variables, EXTR_SKIP); + // $path, $alt = '', $title = '', $attributes = array(), $getsize = TRUE + // @todo remove extract() if possible and check hook_theme defaults. if (!$getsize || (is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) { $attributes = drupal_attributes($attributes); $url = file_create_url($path); @@ -1507,7 +1477,8 @@ 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. @@ -1524,7 +1495,8 @@ function theme_breadcrumb($breadcrumb) { * @param $links * An array of links. */ -function theme_submenu($links) { +function theme_submenu($variables) { + $links = $variables['links']; return ''; } @@ -1603,7 +1575,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) { @@ -1732,8 +1710,8 @@ function theme_table_select_header_cell( * @return * A themed sort icon. */ -function theme_tablesort_indicator($style) { - if ($style == "asc") { +function theme_tablesort_indicator($variables) { + if ($variables['style'] == "asc") { return theme('image', 'misc/arrow-asc.png', t('sort icon'), t('sort ascending')); } else { @@ -1751,7 +1729,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) { @@ -1781,7 +1760,10 @@ function theme_mark($type = MARK_NEW) { * @return * A string containing the list output. */ -function theme_item_list($items = array(), $title = NULL, $type = 'ul', $attributes = array()) { +function theme_item_list($variables) { + extract($variables, EXTR_SKIP); + // $items = array(), $title = NULL, $type = 'ul', $attributes = array() + // @todo remove extract() if possible and check hook_theme defaults. $output = '
    '; if (isset($title)) { $output .= '

    ' . $title . '

    '; @@ -1829,8 +1811,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 ''; } /** @@ -1841,10 +1823,10 @@ function theme_more_help_link($url) { * @param $title * A descriptive title of the feed. */ -function theme_feed_icon($url, $title) { - $text = t('Subscribe to @feed-title', array('@feed-title' => $title)); +function theme_feed_icon($variables) { + $text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title'])); if ($image = theme('image', 'misc/feed.png', $text)) { - return '' . $image . ''; + return '' . $image . ''; } } @@ -1856,8 +1838,8 @@ function theme_feed_icon($url, $title) { * @param $title * A descriptive verb for the link, like 'Read more' */ -function theme_more_link($url, $title) { - return ''; +function theme_more_link($variables) { + return ''; } /** @@ -1871,51 +1853,48 @@ function theme_more_link($url, $title) { */ 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 = ''; + + $variables['extra'] = ''; if (empty($account->uid)) { - $variables['object']->uid = 0; + $variables['uid'] = 0; if (theme_get_setting('toggle_comment_user_verification')) { - $variables['object']->extra = ' (' . t('not verified') . ')'; + $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 these are safe for use in the theme function. - $variables['object']->name = check_plain($variables['object']->name); - $variables['object']->extra = check_plain($variables['object']->extra); + $variables['name'] = check_plain($variables['name']); + $variables['extra'] = check_plain($variables['extra']); } /** @@ -1927,8 +1906,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']; } } @@ -1947,18 +1926,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; } @@ -1973,11 +1952,11 @@ function theme_username($object) { * @return * A themed HTML string representing the progress bar. */ -function theme_progress_bar($percent, $message) { +function theme_progress_bar($variables) { $output = '
    '; - $output .= '
    '; - $output .= '
    ' . $percent . '%
    '; - $output .= '
    ' . $message . '
    '; + $output .= '
    '; + $output .= '
    ' . $variables['percent'] . '%
    '; + $output .= '
    ' . $variables['message'] . '
    '; $output .= '
    '; return $output; @@ -1991,9 +1970,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; Index: includes/theme.maintenance.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v retrieving revision 1.40 diff -u -p -r1.40 theme.maintenance.inc --- includes/theme.maintenance.inc 11 Sep 2009 13:56:56 -0000 1.40 +++ includes/theme.maintenance.inc 15 Sep 2009 19:00:44 -0000 @@ -85,7 +85,8 @@ function _theme_load_offline_registry($t * * @ingroup themeable */ -function theme_task_list($items, $active = NULL) { +function theme_task_list($variables) { + extract($variables, EXTR_SKIP); $done = isset($items[$active]) || $active == NULL; $output = '

    Installation tasks

    '; $output .= '
      '; @@ -118,11 +119,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_set_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() @@ -174,13 +173,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_set_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'); Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.422 diff -u -p -r1.422 aggregator.module --- modules/aggregator/aggregator.module 29 Aug 2009 05:46:01 -0000 1.422 +++ modules/aggregator/aggregator.module 15 Sep 2009 19:00:44 -0000 @@ -638,7 +638,10 @@ function aggregator_category_load($cid) * The item HTML. * @ingroup themeable */ -function theme_aggregator_block_item($item, $feed = 0) { +function theme_aggregator_block_item($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // Display the external link to the item. return '' . check_plain($item->title) . "\n"; Index: modules/aggregator/aggregator.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.pages.inc,v retrieving revision 1.32 diff -u -p -r1.32 aggregator.pages.inc --- modules/aggregator/aggregator.pages.inc 24 Aug 2009 17:11:42 -0000 1.32 +++ modules/aggregator/aggregator.pages.inc 15 Sep 2009 19:00:44 -0000 @@ -235,7 +235,10 @@ function aggregator_categorize_items_sub * The output HTML. * @ingroup themeable */ -function theme_aggregator_categorize_items($form) { +function theme_aggregator_categorize_items($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = drupal_render($form['feed_source']); $rows = array(); if (!empty($form['items'])) { @@ -368,7 +371,10 @@ function aggregator_page_rss() { * A common category, if any, for all the feeds. * @ingroup themeable */ -function theme_aggregator_page_rss($feeds, $category = NULL) { +function theme_aggregator_page_rss($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_set_header('Content-Type', 'application/rss+xml; charset=utf-8'); $items = ''; @@ -428,7 +434,10 @@ function aggregator_page_opml($cid = NUL * An array of the feeds to theme. * @ingroup themeable */ -function theme_aggregator_page_opml($feeds) { +function theme_aggregator_page_opml($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_set_header('Content-Type', 'text/xml; charset=utf-8'); $output = "\n"; Index: modules/book/book.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.admin.inc,v retrieving revision 1.21 diff -u -p -r1.21 book.admin.inc --- modules/book/book.admin.inc 22 Aug 2009 14:34:18 -0000 1.21 +++ modules/book/book.admin.inc 15 Sep 2009 19:00:44 -0000 @@ -222,7 +222,10 @@ function _book_admin_table_tree($tree, & * @ingroup themeable * @see book_admin_table() */ -function theme_book_admin_table($form) { +function theme_book_admin_table($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_tabledrag('book-outline', 'match', 'parent', 'book-plid', 'book-plid', 'book-mlid', TRUE, MENU_MAX_DEPTH - 2); drupal_add_tabledrag('book-outline', 'order', 'sibling', 'book-weight'); Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.513 diff -u -p -r1.513 book.module --- modules/book/book.module 10 Sep 2009 12:33:43 -0000 1.513 +++ modules/book/book.module 15 Sep 2009 19:00:44 -0000 @@ -303,7 +303,10 @@ function book_block_save($delta = '', $e * * @ingroup themeable */ -function theme_book_title_link($link) { +function theme_book_title_link($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $link['options']['attributes']['class'] = array('book-title'); return l($link['title'], $link['href'], $link['options']); Index: modules/color/color.module =================================================================== RCS file: /cvs/drupal/drupal/modules/color/color.module,v retrieving revision 1.70 diff -u -p -r1.70 color.module --- modules/color/color.module 5 Sep 2009 15:05:02 -0000 1.70 +++ modules/color/color.module 15 Sep 2009 19:00:44 -0000 @@ -199,7 +199,10 @@ function color_scheme_form(&$form_state, * * @ingroup themeable */ -function theme_color_scheme_form($form) { +function theme_color_scheme_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $theme = $form['theme']['#value']; $info = $form['info']['#value']; $path = drupal_get_path('theme', $theme) . '/'; Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.769 diff -u -p -r1.769 comment.module --- modules/comment/comment.module 11 Sep 2009 13:37:52 -0000 1.769 +++ modules/comment/comment.module 15 Sep 2009 19:00:44 -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', @@ -2096,12 +2096,12 @@ function template_preprocess_comment(&$v $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'; @@ -2137,7 +2137,10 @@ function template_preprocess_comment(&$v * The comment node. * @ingroup themeable */ -function theme_comment_post_forbidden($node) { +function theme_comment_post_forbidden($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + global $user; if (!$user->uid) { 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 15 Sep 2009 19:00:44 -0000 @@ -173,7 +173,10 @@ function dblog_form_system_logging_setti * * @ingroup themeable */ -function theme_dblog_filters($form) { +function theme_dblog_filters($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; foreach (element_children($form['status']) as $key) { $output .= drupal_render($form['status'][$key]); Index: modules/field/field.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.api.php,v retrieving revision 1.34 diff -u -p -r1.34 field.api.php --- modules/field/field.api.php 10 Sep 2009 06:31:38 -0000 1.34 +++ modules/field/field.api.php 15 Sep 2009 19:00:44 -0000 @@ -787,7 +787,8 @@ 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) { + extract($variables, EXTR_SKIP); // This relies on a 'safe' element being prepared in hook_field_sanitize(). return $element['#item']['safe']; } @@ -809,7 +810,10 @@ 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) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $items = array(); foreach (element_children($element) as $key) { $items[$key] = $key .':'. $element[$key]['#item']['value']; Index: modules/field/field.form.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.form.inc,v retrieving revision 1.24 diff -u -p -r1.24 field.form.inc --- modules/field/field.form.inc 10 Sep 2009 22:31:58 -0000 1.24 +++ modules/field/field.form.inc 15 Sep 2009 19:00:44 -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) { + extract($variables, EXTR_SKIP); $output = ''; if ($element['#multiple'] > 1 || $element['#multiple'] == FIELD_CARDINALITY_UNLIMITED) { Index: modules/field/modules/list/list.module =================================================================== RCS file: /cvs/drupal/drupal/modules/field/modules/list/list.module,v retrieving revision 1.14 diff -u -p -r1.14 list.module --- modules/field/modules/list/list.module 9 Sep 2009 21:21:54 -0000 1.14 +++ modules/field/modules/list/list.module 15 Sep 2009 19:00:44 -0000 @@ -257,7 +257,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']]; @@ -269,6 +270,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.18 diff -u -p -r1.18 number.module --- modules/field/modules/number/number.module 11 Sep 2009 00:06:53 -0000 1.18 +++ modules/field/modules/number/number.module 15 Sep 2009 19:00:44 -0000 @@ -240,14 +240,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']; @@ -497,6 +499,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 15 Sep 2009 19:00:44 -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), ), ); } @@ -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.28 diff -u -p -r1.28 text.module --- modules/field/modules/text/text.module 11 Sep 2009 13:30:49 -0000 1.28 +++ modules/field/modules/text/text.module 15 Sep 2009 19:00:44 -0000 @@ -296,21 +296,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); @@ -322,7 +325,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']); @@ -777,10 +781,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/file/file.field.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/file/file.field.inc,v retrieving revision 1.3 diff -u -p -r1.3 file.field.inc --- modules/file/file.field.inc 10 Sep 2009 22:31:58 -0000 1.3 +++ modules/file/file.field.inc 15 Sep 2009 19:00:44 -0000 @@ -745,7 +745,10 @@ function file_field_widget_process_multi /** * Theme an individual file upload widget. */ -function theme_file_widget($element) { +function theme_file_widget($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; // The "form-managed-file" class is required for proper AJAX functionality. $output .= '
      '; @@ -762,7 +765,10 @@ function theme_file_widget($element) { /** * Theme a group of file upload widgets. */ -function theme_file_widget_multiple($element) { +function theme_file_widget_multiple($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $field = field_info_field($element['#field_name']); // Get our list of widgets in order. @@ -854,7 +860,10 @@ function theme_file_widget_multiple($ele * @return * A string suitable for a file field description. */ -function theme_file_upload_help($description, $upload_validators) { +function theme_file_upload_help($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $descriptions = array(); if (strlen($description)) { @@ -889,21 +898,30 @@ function theme_file_upload_help($descrip /** * Theme function for 'default' file field formatter. */ -function theme_field_formatter_file_default($element) { +function theme_field_formatter_file_default($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('file_link', (object) $element['#item']); } /** * Theme function for 'url_plain' file field formatter. */ -function theme_field_formatter_file_url_plain($element) { +function theme_field_formatter_file_url_plain($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return empty($element['#item']['uri']) ? '' : file_create_url($element['#item']['uri']); } /** * Theme function for the 'table' formatter. */ -function theme_field_formatter_file_table($element) { +function theme_field_formatter_file_table($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Attachment'), t('Size')); $rows = array(); foreach (element_children($element) as $key) { 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 15 Sep 2009 19:00:44 -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), ), ); } @@ -577,7 +577,10 @@ function file_managed_file_save_upload($ /** * Theme a managed file element. */ -function theme_file_managed_file($element) { +function theme_file_managed_file($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // This wrapper is required to apply JS behaviors and CSS styling. $output = ''; $output .= '
      '; @@ -592,7 +595,10 @@ function theme_file_managed_file($elemen * @param $file * A file object to which the link will be created. */ -function theme_file_link($file) { +function theme_file_link($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $url = file_create_url($file->uri); $icon = theme('file_icon', $file); @@ -622,7 +628,10 @@ function theme_file_link($file) { * @param $file * A file object for which to make an icon. */ -function theme_file_icon($file) { +function theme_file_icon($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $mime = check_plain($file->filemime); $icon_url = file_icon_url($file); return ''; Index: modules/filter/filter.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v retrieving revision 1.44 diff -u -p -r1.44 filter.admin.inc --- modules/filter/filter.admin.inc 11 Sep 2009 15:39:48 -0000 1.44 +++ modules/filter/filter.admin.inc 15 Sep 2009 19:00:44 -0000 @@ -64,7 +64,10 @@ function filter_admin_overview_submit($f * * @ingroup themeable */ -function theme_filter_admin_overview($form) { +function theme_filter_admin_overview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $rows = array(); foreach (element_children($form) as $id) { $element = $form[$id]; @@ -359,7 +362,10 @@ function filter_admin_order(&$form_state * * @ingroup themeable */ -function theme_filter_admin_order($form) { +function theme_filter_admin_order($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Name'), t('Weight')); $rows = array(); foreach (element_children($form['names']) as $id) { Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.289 diff -u -p -r1.289 filter.module --- modules/filter/filter.module 12 Sep 2009 06:09:45 -0000 1.289 +++ modules/filter/filter.module 15 Sep 2009 19:00:44 -0000 @@ -781,7 +781,10 @@ function theme_filter_tips_more_info() { * * @ingroup themeable */ -function theme_filter_guidelines($format) { +function theme_filter_guidelines($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $name = isset($format->name) ? '' : ''; return '
      ' . $name . theme('filter_tips', _filter_tips($format->format, FALSE)) . '
      '; } 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 15 Sep 2009 19:00:44 -0000 @@ -48,7 +48,10 @@ function filter_tips_long() { * @see _filter_tips() * @ingroup themeable */ -function theme_filter_tips($tips, $long = FALSE) { +function theme_filter_tips($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $multiple = count($tips) > 1; Index: modules/image/image.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.admin.inc,v retrieving revision 1.10 diff -u -p -r1.10 image.admin.inc --- modules/image/image.admin.inc 5 Sep 2009 15:05:02 -0000 1.10 +++ modules/image/image.admin.inc 15 Sep 2009 19:00:44 -0000 @@ -572,7 +572,10 @@ function image_rotate_form($data) { * @see image_get_styles() * @ingroup themeable */ -function theme_image_style_list($styles) { +function theme_image_style_list($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Style name'), array('data' => t('Operations'), 'colspan' => 3)); $rows = array(); foreach ($styles as $style) { @@ -605,7 +608,10 @@ function theme_image_style_list($styles) * An associative array containing the structure of the effects group. * @ingroup themeable */ -function theme_image_style_effects($form) { +function theme_image_style_effects($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $rows = array(); foreach (element_children($form) as $key) { @@ -658,7 +664,10 @@ function theme_image_style_effects($form * The image style array being previewed. * @ingroup themeable */ -function theme_image_style_preview($style) { +function theme_image_style_preview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $sample_image = variable_get('image_style_preview_image', drupal_get_path('module', 'image') . '/sample.png'); $sample_width = 160; $sample_height = 160; @@ -730,7 +739,10 @@ function theme_image_style_preview($styl * A Form API element containing radio buttons. * @ingroup themeable */ -function theme_image_anchor($element) { +function theme_image_anchor($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $rows = array(); $row = array(); foreach (element_children($element) as $n => $key) { @@ -753,7 +765,10 @@ function theme_image_anchor($element) { * The current configuration for this resize effect. * @ingroup themeable */ -function theme_image_resize_summary($data) { +function theme_image_resize_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + if ($data['width'] && $data['height']) { return check_plain($data['width']) . 'x' . check_plain($data['height']); } @@ -769,7 +784,10 @@ function theme_image_resize_summary($dat * The current configuration for this scale effect. * @ingroup themeable */ -function theme_image_scale_summary($data) { +function theme_image_scale_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('image_resize_summary', $data) . ' ' . ($data['upscale'] ? '(' . t('upscaling allowed') . ')' : ''); } @@ -780,7 +798,10 @@ function theme_image_scale_summary($data * The current configuration for this crop effect. * @ingroup themeable */ -function theme_image_crop_summary($data) { +function theme_image_crop_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('image_resize_summary', $data); } @@ -791,6 +812,9 @@ function theme_image_crop_summary($data) * The current configuration for this rotate effect. * @ingroup themeable */ -function theme_image_rotate_summary($data) { +function theme_image_rotate_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return ($data['random']) ? t('random between -@degrees° and @degrees°', array('@degrees' => str_replace('-', '', $data['degrees']))) : t('@degrees°', array('@degrees' => $data['degrees'])); } Index: modules/image/image.module =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.module,v retrieving revision 1.16 diff -u -p -r1.16 image.module --- modules/image/image.module 26 Aug 2009 03:20:39 -0000 1.16 +++ modules/image/image.module 15 Sep 2009 19:00:44 -0000 @@ -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) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // theme_image() can only honor the $getsize parameter with local file paths. // The derivative image is not created until it has been requested so the file // may not yet exist, in this case we just fallback to the URL. Index: modules/locale/locale.module =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v retrieving revision 1.258 diff -u -p -r1.258 locale.module --- modules/locale/locale.module 31 Aug 2009 17:06:09 -0000 1.258 +++ modules/locale/locale.module 15 Sep 2009 19:00:44 -0000 @@ -673,7 +673,10 @@ function locale_block_view($delta = '') * * @ingroup themeable */ -function theme_locale_translation_filters($form) { +function theme_locale_translation_filters($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; foreach (element_children($form['status']) as $key) { $output .= drupal_render($form['status'][$key]); Index: modules/menu/menu.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/menu/menu.admin.inc,v retrieving revision 1.57 diff -u -p -r1.57 menu.admin.inc --- modules/menu/menu.admin.inc 5 Sep 2009 15:05:03 -0000 1.57 +++ modules/menu/menu.admin.inc 15 Sep 2009 19:00:44 -0000 @@ -27,7 +27,10 @@ function menu_overview_page() { /** * Theme the menu title and description for admin page */ -function theme_menu_admin_overview($title, $name, $description) { +function theme_menu_admin_overview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = check_plain($title); $output .= '
      ' . filter_xss_admin($description) . '
      '; @@ -186,7 +189,10 @@ function menu_overview_form_submit($form * * @ingroup themeable */ -function theme_menu_overview_form($form) { +function theme_menu_overview_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_tabledrag('menu-overview', 'match', 'parent', 'menu-plid', 'menu-plid', 'menu-mlid', TRUE, MENU_MAX_DEPTH - 1); drupal_add_tabledrag('menu-overview', 'order', 'sibling', 'menu-weight'); Index: modules/node/content_types.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/content_types.inc,v retrieving revision 1.93 diff -u -p -r1.93 content_types.inc --- modules/node/content_types.inc 10 Sep 2009 22:10:10 -0000 1.93 +++ modules/node/content_types.inc 15 Sep 2009 19:00:44 -0000 @@ -47,7 +47,10 @@ function node_overview_types() { return $build; } -function theme_node_admin_overview($name, $type) { +function theme_node_admin_overview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = check_plain($name); $output .= ' (Machine name: ' . check_plain($type->type) . ')'; $output .= '
      ' . filter_xss_admin($type->description) . '
      '; Index: modules/node/node.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v retrieving revision 1.65 diff -u -p -r1.65 node.admin.inc --- modules/node/node.admin.inc 5 Sep 2009 06:53:01 -0000 1.65 +++ modules/node/node.admin.inc 15 Sep 2009 19:00:44 -0000 @@ -192,7 +192,10 @@ function node_filter_form() { * * @ingroup themeable */ -function theme_node_filter_form($form) { +function theme_node_filter_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $output .= '
      '; $output .= drupal_render($form['filters']); @@ -206,7 +209,10 @@ function theme_node_filter_form($form) { * * @ingroup themeable */ -function theme_node_filters($form) { +function theme_node_filters($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $output .= '
        '; if (!empty($form['current'])) { @@ -514,7 +520,10 @@ function node_admin_nodes_submit($form, * * @ingroup themeable */ -function theme_node_admin_nodes($form) { +function theme_node_admin_nodes($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $output .= drupal_render($form['options']); Index: modules/node/node.module =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.module,v retrieving revision 1.1122 diff -u -p -r1.1122 node.module --- modules/node/node.module 11 Sep 2009 04:06:39 -0000 1.1122 +++ modules/node/node.module 15 Sep 2009 19:00:44 -0000 @@ -282,7 +282,10 @@ function node_title_list($result, $title * * @ingroup themeable */ -function theme_node_list($items, $title = NULL) { +function theme_node_list($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('item_list', $items, $title); } @@ -1207,7 +1210,10 @@ function template_preprocess_node(&$vari * * @ingroup themeable */ -function theme_node_log_message($log) { +function theme_node_log_message($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return '
        ' . t('Log') . ':
        ' . $log . '
        '; } @@ -1508,7 +1514,10 @@ function node_user_cancel($edit, $accoun * * @ingroup themeable */ -function theme_node_search_admin($form) { +function theme_node_search_admin($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = drupal_render($form['info']); $header = array(t('Factor'), t('Weight')); Index: modules/node/node.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.pages.inc,v retrieving revision 1.79 diff -u -p -r1.79 node.pages.inc --- modules/node/node.pages.inc 5 Sep 2009 15:05:03 -0000 1.79 +++ modules/node/node.pages.inc 15 Sep 2009 19:00:44 -0000 @@ -32,7 +32,10 @@ function node_add_page() { * * @ingroup themeable */ -function theme_node_add_list($content) { +function theme_node_add_list($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; if ($content) { @@ -320,7 +323,10 @@ function node_form_build_preview($form, * * @ingroup themeable */ -function theme_node_form($form) { +function theme_node_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = "\n
        \n"; $output .= "
        \n"; @@ -379,7 +385,10 @@ function node_preview($node) { * * @ingroup themeable */ -function theme_node_preview($node) { +function theme_node_preview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = '
        '; $preview_trimmed_version = FALSE; Index: modules/poll/poll.module =================================================================== RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v retrieving revision 1.312 diff -u -p -r1.312 poll.module --- modules/poll/poll.module 10 Sep 2009 08:43:46 -0000 1.312 +++ modules/poll/poll.module 15 Sep 2009 19:00:44 -0000 @@ -747,7 +747,10 @@ function poll_view_results($node, $build * * @ingroup themeable */ -function theme_poll_choices($form) { +function theme_poll_choices($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_tabledrag('poll-choice-table', 'order', 'sibling', 'poll-weight'); $delta = 0; Index: modules/profile/profile.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/profile/profile.admin.inc,v retrieving revision 1.29 diff -u -p -r1.29 profile.admin.inc --- modules/profile/profile.admin.inc 22 Aug 2009 14:34:21 -0000 1.29 +++ modules/profile/profile.admin.inc 15 Sep 2009 19:00:44 -0000 @@ -96,7 +96,10 @@ function profile_admin_overview_submit($ * @ingroup themeable * @see profile_admin_overview() */ -function theme_profile_admin_overview($form) { +function theme_profile_admin_overview($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_css(drupal_get_path('module', 'profile') . '/profile.css'); // Add javascript if there's more than one field. if (isset($form['submit'])) { 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 15 Sep 2009 19:00:44 -0000 @@ -56,7 +56,10 @@ function search_view($type = 'node') { * @return * A string containing the listing output. */ -function theme_search_results_listing($title, $content) { +function theme_search_results_listing($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = '

        ' . $title . '

        ' . $content . '
        '; return $output; } Index: modules/simpletest/simpletest.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.pages.inc,v retrieving revision 1.16 diff -u -p -r1.16 simpletest.pages.inc --- modules/simpletest/simpletest.pages.inc 11 Sep 2009 01:53:29 -0000 1.16 +++ modules/simpletest/simpletest.pages.inc 15 Sep 2009 19:00:44 -0000 @@ -65,7 +65,10 @@ function simpletest_test_form() { * @param $table Form array that represent a table. * @return HTML output. */ -function theme_simpletest_test_table($table) { +function theme_simpletest_test_table($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css'); drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js'); @@ -362,7 +365,10 @@ function simpletest_result_form_submit($ * * @return HTML output. */ -function theme_simpletest_result_summary($form) { +function theme_simpletest_result_summary($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return '
        ' . _simpletest_format_summary_line($form) . '
        '; } 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 15 Sep 2009 19:00:45 -0000 @@ -84,7 +84,10 @@ function common_test_theme() { /** * Theme function for testing drupal_render() theming. */ -function theme_common_test_foo($foo, $bar) { +function theme_common_test_foo($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return $foo . $bar; } Index: modules/simpletest/tests/field_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/field_test.module,v retrieving revision 1.22 diff -u -p -r1.22 field_test.module --- modules/simpletest/tests/field_test.module 10 Sep 2009 06:31:39 -0000 1.22 +++ modules/simpletest/tests/field_test.module 15 Sep 2009 19:00:45 -0000 @@ -561,7 +561,10 @@ function field_test_theme() { /** * Theme function for 'field_test_default' formatter. */ -function theme_field_formatter_field_test_default($element) { +function theme_field_formatter_field_test_default($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $value = $element['#item']['value']; $settings = $element['#settings']; @@ -571,7 +574,10 @@ function theme_field_formatter_field_tes /** * Theme function for 'field_test_multiple' formatter. */ -function theme_field_formatter_field_test_multiple($element) { +function theme_field_formatter_field_test_multiple($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $settings = $element['#settings']; $items = array(); 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 15 Sep 2009 19:00:45 -0000 @@ -93,7 +93,10 @@ function syslog_theme() { * * @ingroup themeable */ -function theme_syslog_format($entry) { +function theme_syslog_format($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + global $base_url; $message = $base_url; Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.201 diff -u -p -r1.201 system.admin.inc --- modules/system/system.admin.inc 11 Sep 2009 04:09:26 -0000 1.201 +++ modules/system/system.admin.inc 15 Sep 2009 19:00:45 -0000 @@ -1928,7 +1928,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']; @@ -1954,7 +1954,8 @@ function system_batch_page() { * include a 'title', a 'description' and a formatted 'content'. * @ingroup themeable */ -function theme_admin_block($block) { +function theme_admin_block($variables) { + extract($variables, EXTR_SKIP); // Don't display the block if it has no content to display. if (empty($block['show'])) { return ''; @@ -1995,7 +1996,8 @@ EOT; * include a 'title', a 'description' and a formatted 'content'. * @ingroup themeable */ -function theme_admin_block_content($content) { +function theme_admin_block_content($variables) { + extract($variables, EXTR_SKIP); if (!$content) { return ''; } @@ -2028,7 +2030,8 @@ 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) { + extract($variables, EXTR_SKIP); $stripe = 0; $container = array(); @@ -2064,7 +2067,8 @@ function theme_admin_page($blocks) { * An array of modules to be displayed. * @ingroup themeable */ -function theme_system_admin_by_module($menu_items) { +function theme_system_admin_by_module($variables) { + extract($variables, EXTR_SKIP); $stripe = 0; $output = ''; $container = array('left' => '', 'right' => ''); @@ -2112,7 +2116,8 @@ function theme_system_admin_by_module($m * An array of requirements. * @ingroup themeable */ -function theme_status_report($requirements) { +function theme_status_report($variables) { + extract($variables, EXTR_SKIP); $i = 0; $output = ''; foreach ($requirements as $requirement) { @@ -2149,7 +2154,8 @@ 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) { + extract($variables, EXTR_SKIP); // Individual table headers. $rows = array(); // Iterate through all the modules, which are @@ -2196,8 +2202,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'] . '
        '; } /** @@ -2209,7 +2215,8 @@ function theme_system_modules_incompatib * @return * An HTML string representing the table. */ -function theme_system_modules_uninstall($form) { +function theme_system_modules_uninstall($variables) { + extract($variables, EXTR_SKIP); // No theming for the confirm form. if (isset($form['confirm'])) { return drupal_render($form); @@ -2249,7 +2256,8 @@ 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) { + extract($variables, EXTR_SKIP); foreach (element_children($form) as $key) { // Only look for themes if (!isset($form[$key]['info'])) { Index: modules/system/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.module,v retrieving revision 1.789 diff -u -p -r1.789 system.module --- modules/system/system.module 11 Sep 2009 02:14:20 -0000 1.789 +++ modules/system/system.module 15 Sep 2009 19:00:45 -0000 @@ -2963,7 +2963,10 @@ function system_timezone($abbreviation = * * @ingroup themeable */ -function theme_system_powered_by($image_path) { +function theme_system_powered_by($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $image = theme('image', $image_path, t('Powered by Drupal, an open source content management system'), t('Powered by Drupal, an open source content management system')); return l($image, 'http://drupal.org', array('html' => TRUE, 'absolute' => TRUE, 'external' => TRUE)); } @@ -2992,7 +2995,10 @@ function theme_system_compact_link() { * * @ingroup themeable */ -function theme_meta_generator_html($version = VERSION) { +function theme_meta_generator_html($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_html_head(''); } @@ -3001,7 +3007,10 @@ function theme_meta_generator_html($vers * * @ingroup themeable */ -function theme_meta_generator_header($version = VERSION) { +function theme_meta_generator_header($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_set_header('X-Generator', 'Drupal ' . $version . ' (http://drupal.org)'); } @@ -3154,7 +3163,10 @@ function system_run_cron_image_access() * @see system_run_cron_image() * @ingroup themeable */ -function theme_system_run_cron_image($image_path) { +function theme_system_run_cron_image($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return ''; } Index: modules/taxonomy/taxonomy.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v retrieving revision 1.68 diff -u -p -r1.68 taxonomy.admin.inc --- modules/taxonomy/taxonomy.admin.inc 5 Sep 2009 15:05:04 -0000 1.68 +++ modules/taxonomy/taxonomy.admin.inc 15 Sep 2009 19:00:45 -0000 @@ -62,7 +62,10 @@ function taxonomy_overview_vocabularies_ * @ingroup themeable * @see taxonomy_overview_vocabularies() */ -function theme_taxonomy_overview_vocabularies($form) { +function theme_taxonomy_overview_vocabularies($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $rows = array(); foreach (element_children($form) as $key) { @@ -592,7 +595,10 @@ function taxonomy_overview_terms_submit( * @ingroup themeable * @see taxonomy_overview_terms() */ -function theme_taxonomy_overview_terms($form) { +function theme_taxonomy_overview_terms($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $page_increment = $form['#page_increment']; $page_entries = $form['#page_entries']; $back_peddle = $form['#back_peddle']; Index: modules/taxonomy/taxonomy.module =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v retrieving revision 1.510 diff -u -p -r1.510 taxonomy.module --- modules/taxonomy/taxonomy.module 10 Sep 2009 06:31:39 -0000 1.510 +++ modules/taxonomy/taxonomy.module 15 Sep 2009 19:00:45 -0000 @@ -1455,7 +1455,10 @@ function _taxonomy_term_select($title, $ * * @ingroup themeable */ -function theme_taxonomy_term_select($element) { +function theme_taxonomy_term_select($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + return theme('select', $element); } @@ -1876,7 +1879,10 @@ function taxonomy_field_formatter_info() /** * Theme function for 'link' term field formatter. */ -function theme_field_formatter_taxonomy_term_link($element) { +function theme_field_formatter_taxonomy_term_link($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $term = $element['#item']['taxonomy_term']; return l($term->name, taxonomy_term_path($term)); } @@ -1884,7 +1890,10 @@ function theme_field_formatter_taxonomy_ /** * Theme function for 'plain' term field formatter. */ -function theme_field_formatter_taxonomy_term_plain($element) { +function theme_field_formatter_taxonomy_term_plain($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $term = $element['#item']['taxonomy_term']; return $term->name; } Index: modules/trigger/trigger.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.admin.inc,v retrieving revision 1.16 diff -u -p -r1.16 trigger.admin.inc --- modules/trigger/trigger.admin.inc 1 Sep 2009 16:50:12 -0000 1.16 +++ modules/trigger/trigger.admin.inc 15 Sep 2009 19:00:45 -0000 @@ -266,7 +266,10 @@ function trigger_assign_form_submit($for * * @ingroup themeable */ -function theme_trigger_display($element) { +function theme_trigger_display($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(); $rows = array(); if (count($element['assigned']['#value'])) { Index: modules/trigger/trigger.module =================================================================== RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v retrieving revision 1.47 diff -u -p -r1.47 trigger.module --- modules/trigger/trigger.module 1 Sep 2009 16:50:12 -0000 1.47 +++ modules/trigger/trigger.module 15 Sep 2009 19:00:45 -0000 @@ -115,7 +115,7 @@ function _trigger_get_hook_aids($hook, $ 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.20 diff -u -p -r1.20 update.report.inc --- modules/update/update.report.inc 24 Aug 2009 00:42:34 -0000 1.20 +++ modules/update/update.report.inc 15 Sep 2009 19:00:45 -0000 @@ -25,7 +25,10 @@ function update_status() { * * @ingroup themeable */ -function theme_update_report($data) { +function theme_update_report($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $last = variable_get('update_last_check', 0); $output = '
        ' . ($last ? t('Last checked: @time ago', array('@time' => format_interval(REQUEST_TIME - $last))) : t('Last checked: never')); $output .= ' (' . l(t('Check manually'), 'admin/reports/updates/check') . ')'; @@ -227,7 +230,10 @@ function theme_update_report($data) { * * @ingroup themeable */ -function theme_update_version($version, $tag, $class) { +function theme_update_version($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; $output .= '
        '; $output .= ''; Index: modules/upload/upload.module =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v retrieving revision 1.257 diff -u -p -r1.257 upload.module --- modules/upload/upload.module 5 Sep 2009 15:05:05 -0000 1.257 +++ modules/upload/upload.module 15 Sep 2009 19:00:45 -0000 @@ -436,7 +436,10 @@ function upload_node_search_result($node * * @ingroup themeable */ -function theme_upload_attachments($elements) { +function theme_upload_attachments($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Attachment'), t('Size')); $rows = array(); foreach ($elements['#files'] as $file) { @@ -600,7 +603,10 @@ function _upload_form($node) { * * @ingroup themeable */ -function theme_upload_form_current($form) { +function theme_upload_form_current($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array('', t('Delete'), t('List'), t('Description'), t('Weight'), t('Size')); drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); @@ -627,7 +633,10 @@ function theme_upload_form_current($form * * @ingroup themeable */ -function theme_upload_form_new($form) { +function theme_upload_form_new($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + drupal_add_tabledrag('upload-attachments', 'order', 'sibling', 'upload-weight'); $output = drupal_render_children($form); return $output; Index: modules/user/user.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v retrieving revision 1.77 diff -u -p -r1.77 user.admin.inc --- modules/user/user.admin.inc 5 Sep 2009 15:05:05 -0000 1.77 +++ modules/user/user.admin.inc 15 Sep 2009 19:00:45 -0000 @@ -678,7 +678,10 @@ function user_admin_permissions_submit($ * * @ingroup themeable */ -function theme_user_admin_permissions($form) { +function theme_user_admin_permissions($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $roles = user_roles(); foreach (element_children($form['permission']) as $key) { $row = array(); @@ -804,7 +807,10 @@ function user_admin_role_submit($form, & * * @ingroup themeable */ -function theme_user_admin_account($form) { +function theme_user_admin_account($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + // Overview table: $header = array( theme('table_select_header_cell'), @@ -849,7 +855,10 @@ function theme_user_admin_account($form) * * @ingroup themeable */ -function theme_user_admin_new_role($form) { +function theme_user_admin_new_role($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $header = array(t('Name'), array('data' => t('Operations'), 'colspan' => 2)); foreach (user_roles() as $rid => $name) { $edit_permissions = l(t('edit permissions'), 'admin/config/people/permissions/' . $rid); @@ -873,7 +882,10 @@ function theme_user_admin_new_role($form * * @ingroup themeable */ -function theme_user_filter_form($form) { +function theme_user_filter_form($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = '
        '; $output .= drupal_render($form['filters']); $output .= '
        '; @@ -886,7 +898,10 @@ function theme_user_filter_form($form) { * * @ingroup themeable */ -function theme_user_filters($form) { +function theme_user_filters($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = '
          '; if (!empty($form['current'])) { foreach (element_children($form['current']) as $key) { Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.1043 diff -u -p -r1.1043 user.module --- modules/user/user.module 11 Sep 2009 06:20:49 -0000 1.1043 +++ modules/user/user.module 15 Sep 2009 19:00:45 -0000 @@ -1160,7 +1160,10 @@ function template_preprocess_user_pictur * * @ingroup themeable */ -function theme_user_list($users, $title = NULL) { +function theme_user_list($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + if (!empty($users)) { foreach ($users as $user) { $items[] = theme('username', $user); @@ -2693,7 +2696,10 @@ function user_comment_view($comment) { * * @ingroup themeable */ -function theme_user_signature($signature) { +function theme_user_signature($variables) { + extract($variables, EXTR_SKIP); + // @todo remove extract() if possible and check hook_theme defaults. + $output = ''; if ($signature) { $output .= '
          '; Index: themes/garland/template.php =================================================================== RCS file: /cvs/drupal/drupal/themes/garland/template.php,v retrieving revision 1.30 diff -u -p -r1.30 template.php --- themes/garland/template.php 11 Sep 2009 14:14:16 -0000 1.30 +++ themes/garland/template.php 15 Sep 2009 19:00:45 -0000 @@ -8,7 +8,8 @@ * An array containing the breadcrumb links. * @return a string containing the breadcrumb output. */ -function garland_breadcrumb($breadcrumb) { +function garland_breadcrumb($variables) { + extract($variables, EXTR_SKIP); if (!empty($breadcrumb)) { // Provide a navigational heading to give context for breadcrumb links to // screen-reader users. Make the heading invisible with .element-invisible. Index: themes/seven/template.php =================================================================== RCS file: /cvs/drupal/drupal/themes/seven/template.php,v retrieving revision 1.5 diff -u -p -r1.5 template.php --- themes/seven/template.php 22 Aug 2009 14:34:23 -0000 1.5 +++ themes/seven/template.php 15 Sep 2009 19:00:45 -0000 @@ -13,7 +13,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) { + extract($variables, EXTR_SKIP); $output = ''; if ($content) { $output = '
            '; @@ -33,7 +34,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) { + extract($variables, EXTR_SKIP); $output = ''; if (!empty($content)) { $output = system_admin_compact_mode() ? '
              ' : '
                '; @@ -55,7 +57,8 @@ 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) { + extract($variables, EXTR_SKIP); $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')); @@ -70,7 +73,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) { + extract($variables, EXTR_SKIP); if (!empty($element['#collapsible'])) { drupal_add_js('misc/collapse.js');