diff --git a/misc/drupal.css b/misc/drupal.css index 6484675c1bf..d235803e39d 100644 --- a/misc/drupal.css +++ b/misc/drupal.css @@ -406,6 +406,13 @@ dl.multiselect .form-item { float: right; margin: 0 1em 1em 0; } +.profile dt { + margin: 1em 0 0.2em 0; + font-weight: bold; +} +.profile dd { + margin:0; +} .node-form .poll-form fieldset { display: block; } diff --git a/modules/blog.module b/modules/blog.module index b8a2c9204fc..d561c6a9a44 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -42,11 +42,11 @@ function blog_access($op, $node) { */ function blog_user($type, &$edit, &$user) { if ($type == 'view' && user_access('edit own blog', $user)) { - $form['blog'] = array( - '#type' => 'item', '#title' => t('Blog'), - '#value' => l(t('view recent blog entries'), "blog/$user->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $user->name)))) + $items[] = array('title' => t('Blog'), + 'value' => l(t('view recent blog entries'), "blog/$user->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $user->name)))), + 'class' => 'blog', ); - return array(t('History') => $form); + return array(t('History') => $items); } } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index b8a2c9204fc..d561c6a9a44 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -42,11 +42,11 @@ function blog_access($op, $node) { */ function blog_user($type, &$edit, &$user) { if ($type == 'view' && user_access('edit own blog', $user)) { - $form['blog'] = array( - '#type' => 'item', '#title' => t('Blog'), - '#value' => l(t('view recent blog entries'), "blog/$user->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $user->name)))) + $items[] = array('title' => t('Blog'), + 'value' => l(t('view recent blog entries'), "blog/$user->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $user->name)))), + 'class' => 'blog', ); - return array(t('History') => $form); + return array(t('History') => $items); } } diff --git a/modules/profile.module b/modules/profile.module index 5560bba6ebb..c9cdfaa609c 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -315,11 +315,13 @@ function profile_view_profile($user) { if ($value = profile_view_field($user, $field)) { $description = ($field->visibility == PROFILE_PRIVATE) ? t('The content of this field is private and only visible to yourself.') : ''; $title = ($field->type != 'checkbox') ? check_plain($field->title) : ''; - $form = array('#title' => $title, '#value' => $value, '#description' => $description); - $fields[$field->category][$field->name] = theme('item', $form); + $item = array('title' => $title, + 'value' => $value, + 'class' => $field->name, + ); + $fields[$field->category][] = $item; } } - return $fields; } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 5560bba6ebb..c9cdfaa609c 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -315,11 +315,13 @@ function profile_view_profile($user) { if ($value = profile_view_field($user, $field)) { $description = ($field->visibility == PROFILE_PRIVATE) ? t('The content of this field is private and only visible to yourself.') : ''; $title = ($field->type != 'checkbox') ? check_plain($field->title) : ''; - $form = array('#title' => $title, '#value' => $value, '#description' => $description); - $fields[$field->category][$field->name] = theme('item', $form); + $item = array('title' => $title, + 'value' => $value, + 'class' => $field->name, + ); + $fields[$field->category][] = $item; } } - return $fields; } diff --git a/modules/user.module b/modules/user.module index 4ac21d46ee5..333d10d4943 100644 --- a/modules/user.module +++ b/modules/user.module @@ -459,8 +459,12 @@ function user_search($op = 'search', $keys = null) { */ function user_user($type, &$edit, &$user, $category = NULL) { if ($type == 'view') { - $form['member'] = array('#type' => 'item', '#title' => t('Member for'), '#value' => format_interval(time() - $user->created)); - return array(t('History') => array('history'=> drupal_get_form('member', $form))); + $items[] = array('title' => t('Member for'), + 'value' => format_interval(time() - $user->created), + 'class' => 'member', + ); + + return array(t('History') => $items); } if ($type == 'form' && $category == 'account') { @@ -612,19 +616,24 @@ function theme_user_picture($account) { /** * Theme a user page * @param $account the user object - * @param $fields an mulidimensional array for the fields, in the form of - * array('category1'=> array('name1' => field1, 'name2' => field2), - * 'category2'=> array('name3' => field3, 'name4' => field4, 'name5' => field5), - * .. etc); + * @param $fields a multidimensional array for the fields, in the form of array ( + * 'category1' => array(item_array1, item_array2), 'category2' => array(item_array3, + * .. etc.). Item arrays are formatted as array(array('title' => 'item title', + * 'value' => 'item value', 'class' => 'class-name'), ... etc.). Module names are incorporated + * into the CSS class. * * @ingroup themeable */ function theme_user_profile($account, $fields) { $output = "
\n"; $output .= theme('user_picture', $account); - foreach ($fields as $category => $value) { - $value = implode('', $value); - $output .= theme('box', $category, $value); + foreach ($fields as $category => $items) { + $output .= "

$category

\n"; + $output .= '
'; + foreach ($items as $item) { + $output .= sprintf('
%s:
%s
', $item['class'], $item['title'], $item['class'], $item['value']); + } + $output .= '
'; } $output .= "
\n"; @@ -1304,8 +1313,11 @@ function user_view($uid = 0) { $fields = array(); foreach (module_list() as $module) { if ($data = module_invoke($module, 'user', 'view', '', $account)) { - foreach ($data as $category => $content) { - $fields[$category] = $content; + foreach ($data as $category => $items) { + foreach ($items as $item) { + $item['class'] = "$module-". $item['class']; + $fields[$category][] = $item; + } } } } @@ -1942,5 +1954,3 @@ function user_autocomplete($string) { print drupal_implode_autocomplete($matches); exit(); } - - diff --git a/modules/user/user.module b/modules/user/user.module index 4ac21d46ee5..333d10d4943 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -459,8 +459,12 @@ function user_search($op = 'search', $keys = null) { */ function user_user($type, &$edit, &$user, $category = NULL) { if ($type == 'view') { - $form['member'] = array('#type' => 'item', '#title' => t('Member for'), '#value' => format_interval(time() - $user->created)); - return array(t('History') => array('history'=> drupal_get_form('member', $form))); + $items[] = array('title' => t('Member for'), + 'value' => format_interval(time() - $user->created), + 'class' => 'member', + ); + + return array(t('History') => $items); } if ($type == 'form' && $category == 'account') { @@ -612,19 +616,24 @@ function theme_user_picture($account) { /** * Theme a user page * @param $account the user object - * @param $fields an mulidimensional array for the fields, in the form of - * array('category1'=> array('name1' => field1, 'name2' => field2), - * 'category2'=> array('name3' => field3, 'name4' => field4, 'name5' => field5), - * .. etc); + * @param $fields a multidimensional array for the fields, in the form of array ( + * 'category1' => array(item_array1, item_array2), 'category2' => array(item_array3, + * .. etc.). Item arrays are formatted as array(array('title' => 'item title', + * 'value' => 'item value', 'class' => 'class-name'), ... etc.). Module names are incorporated + * into the CSS class. * * @ingroup themeable */ function theme_user_profile($account, $fields) { $output = "
\n"; $output .= theme('user_picture', $account); - foreach ($fields as $category => $value) { - $value = implode('', $value); - $output .= theme('box', $category, $value); + foreach ($fields as $category => $items) { + $output .= "

$category

\n"; + $output .= '
'; + foreach ($items as $item) { + $output .= sprintf('
%s:
%s
', $item['class'], $item['title'], $item['class'], $item['value']); + } + $output .= '
'; } $output .= "
\n"; @@ -1304,8 +1313,11 @@ function user_view($uid = 0) { $fields = array(); foreach (module_list() as $module) { if ($data = module_invoke($module, 'user', 'view', '', $account)) { - foreach ($data as $category => $content) { - $fields[$category] = $content; + foreach ($data as $category => $items) { + foreach ($items as $item) { + $item['class'] = "$module-". $item['class']; + $fields[$category][] = $item; + } } } } @@ -1942,5 +1954,3 @@ function user_autocomplete($string) { print drupal_implode_autocomplete($matches); exit(); } - -