theme_user_profile

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/user/user.module, строка 664

Версии
5
theme_user_profile($account, $fields)
6
theme_user_profile($account)

Theme a user page

Параметры

$account the user object

$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.

Связанные темы

Код

<?php
function theme_user_profile($account, $fields) {
  $output = '<div class="profile">';
  $output .= theme('user_picture', $account);
  foreach ($fields as $category => $items) {
    if (strlen($category) > 0) {
      $output .= '<h2 class="title">'. check_plain($category) .'</h2>';
    }
    $output .= '<dl>';
    foreach ($items as $item) {
      if (isset($item['title'])) {
        $output .= '<dt class="'. $item['class'] .'">'. $item['title'] .'</dt>';
      }
      $output .= '<dd class="'. $item['class'] .'">'. $item['value'] .'</dd>';
    }
    $output .= '</dl>';
  }
  $output .= '</div>';

  return $output;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему