mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Removed duplicate declaration of build_cfg_template()
git-svn-id: file:///svn/phpbb/trunk@5006 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e5b8ff9404
commit
c5e40db2a0
1 changed files with 1 additions and 60 deletions
|
@ -512,64 +512,5 @@ function board_disable($value)
|
|||
return '<input type="radio" name="config[board_disable]" value="1"' . $board_disable_yes . ' /> ' . $user->lang['YES'] . ' <input type="radio" name="config[board_disable]" value="0"' . $board_disable_no . ' /> ' . $user->lang['NO'] . '<br /><input class="post" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $new['board_disable_msg'] . '" />';
|
||||
}
|
||||
|
||||
function build_cfg_template($tpl_type, $config_key, $options = '')
|
||||
{
|
||||
global $new, $user;
|
||||
|
||||
$tpl = '';
|
||||
$name = 'config[' . $config_key . ']';
|
||||
|
||||
switch ($tpl_type[0])
|
||||
{
|
||||
case 'text':
|
||||
case 'password':
|
||||
$size = (int) $tpl_type[1];
|
||||
$maxlength = (int) $tpl_type[2];
|
||||
|
||||
$tpl = '<input class="post" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new[$config_key] . '" />';
|
||||
break;
|
||||
|
||||
case 'dimension':
|
||||
$size = (int) $tpl_type[1];
|
||||
$maxlength = (int) $tpl_type[2];
|
||||
|
||||
$tpl = '<input class="post" type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_height]" value="' . $new[$config_key . '_height'] . '" /> x <input class="post" type="text"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="config[' . $config_key . '_width]" value="' . $new[$config_key . '_width'] . '" />';
|
||||
break;
|
||||
|
||||
case 'textarea':
|
||||
$rows = (int) $tpl_type[1];
|
||||
$cols = (int) $tpl_type[2];
|
||||
|
||||
$tpl = '<textarea name="' . $name . '" rows="' . $rows . '" cols="' . $cols . '">' . $new[$config_key] . '</textarea>';
|
||||
break;
|
||||
|
||||
case 'radio':
|
||||
$key_yes = ($new[$config_key]) ? ' checked="checked"' : '';
|
||||
$key_no = (!$new[$config_key]) ? ' checked="checked"' : '';
|
||||
|
||||
$tpl_type_cond = explode('_', $tpl_type[1]);
|
||||
$type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true;
|
||||
|
||||
$tpl_no = '<input type="radio" name="' . $name . '" value="0"' . $key_no . ' />' . (($type_no) ? $user->lang['NO'] : $user->lang['DISABLED']);
|
||||
$tpl_yes = '<input type="radio" name="' . $name . '" value="1"' . $key_yes . ' />' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']);
|
||||
|
||||
$tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . ' ' . $tpl_no : $tpl_no . ' ' . $tpl_yes;
|
||||
break;
|
||||
|
||||
case 'select':
|
||||
eval('$s_options = ' . str_replace('{VALUE}', $new[$config_key], $options) . ';');
|
||||
$tpl = '<select name="' . $name . '">' . $s_options . '</select>';
|
||||
break;
|
||||
|
||||
case 'custom':
|
||||
eval('$tpl = ' . str_replace('{VALUE}', $new[$config_key], $options) . ';');
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Reference in a new issue