} echo '<div class="container">' . K_NEWLINE; echo '<div class="tceformbox">' . K_NEWLINE; echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_groupeditor">' . K_NEWLINE; echo '<div class="row">' . K_NEWLINE; echo '<span class="label">' . K_NEWLINE; echo '<label for="group_id">' . $l['w_group'] . '</label>' . K_NEWLINE; echo '</span>' . K_NEWLINE; echo '<span class="formw">' . K_NEWLINE; echo '<select name="group_id" id="group_id" size="0" onchange="document.getElementById(\'form_groupeditor\').submit()">' . K_NEWLINE; echo '<option value="0" style="background-color:#009900;color:white;"'; if ($group_id == 0) { echo ' selected="selected"'; } echo '>+</option>' . K_NEWLINE; $sql = F_user_group_select_sql(); if ($r = F_db_query($sql, $db)) { while ($m = F_db_fetch_array($r)) { echo '<option value="' . $m['group_id'] . '"'; if ($m['group_id'] == $group_id) { echo ' selected="selected"'; } echo '>' . htmlspecialchars($m['group_name'], ENT_NOQUOTES, $l['a_meta_charset']) . '</option>' . K_NEWLINE; } } else { echo '</select></span></div>' . K_NEWLINE; F_display_db_error(); } echo '</select>' . K_NEWLINE; echo '</span>' . K_NEWLINE; echo '</div>' . K_NEWLINE;
/** * Display select box for user groups * @param $name (string) name of the select field * @return table header element string */ function F_user_group_select($name = 'group_id') { global $l, $db; require_once '../config/tce_config.php'; $str = ''; $str .= '<select name="' . $name . '" id="' . $name . '" size="0" title="' . $l['w_group'] . '">' . K_NEWLINE; $sql = F_user_group_select_sql(); if ($r = F_db_query($sql, $db)) { $str .= '<option value="0" style="color:gray" selected="selected">' . $l['w_group'] . '</option>' . K_NEWLINE; while ($m = F_db_fetch_array($r)) { $str .= '<option value="' . $m['group_id'] . '">'; $str .= ' ' . htmlspecialchars($m['group_name'], ENT_NOQUOTES, $l['a_meta_charset']) . ' </option>' . K_NEWLINE; } } else { $str .= '</select>' . K_NEWLINE; F_display_db_error(); } $str .= '</select>' . K_NEWLINE; return $str; }