diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-02-03 20:59:39 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-02-03 20:59:39 +0000 |
commit | bd30d226a583276f627d844fca46a7645dcce4fd (patch) | |
tree | 40e85c7a434d3789d1d3dace8831e18ce70a5c97 /phpBB/includes/functions_admin.php | |
parent | dd865bb517bb6c3f5ff1da910d4ed3ab19e650b0 (diff) | |
download | forums-bd30d226a583276f627d844fca46a7645dcce4fd.tar forums-bd30d226a583276f627d844fca46a7645dcce4fd.tar.gz forums-bd30d226a583276f627d844fca46a7645dcce4fd.tar.bz2 forums-bd30d226a583276f627d844fca46a7645dcce4fd.tar.xz forums-bd30d226a583276f627d844fca46a7645dcce4fd.zip |
- ability to change anonymous user settings more easily
- fix serious bugs in permissions (always allowing if permissions explicitly set and getting wrong permission options from bitfield)
- added option for returning an array to make_forum_select
- again fixing bugs in module system (one for a very query consuming part and one for correctly filling the cache)
git-svn-id: file:///svn/phpbb/trunk@5517 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r-- | phpBB/includes/functions_admin.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index c4730fd5ee..0061a236db 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -109,7 +109,7 @@ function recalc_btree($sql_id, $sql_table, $module_class = '') /** * Simple version of jumpbox, just lists authed forums */ -function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true) +function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $return_array = false) { global $db, $user, $auth; @@ -123,7 +123,8 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = $right = $iteration = 0; $padding_store = array('0' => ''); - $forum_list = $padding = ''; + $padding = ''; + $forum_list = ($return_array) ? array() : ''; // Sometimes it could happen that forums will be displayed here not be displayed within the index page // This is the result of forums not displayed at index, having list permissions and a parent of a forum with no permissions. @@ -164,9 +165,16 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = continue; } - $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? ' selected="selected"' : '') : (($row['forum_id'] == $select_id) ? ' selected="selected"' : ''); - - $forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $padding . $row['forum_name'] . '</option>'; + if ($return_array) + { + $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? true : false) : (($row['forum_id'] == $select_id) ? true : false); + $forum_list[$row['forum_id']] = array_merge(array('padding' => $padding, 'selected' => $selected), $row); + } + else + { + $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? ' selected="selected"' : '') : (($row['forum_id'] == $select_id) ? ' selected="selected"' : ''); + $forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $padding . $row['forum_name'] . '</option>'; + } $iteration++; } |