diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-03-27 09:59:25 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-03-27 09:59:25 +0200 |
commit | 1600d82b772f419aca8b35d9d404440fecc7a483 (patch) | |
tree | 7c17ce1fc66bafec9b82d788f2d81b2a654248ce /phpBB/includes/functions_acp.php | |
parent | 4db229ff6c6c260e4fdb26449b391f3858c9479a (diff) | |
parent | b39b3da5af89d9687ff5e985244695131d36c753 (diff) | |
download | forums-1600d82b772f419aca8b35d9d404440fecc7a483.tar forums-1600d82b772f419aca8b35d9d404440fecc7a483.tar.gz forums-1600d82b772f419aca8b35d9d404440fecc7a483.tar.bz2 forums-1600d82b772f419aca8b35d9d404440fecc7a483.tar.xz forums-1600d82b772f419aca8b35d9d404440fecc7a483.zip |
Merge remote-tracking branch 'origin/ticket/14272' into ticket/14272-3.2.x
Conflicts:
phpBB/adm/style/acp_icons.html
phpBB/includes/acp/acp_groups.php
phpBB/includes/acp/acp_users.php
phpBB/includes/functions_acp.php
phpBB/includes/ucp/ucp_groups.php
phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
phpBB/styles/subsilver2/template/mcp_topic.html
phpBB/styles/subsilver2/template/posting_attach_body.html
phpBB/styles/subsilver2/template/posting_body.html
phpBB/styles/subsilver2/template/posting_poll_body.html
phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html
phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html
Diffstat (limited to 'phpBB/includes/functions_acp.php')
-rw-r--r-- | phpBB/includes/functions_acp.php | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index dc43957933..766669480d 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -258,46 +258,49 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars) case 'text': case 'url': case 'email': - case 'color': - case 'date': - case 'time': - case 'datetime': - case 'datetime-local': - case 'month': - case 'range': - case 'search': case 'tel': - case 'week': + case 'search': + // maxlength and size are only valid for these types and will be + // ignored for other input types. $size = (int) $tpl_type[1]; $maxlength = (int) $tpl_type[2]; $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new_ary[$config_key] . '"' . (($tpl_type[0] === 'password') ? ' autocomplete="off"' : '') . ' />'; break; + case 'color': + case 'datetime': + case 'datetime-local': + case 'month': + case 'week': + $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '" name="' . $name . '" value="' . $new_ary[$config_key] . '" />'; + break; + + case 'date': + case 'time': case 'number': - $max = $maxlength = ''; + case 'range': + $max = ''; $min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false; if ( isset($tpl_type[2]) ) { $max = (int) $tpl_type[2]; - $maxlength = strlen( (string) $max ); } - $tpl = '<input id="' . $key . '" type="number" maxlength="' . (( $maxlength != '' ) ? $maxlength : 255) . '"' . (( $min != '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="' . $name . '" value="' . $new_ary[$config_key] . '" />'; + $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (( $min != '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="' . $name . '" value="' . $new_ary[$config_key] . '" />'; break; case 'dimension': - $max = $maxlength = $size = ''; + $max = ''; $min = (int) $tpl_type[1]; if ( isset($tpl_type[2]) ) { $max = (int) $tpl_type[2]; - $size = $maxlength = strlen( (string) $max ); } - $tpl = '<input id="' . $key . '" type="number"' . (( $size != '' ) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength != '') ? $maxlength : 255) . '"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_width]" value="' . $new_ary[$config_key . '_width'] . '" /> x <input type="number"' . (( $size != '' ) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength != '') ? $maxlength : 255) . '"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_height]" value="' . $new_ary[$config_key . '_height'] . '" />'; + $tpl = '<input id="' . $key . '" type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_width]" value="' . $new_ary[$config_key . '_width'] . '" /> x <input type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_height]" value="' . $new_ary[$config_key . '_height'] . '" />'; break; case 'textarea': |