diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-10-08 21:01:25 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-10-08 21:01:25 +0000 |
commit | 2c16ed72489c37102158d5f5038049dce401cf26 (patch) | |
tree | 76ba9a392f6b006b22ed20a726cea45b81aadc2c /phpBB/includes/functions_admin.php | |
parent | 1d0e4ee436cf7ca5790d83aac11ed9cf90a4ccda (diff) | |
download | forums-2c16ed72489c37102158d5f5038049dce401cf26.tar forums-2c16ed72489c37102158d5f5038049dce401cf26.tar.gz forums-2c16ed72489c37102158d5f5038049dce401cf26.tar.bz2 forums-2c16ed72489c37102158d5f5038049dce401cf26.tar.xz forums-2c16ed72489c37102158d5f5038049dce401cf26.zip |
Minor changes to select box
git-svn-id: file:///svn/phpbb/trunk@2944 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r-- | phpBB/includes/functions_admin.php | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index c44aa1df40..2707b5adef 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -20,7 +20,7 @@ ***************************************************************************/ // Simple version of jumpbox, just lists authed forums -function make_forum_select($box_name, $ignore_forum = false) +function make_forum_select($default_forum = false, $ignore_forum = false) { global $db, $userdata, $auth, $lang; @@ -34,28 +34,27 @@ function make_forum_select($box_name, $ignore_forum = false) $forum_list = ''; while ( $row = $db->sql_fetchrow($result) ) { - if ( ( $auth->acl_get('f_list', $forum_id) || $auth->acl_get('a_') ) && $ignore_forum != $row['forum_id'] ) + if ( $row['left_id'] < $right ) { - if ( $row['left_id'] < $right ) - { - $subforum .= ' '; - } - else if ( $row['left_id'] > $right + 1 ) - { - $subforum = substr($subforum, 0, -18 * ( $row['left_id'] - $right + 1 )); - } + $subforum .= ' '; + } + else if ( $row['left_id'] > $right + 1 ) + { + $subforum = substr($subforum, 0, -18 * ( $row['left_id'] - $right + 1 )); + } - $forum_list .= '<option value="' . $row['forum_id'] . '">' . $subforum . $row['forum_name'] . '</option>'; + $right = $row['right_id']; - $right = $row['right_id']; + if ( ( $auth->acl_get('f_list', $forum_id) || $auth->acl_get('a_') ) && $ignore_forum != $row['forum_id'] ) + { + $selected = ( $row['forum_id'] == $default_forum ) ? ' selected="selected"' : ''; + $forum_list .= '<option value="' . $row['forum_id'] . '"' . $selected . '>' . $subforum . $row['forum_name'] . '</option>'; } } $db->sql_freeresult($result); - $forum_list = ( $forum_list == '' ) ? '<option value="-1">' . $lang['No_forums'] . '</option>' : '<select name="' . $box_name . '">' . $forum_list . '</select>'; - - return $forum_list; + return ( $forum_list == '' ) ? '<option value="-1">' . $lang['No_forums'] . '</option>' : $forum_list; } // Synchronise functions for forums/topics |