[RFC] prefix and suffix for build_cfg_template

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
Post Reply
User avatar
emosbat
Registered User
Posts: 43
Joined: Fri Aug 24, 2012 8:49 am

[RFC] prefix and suffix for build_cfg_template

Post by emosbat »

when using build_cfg_template function for creating MOD's setup page in ACP there is not prefix and suffix option.

imagine we want to display a text input that get a number in percent. by using build_cfg_template function we can not add a `%` text right after input box so we should manually create inputs and ignore using that function.

something like this:

Code: Select all

function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars, $prefix = '', $suffix = '')
{
...
....
			$tpl = $prefix . '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '"' . (($tpl_type[0] === 'password') ?  ' autocomplete="off"' : '') . ' />' . $suffix;

...
...

Post Reply