From bd30d226a583276f627d844fca46a7645dcce4fd Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 3 Feb 2006 20:59:39 +0000 Subject: - 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 --- phpBB/includes/functions_admin.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/functions_admin.php') 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 .= ''; + 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 .= ''; + } $iteration++; } -- cgit v1.2.1