diff options
| author | Cullen Walsh <ckwalsh@cullenwalsh.com> | 2011-06-18 23:49:04 -0700 |
|---|---|---|
| committer | Cullen Walsh <ckwalsh@cullenwalsh.com> | 2012-03-18 22:21:36 +0000 |
| commit | 8416bf3dc9539df19530e3bef85352d40ac795f2 (patch) | |
| tree | 07b35f758700cf3700db2f0585fb08b2a8f9b0ed /phpBB/includes/avatar/driver | |
| parent | a06380c69a154659f4f9985238008640670669e0 (diff) | |
| download | forums-8416bf3dc9539df19530e3bef85352d40ac795f2.tar forums-8416bf3dc9539df19530e3bef85352d40ac795f2.tar.gz forums-8416bf3dc9539df19530e3bef85352d40ac795f2.tar.bz2 forums-8416bf3dc9539df19530e3bef85352d40ac795f2.tar.xz forums-8416bf3dc9539df19530e3bef85352d40ac795f2.zip | |
[feature/avatars] Made ACP avatar gallery in Manage Users prettier
Added row/column information so avatars can be displayed nicely in
the ACP
PHPBB3-10018
Diffstat (limited to 'phpBB/includes/avatar/driver')
| -rw-r--r-- | phpBB/includes/avatar/driver/local.php | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/phpBB/includes/avatar/driver/local.php b/phpBB/includes/avatar/driver/local.php index edd62696f0..85eda96018 100644 --- a/phpBB/includes/avatar/driver/local.php +++ b/phpBB/includes/avatar/driver/local.php @@ -51,7 +51,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver { $avatar_list = $this->get_avatar_list(); $category = request_var('av_local_cat', ''); - + $categories = array_keys($avatar_list); foreach ($categories as $cat) @@ -67,13 +67,33 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver if (!empty($avatar_list[$category])) { - foreach ($avatar_list[$category] as $img => $data) + $table_cols = isset($row['av_gallery_cols']) ? $row['av_gallery_cols'] : 4; + $row_count = $col_count = $av_pos = 0; + $av_count = sizeof($avatar_list[$category]); + + reset($avatar_list[$category]); + + while ($av_pos < $av_count) { - $template->assign_block_vars('av_local_imgs', array( - 'AVATAR_IMAGE' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $data['file'], - 'AVATAR_NAME' => $data['name'], - 'AVATAR_FILE' => $data['filename'], + $img = current($avatar_list[$category]); + next($avatar_list[$category]); + + if ($col_count == 0) + { + ++$row_count; + $template->assign_block_vars('av_local_row', array( + )); + } + + $template->assign_block_vars('av_local_row.av_local_col', array( + 'AVATAR_IMAGE' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $img['file'], + 'AVATAR_NAME' => $img['name'], + 'AVATAR_FILE' => $img['filename'], )); + + $col_count = ($col_count + 1) % $table_cols; + + ++$av_pos; } } |
