You are here

function theme_og_picture_grid in Organic groups 5

Same name and namespace in other branches
  1. 5.8 og.module \theme_og_picture_grid()
  2. 5.2 og.module \theme_og_picture_grid()
  3. 5.3 og.module \theme_og_picture_grid()
  4. 5.7 og.module \theme_og_picture_grid()
1 theme call to theme_og_picture_grid()
og_list_users_faces_page in ./og.module

File

./og.module, line 996

Code

function theme_og_picture_grid($result, $column_count = 5) {
  $content = '<table class="og-picture-grid">';
  $count = 0;
  $total = db_num_rows($result);
  while ($user = db_fetch_object($result)) {
    $classes = 'og-picture-grid-item';
    if ($count < $column_count) {
      $classes .= ' first';
    }
    $item = '';
    if ($count % $column_count == 0) {
      $content .= '<tr>';
    }
    $picture = theme('user_picture', $user);
    $name = theme('username', $user);
    $group_role = $user->is_admin ? t('admin') : '&nbsp;';
    $content .= "<td class=\"{$classes}\">{$picture}<div class=\"og-name\">{$name}</div>";
    if ($user->is_admin) {
      $txt = t('admin');
      $content .= "<div class=\"group-role\">{$txt}</div>";
    }
    $content .= "</td>\n";
    $count++;
    if ($count % $column_count == 0 || $count == $total) {
      $content .= '</tr>';
    }
  }
  $content .= '</table>';
  if ($content) {
    return $content;
  }
}