diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-09 01:00:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-09 01:00:08 +0000 |
commit | c05f2181dc8556cb6700e8c6bb6e6ded43273192 (patch) | |
tree | 5446facb7f5f18dfaac48aade56c0d86f1477fff /modules/profile | |
parent | 48dd14a898420ae98984c951f59e8d299080bee8 (diff) | |
download | brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.gz brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.bz2 |
- Patch #572618 by effulgentsia, pwolanin, sun: all theme functions should take a single argument. Code clean-up and performance improvement. Woot.
Diffstat (limited to 'modules/profile')
-rw-r--r-- | modules/profile/profile.admin.inc | 6 | ||||
-rw-r--r-- | modules/profile/profile.module | 8 | ||||
-rw-r--r-- | modules/profile/profile.pages.inc | 14 |
3 files changed, 15 insertions, 13 deletions
diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index a9303e6e7..227e10881 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -95,7 +95,9 @@ 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) { + $form = $variables['form']; + drupal_add_css(drupal_get_path('module', 'profile') . '/profile.css'); // Add javascript if there's more than one field. if (isset($form['submit'])) { @@ -156,7 +158,7 @@ function theme_profile_admin_overview($form) { } $header[] = array('data' => t('Operations'), 'colspan' => 2); - $output = theme('table', $header, $rows, array('id' => 'profile-fields')); + $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'profile-fields'))); $output .= drupal_render_children($form); return $output; diff --git a/modules/profile/profile.module b/modules/profile/profile.module index da9b34f0b..2ff780480 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -193,7 +193,7 @@ function profile_block_view($delta = '') { if (!empty($fields)) { $profile = _profile_update_user_fields($fields, $account); - $output .= theme('profile_block', $account, $profile, TRUE); + $output .= theme('profile_block', array('account' => $account, 'fields' => $profile)); } if (isset($use_fields['user_profile']) && $use_fields['user_profile']) { @@ -525,7 +525,7 @@ function profile_category_access($account, $category) { */ function template_preprocess_profile_block(&$variables) { - $variables['user_picture'] = theme('user_picture', $variables['account']); + $variables['user_picture'] = theme('user_picture', array('account' => $variables['account'])); $variables['profile'] = array(); // Supply filtered version of $fields that have values. foreach ($variables['fields'] as $field) { @@ -549,8 +549,8 @@ function template_preprocess_profile_block(&$variables) { */ function template_preprocess_profile_listing(&$variables) { - $variables['user_picture'] = theme('user_picture', $variables['account']); - $variables['name'] = theme('username', $variables['account']); + $variables['user_picture'] = theme('user_picture', array('account' => $variables['account'])); + $variables['name'] = theme('username', array('account' => $variables['account'])); $variables['profile'] = array(); // Supply filtered version of $fields that have values. foreach ($variables['fields'] as $field) { diff --git a/modules/profile/profile.pages.inc b/modules/profile/profile.pages.inc index 300e57cae..8c60c68f7 100644 --- a/modules/profile/profile.pages.inc +++ b/modules/profile/profile.pages.inc @@ -71,13 +71,13 @@ function profile_browse() { $content = ''; foreach ($users as $account) { $profile = _profile_update_user_fields($fields, $account); - $content .= theme('profile_listing', $account, $profile); + $content .= theme('profile_listing', array('account' => $account, 'fields' => $profile)); } - $output = theme('profile_wrapper', $content); - $output .= theme('pager', NULL); + $output = theme('profile_wrapper', array('content' => $content)); + $output .= theme('pager', array('tags' => NULL)); if ($field->type == 'selection' || $field->type == 'list' || $field->type == 'textfield') { - $title = strtr(check_plain($field->page), array('%value' => theme('placeholder', $value))); + $title = strtr(check_plain($field->page), array('%value' => theme('placeholder', array('text' => $value)))); } else { $title = check_plain($field->page); @@ -108,10 +108,10 @@ function profile_browse() { $content = ''; foreach ($users as $account) { $profile = _profile_update_user_fields($fields, $account); - $content .= theme('profile_listing', $account, $profile); + $content .= theme('profile_listing', array('account' => $account, 'fields' => $profile)); } - $output = theme('profile_wrapper', $content); - $output .= theme('pager', NULL); + $output = theme('profile_wrapper', array('content' => $content)); + $output .= theme('pager', array('tags' => NULL)); drupal_set_title(t('User list')); return $output; |