diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index c67f986c9..343c1ef9c 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -245,8 +245,40 @@ class banlist_ui extends e_admin_ui //$ns->tablerender('Hello',$text); } - - protected function transferPage() + /** + * Create dropdown with options for ban time - uses internal fixed list of reasonable values + */ + private static function ban_time_dropdown($click_js = '', $zero_text = LAN_NEVER, $curval = -1, $drop_name = 'ban_time') + { + + $frm = e107::getForm(); + $intervals = array(0, 1, 2, 3, 6, 8, 12, 24, 36, 48, 72, 96, 120, 168, 336, 672); + + $ret = $frm->select_open($drop_name, array('other' => $click_js, 'id' => false)); + $ret .= $frm->option(' ', ''); + foreach ($intervals as $i) + { + if ($i == 0) + { + $words = $zero_text ? $zero_text : LAN_NEVER; + } + elseif (($i % 24) == 0) + { + $words = floor($i / 24) . ' ' . BANLAN_23; + } + else + { + $words = $i . ' ' . BANLAN_24; + } + $ret .= $frm->option($words, $i, ($curval == $i)); + } + $ret .= ''; + + return $ret; + } + + + protected function transferPage() { $ipAdministrator = new banlistManager; @@ -492,7 +524,7 @@ class banlist_ui extends e_admin_ui