';
}
/**
@@ -1871,50 +1853,47 @@ 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;
- if (theme_get_setting('toggle_comment_user_verification')) {
- $variables['object']->extra = ' (' . t('not verified') . ')';
- }
+ $variables['uid'] = 0;
+ if (theme_get_setting('toggle_comment_user_verification')) {
+ $variables['extra'] = ' (' . t('not verified') . ')';
+ }
}
else {
- $variables['object']->uid = (int)$account->uid;
+ $variables['uid'] = (int)$account->uid;
}
if (empty($account->name)) {
- $variables['object']->name = variable_get('anonymous', t('Anonymous'));
+ $variables['name'] = variable_get('anonymous', t('Anonymous'));
}
else {
- $variables['object']->name = $account->name;
+ $variables['name'] = $account->name;
}
- $variables['object']->profile_access = user_access('access user profiles');
- $variables['object']->link_attributes = array();
+ $variables['profile_access'] = user_access('access user profiles');
+ $variables['link_attributes'] = array();
// Populate link path and attributes if appropriate.
- if ($variables['object']->uid && $variables['object']->profile_access) {
+ if ($variables['uid'] && $variables['profile_access']) {
// We are linking to a local user.
- $variables['object']->link_attributes = array('title' => t('View user profile.'));
- $variables['object']->link_path = 'user/' . $variables['object']->uid;
+ $variables['link_attributes'] = array('title' => t('View user profile.'));
+ $variables['link_path'] = 'user/' . $variables['uid'];
}
elseif (!empty($account->homepage)) {
- $variables['object']->link_attributes = array('rel' => 'nofollow');
- $variables['object']->link_path = $account->homepage;
- $variables['object']->homepage = $account->homepage;
+ $variables['link_attributes'] = array('rel' => 'nofollow');
+ $variables['link_path'] = $account->homepage;
+ $variables['homepage'] = $account->homepage;
}
// We do not want the l() function to check_plain() a second time.
- $variables['object']->link_options['html'] = TRUE;
+ $variables['link_options']['html'] = TRUE;
// Set a default class.
- $variables['object']->attributes = array('class' => array('username'));
+ $variables['attributes_array'] = array('class' => array('username'));
// Shorten the name when it is too long or it will break many tables.
- if (drupal_strlen($variables['object']->name) > 20) {
- $variables['object']->name = drupal_substr($variables['object']->name, 0, 15) . '...';
+ if (drupal_strlen($variables['name']) > 20) {
+ $variables['name'] = drupal_substr($variables['name'], 0, 15) . '...';
}
// Make sure name is safe for use in the theme function.
- $variables['object']->name = check_plain($variables['object']->name);
+ $variables['name'] = check_plain($variables['name']);
}
/**
@@ -1926,8 +1905,8 @@ function template_process_username(&$variables) {
// 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'];
}
}
@@ -1946,18 +1925,18 @@ function template_process_username(&$variables) {
* @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;
}
@@ -1972,11 +1951,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 = '
';
if (!empty($form['current'])) {
@@ -514,7 +520,10 @@ function node_admin_nodes_submit($form, &$form_state) {
*
* @ingroup themeable
*/
-function theme_node_admin_nodes($form) {
+function theme_node_admin_nodes($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$output = '';
$output .= drupal_render($form['options']);
diff --git modules/node/node.module modules/node/node.module
index 01edf2a..129fb81 100644
--- modules/node/node.module
+++ modules/node/node.module
@@ -282,7 +282,10 @@ function node_title_list($result, $title = NULL) {
*
* @ingroup themeable
*/
-function theme_node_list($items, $title = NULL) {
+function theme_node_list($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
return theme('item_list', $items, $title);
}
@@ -1203,7 +1206,10 @@ function template_preprocess_node(&$variables) {
*
* @ingroup themeable
*/
-function theme_node_log_message($log) {
+function theme_node_log_message($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
return '
' . t('Log') . ':
' . $log . '
';
}
@@ -1504,7 +1510,10 @@ function node_user_cancel($edit, $account, $method) {
*
* @ingroup themeable
*/
-function theme_node_search_admin($form) {
+function theme_node_search_admin($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$output = drupal_render($form['info']);
$header = array(t('Factor'), t('Weight'));
diff --git modules/node/node.pages.inc modules/node/node.pages.inc
index 8458627..d4c19b5 100644
--- modules/node/node.pages.inc
+++ modules/node/node.pages.inc
@@ -32,7 +32,10 @@ function node_add_page() {
*
* @ingroup themeable
*/
-function theme_node_add_list($content) {
+function theme_node_add_list($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$output = '';
if ($content) {
@@ -320,7 +323,10 @@ function node_form_build_preview($form, &$form_state) {
*
* @ingroup themeable
*/
-function theme_node_form($form) {
+function theme_node_form($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$output = "\n
\n";
$output .= "
\n";
@@ -379,7 +385,10 @@ function node_preview($node) {
*
* @ingroup themeable
*/
-function theme_node_preview($node) {
+function theme_node_preview($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$output = '
';
$preview_trimmed_version = FALSE;
diff --git modules/poll/poll.module modules/poll/poll.module
index 3bb5fc0..fc5bf3d 100644
--- modules/poll/poll.module
+++ modules/poll/poll.module
@@ -747,7 +747,10 @@ function poll_view_results($node, $build_mode, $block = FALSE) {
*
* @ingroup themeable
*/
-function theme_poll_choices($form) {
+function theme_poll_choices($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
drupal_add_tabledrag('poll-choice-table', 'order', 'sibling', 'poll-weight');
$delta = 0;
diff --git modules/profile/profile.admin.inc modules/profile/profile.admin.inc
index a9a03a7..c682b5e 100644
--- modules/profile/profile.admin.inc
+++ modules/profile/profile.admin.inc
@@ -95,7 +95,10 @@ function profile_admin_overview_submit($form, &$form_state) {
* @ingroup themeable
* @see profile_admin_overview()
*/
-function theme_profile_admin_overview($form) {
+function theme_profile_admin_overview($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
drupal_add_css(drupal_get_path('module', 'profile') . '/profile.css');
// Add javascript if there's more than one field.
if (isset($form['submit'])) {
diff --git modules/search/search.pages.inc modules/search/search.pages.inc
index 801b077..2e2deaa 100644
--- modules/search/search.pages.inc
+++ modules/search/search.pages.inc
@@ -56,7 +56,10 @@ function search_view($type = 'node') {
* @return
* A string containing the listing output.
*/
-function theme_search_results_listing($title, $content) {
+function theme_search_results_listing($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$output = '
' . $title . '
' . $content . '
';
return $output;
}
diff --git modules/simpletest/simpletest.pages.inc modules/simpletest/simpletest.pages.inc
index 8370e04..97cd34e 100644
--- modules/simpletest/simpletest.pages.inc
+++ modules/simpletest/simpletest.pages.inc
@@ -63,7 +63,10 @@ function simpletest_test_form($form) {
* @param $table Form array that represent a table.
* @return HTML output.
*/
-function theme_simpletest_test_table($table) {
+function theme_simpletest_test_table($variables) {
+ 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');
@@ -358,7 +361,10 @@ function simpletest_result_form_submit($form, &$form_state) {
*
* @return HTML output.
*/
-function theme_simpletest_result_summary($form) {
+function theme_simpletest_result_summary($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
return '
' . _simpletest_format_summary_line($form) . '
';
}
diff --git modules/simpletest/tests/common_test.module modules/simpletest/tests/common_test.module
index 1b2464b..baa8331 100644
--- modules/simpletest/tests/common_test.module
+++ modules/simpletest/tests/common_test.module
@@ -84,7 +84,10 @@ function common_test_theme() {
/**
* Theme function for testing drupal_render() theming.
*/
-function theme_common_test_foo($foo, $bar) {
+function theme_common_test_foo($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
return $foo . $bar;
}
diff --git modules/simpletest/tests/field_test.module modules/simpletest/tests/field_test.module
index 7b3755d..4b56856 100644
--- modules/simpletest/tests/field_test.module
+++ modules/simpletest/tests/field_test.module
@@ -559,7 +559,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'];
@@ -569,7 +572,10 @@ function theme_field_formatter_field_test_default($element) {
/**
* Theme function for 'field_test_multiple' formatter.
*/
-function theme_field_formatter_field_test_multiple($element) {
+function theme_field_formatter_field_test_multiple($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$settings = $element['#settings'];
$items = array();
diff --git modules/syslog/syslog.module modules/syslog/syslog.module
index 5b1805d..c9cd552 100644
--- modules/syslog/syslog.module
+++ modules/syslog/syslog.module
@@ -93,7 +93,10 @@ function syslog_theme() {
*
* @ingroup themeable
*/
-function theme_syslog_format($entry) {
+function theme_syslog_format($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
global $base_url;
$message = $base_url;
diff --git modules/system/system.admin.inc modules/system/system.admin.inc
index 32edba8..765420a 100644
--- modules/system/system.admin.inc
+++ modules/system/system.admin.inc
@@ -1924,7 +1924,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'];
@@ -1950,7 +1950,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 '';
@@ -1991,7 +1992,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 '';
}
@@ -2024,7 +2026,8 @@ function theme_admin_block_content($content) {
* in. This is usually 'left' or 'right'.
* @ingroup themeable
*/
-function theme_admin_page($blocks) {
+function theme_admin_page($variables) {
+ extract($variables, EXTR_SKIP);
$stripe = 0;
$container = array();
@@ -2060,7 +2063,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' => '');
@@ -2108,7 +2112,8 @@ function theme_system_admin_by_module($menu_items) {
* An array of requirements.
* @ingroup themeable
*/
-function theme_status_report($requirements) {
+function theme_status_report($variables) {
+ extract($variables, EXTR_SKIP);
$i = 0;
$output = '
';
foreach ($requirements as $requirement) {
@@ -2145,7 +2150,8 @@ function theme_status_report($requirements) {
* An associative array containing the structure of the form.
* @ingroup themeable
*/
-function theme_system_modules_fieldset($form) {
+function theme_system_modules_fieldset($variables) {
+ extract($variables, EXTR_SKIP);
// Individual table headers.
$rows = array();
// Iterate through all the modules, which are
@@ -2192,8 +2198,8 @@ function theme_system_modules_fieldset($form) {
* @return
* An HTML string for the message.
*/
-function theme_system_modules_incompatible($message) {
- return '
';
@@ -885,7 +897,10 @@ function theme_user_filter_form($form) {
*
* @ingroup themeable
*/
-function theme_user_filters($form) {
+function theme_user_filters($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
$output = '
';
if (!empty($form['current'])) {
foreach (element_children($form['current']) as $key) {
diff --git modules/user/user.module modules/user/user.module
index 2748d8e..e37f397 100644
--- modules/user/user.module
+++ modules/user/user.module
@@ -1148,7 +1148,10 @@ function template_preprocess_user_picture(&$variables) {
*
* @ingroup themeable
*/
-function theme_user_list($users, $title = NULL) {
+function theme_user_list($variables) {
+ extract($variables, EXTR_SKIP);
+ // @todo remove extract() if possible and check hook_theme defaults.
+
if (!empty($users)) {
foreach ($users as $user) {
$items[] = theme('username', $user);
@@ -2731,7 +2734,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 .= '
';
diff --git themes/garland/template.php themes/garland/template.php
index d9b7294..df8cd1d 100644
--- themes/garland/template.php
+++ themes/garland/template.php
@@ -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.
diff --git themes/seven/template.php themes/seven/template.php
index 4c2bf77..04cdbc6 100644
--- themes/seven/template.php
+++ themes/seven/template.php
@@ -15,7 +15,8 @@ function seven_preprocess_page(&$vars) {
/**
* Display the list of available node types for node creation.
*/
-function seven_node_add_list($content) {
+function seven_node_add_list($variables) {
+ extract($variables, EXTR_SKIP);
$output = '';
if ($content) {
$output = '
';
@@ -35,7 +36,8 @@ function seven_node_add_list($content) {
*
* Use unordered list markup in both compact and extended move.
*/
-function seven_admin_block_content($content) {
+function seven_admin_block_content($variables) {
+ extract($variables, EXTR_SKIP);
$output = '';
if (!empty($content)) {
$output = system_admin_compact_mode() ? '
' : '
';
@@ -57,7 +59,8 @@ function seven_admin_block_content($content) {
*
* 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'));
@@ -72,7 +75,8 @@ function seven_tablesort_indicator($style) {
*
* 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');