diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-08-29 20:25:29 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2018-08-29 23:46:32 +0200 |
commit | acfe72cb9155ca08bd5799d0dde331702e25e9ce (patch) | |
tree | d9e8750640ca57cf0e392e30f25a7877115262c4 /includes | |
parent | 8257864829ffdfb410f05e0dd0a9c781f48b741a (diff) |
Removed translation from config file
Diffstat (limited to 'includes')
-rw-r--r-- | includes/pages/admin_active.php | 20 | ||||
-rw-r--r-- | includes/pages/admin_user.php | 9 | ||||
-rw-r--r-- | includes/pages/guest_login.php | 8 | ||||
-rw-r--r-- | includes/pages/user_settings.php | 6 | ||||
-rw-r--r-- | includes/sys_form.php | 15 | ||||
-rw-r--r-- | includes/view/User_view.php | 3 |
6 files changed, 25 insertions, 36 deletions
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php index 33a7e01e..35dbe60b 100644 --- a/includes/pages/admin_active.php +++ b/includes/pages/admin_active.php @@ -244,18 +244,16 @@ function admin_active() $shirt_statistics = []; foreach (array_keys($tshirt_sizes) as $size) { - if (!empty($size)) { - $gc = DB::selectOne( - 'SELECT count(*) FROM `User` WHERE `Size`=? AND `Tshirt`=1', - [$size] - ); - $gc = array_shift($gc); + $gc = DB::selectOne( + 'SELECT count(*) FROM `User` WHERE `Size`=? AND `Tshirt`=1', + [$size] + ); + $gc = array_shift($gc); - $shirt_statistics[] = [ - 'size' => $size, - 'given' => (int)$gc - ]; - } + $shirt_statistics[] = [ + 'size' => $size, + 'given' => (int)$gc + ]; } $shirtCount = User_tshirts_count(); diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 514e4b1b..2841c278 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -18,13 +18,6 @@ function admin_user() global $user, $privileges; $tshirt_sizes = config('tshirt_sizes'); $request = request(); - - foreach ($tshirt_sizes as $key => $size) { - if (empty($size)) { - unset($tshirt_sizes[$key]); - } - } - $html = ''; if (!$request->has('id')) { @@ -68,7 +61,7 @@ function admin_user() } $html .= " <tr><td>jabber</td><td>" . '<input size="40" name="ejabber" value="' . $user_source['jabber'] . '" class="form-control"></td></tr>' . "\n"; $html .= ' <tr><td>Size</td><td>' - . html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size']) . '</td></tr>' . "\n"; + . html_select_key('size', 'eSize', $tshirt_sizes, $user_source['Size'], _('Please select...')) . '</td></tr>' . "\n"; $options = [ '1' => _('Yes'), diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 47e16915..d23d9f96 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -69,12 +69,6 @@ function guest_register() } } - foreach ($tshirt_sizes as $key => $size) { - if (empty($size)) { - unset($tshirt_sizes[$key]); - } - } - if (!in_array('register', $privileges) || (!isset($user) && !config('registration_enabled'))) { error(_('Registration is disabled.')); @@ -334,7 +328,7 @@ function guest_register() div('col-sm-6', [ $enable_tshirt_size ? form_select('tshirt_size', _('Shirt size') . ' ' . entry_required(), - $tshirt_sizes, $tshirt_size) : '' + $tshirt_sizes, $tshirt_size, _('Please select...')) : '' ]) ]), div('row', [ diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index b3a5bdf5..930d55d9 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -224,12 +224,6 @@ function user_settings() } } - foreach ($tshirt_sizes as $key => $size) { - if (empty($size)) { - unset($tshirt_sizes[$key]); - } - } - $user_source = $user; if ($request->has('submit')) { diff --git a/includes/sys_form.php b/includes/sys_form.php index 9cb6f38d..b75c7316 100644 --- a/includes/sys_form.php +++ b/includes/sys_form.php @@ -367,11 +367,16 @@ function form_textarea($name, $label, $value, $disabled = false) * @param string $label * @param string[] $values * @param string $selected + * @param string $selectText * @return string */ -function form_select($name, $label, $values, $selected) +function form_select($name, $label, $values, $selected, $selectText = '') { - return form_element($label, html_select_key('form_' . $name, $name, $values, $selected), 'form_' . $name); + return form_element( + $label, + html_select_key('form_' . $name, $name, $values, $selected, $selectText), + 'form_' . $name + ); } /** @@ -425,11 +430,15 @@ function html_options($name, $options, $selected = '') * @param string $name * @param string[] $rows * @param string $selected + * @param string $selectText * @return string */ -function html_select_key($dom_id, $name, $rows, $selected) +function html_select_key($dom_id, $name, $rows, $selected, $selectText = '') { $html = '<select class="form-control" id="' . $dom_id . '" name="' . $name . '">'; + if (!empty($selectText)) { + $html .= '<option value="">' . $selectText . '</option>'; + } foreach ($rows as $key => $row) { if (($key == $selected) || ($row === $selected)) { $html .= '<option value="' . $key . '" selected="selected">' . $row . '</option>'; diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 8eee610a..c4ae03f6 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -66,7 +66,8 @@ function User_settings_view( 'tshirt_size', _('Shirt size'), $tshirt_sizes, - $user_source['Size'] + $user_source['Size'], + _('Please select...') ) : '', form_info('', _('Please visit the angeltypes page to manage your angeltypes.')), form_submit('submit', _('Save')) |