summaryrefslogtreecommitdiff
path: root/includes/sys_form.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-29 20:25:29 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-29 23:46:32 +0200
commitacfe72cb9155ca08bd5799d0dde331702e25e9ce (patch)
treed9e8750640ca57cf0e392e30f25a7877115262c4 /includes/sys_form.php
parent8257864829ffdfb410f05e0dd0a9c781f48b741a (diff)
Removed translation from config file
Diffstat (limited to 'includes/sys_form.php')
-rw-r--r--includes/sys_form.php15
1 files changed, 12 insertions, 3 deletions
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>';