mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[ticket/17414] Move captcha acp html to html files
PHPBB-17414
This commit is contained in:
parent
c27c1fa7a3
commit
8de8878d5e
2 changed files with 30 additions and 19 deletions
|
@ -8,12 +8,12 @@
|
||||||
|
|
||||||
<p>{L_ACP_VC_EXT_GET_MORE}</p>
|
<p>{L_ACP_VC_EXT_GET_MORE}</p>
|
||||||
|
|
||||||
<!-- IF ERROR_MSG -->
|
{% if ERRORS %}
|
||||||
<div class="errorbox">
|
<div class="errorbox">
|
||||||
<h3>{L_WARNING}</h3>
|
<h3>{{ lang('WARNING') }}</h3>
|
||||||
<p>{ERROR_MSG}</p>
|
<p>{{ ERRORS|join('<br>') }}</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- ENDIF -->
|
{% endif %}
|
||||||
|
|
||||||
<form id="acp_captcha" method="post" action="{U_ACTION}">
|
<form id="acp_captcha" method="post" action="{U_ACTION}">
|
||||||
|
|
||||||
|
@ -47,10 +47,10 @@
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{L_AVAILABLE_CAPTCHAS}</legend>
|
<legend>{L_AVAILABLE_CAPTCHAS}</legend>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="captcha_select">{L_CAPTCHA_SELECT}{L_COLON}</label><br /><span>{L_CAPTCHA_SELECT_EXPLAIN}</span></dt>
|
<dt><label for="captcha_select">{{ lang('CAPTCHA_SELECT') ~ lang('COLON') }}</label><br><span>{{ lang('CAPTCHA_SELECT_EXPLAIN') }}</span></dt>
|
||||||
<dd><select id="captcha_select" name="select_captcha" onchange="(document.getElementById('acp_captcha')).submit()" >{CAPTCHA_SELECT}</select></dd>
|
<dd>{{ FormsSelect(CAPTCHA_SELECT | merge({id: 'captcha_select', onchange: "(document.getElementById('acp_captcha')).submit()"})) }}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<!-- IF S_CAPTCHA_HAS_CONFIG -->
|
<!-- IF S_CAPTCHA_HAS_CONFIG -->
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="configure">{L_CAPTCHA_CONFIGURE}{L_COLON}</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt>
|
<dt><label for="configure">{L_CAPTCHA_CONFIGURE}{L_COLON}</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt>
|
||||||
|
|
|
@ -95,7 +95,7 @@ class acp_captcha
|
||||||
add_form_key($form_key);
|
add_form_key($form_key);
|
||||||
|
|
||||||
$submit = $request->variable('main_submit', false);
|
$submit = $request->variable('main_submit', false);
|
||||||
$error = $cfg_array = array();
|
$errors = $cfg_array = array();
|
||||||
|
|
||||||
if ($submit)
|
if ($submit)
|
||||||
{
|
{
|
||||||
|
@ -103,13 +103,13 @@ class acp_captcha
|
||||||
{
|
{
|
||||||
$cfg_array[$config_var] = $request->variable($config_var, $options['default']);
|
$cfg_array[$config_var] = $request->variable($config_var, $options['default']);
|
||||||
}
|
}
|
||||||
validate_config_vars($config_vars, $cfg_array, $error);
|
validate_config_vars($config_vars, $cfg_array, $errors);
|
||||||
|
|
||||||
if (!check_form_key($form_key))
|
if (!check_form_key($form_key))
|
||||||
{
|
{
|
||||||
$error[] = $user->lang['FORM_INVALID'];
|
$errors[] = $user->lang['FORM_INVALID'];
|
||||||
}
|
}
|
||||||
if ($error)
|
if ($errors)
|
||||||
{
|
{
|
||||||
$submit = false;
|
$submit = false;
|
||||||
}
|
}
|
||||||
|
@ -143,17 +143,24 @@ class acp_captcha
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$captcha_select = '';
|
$captcha_options = [];
|
||||||
foreach ($captchas['available'] as $value => $title)
|
foreach ($captchas['available'] as $value => $title)
|
||||||
{
|
{
|
||||||
$current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
|
$captcha_options[] = [
|
||||||
$captcha_select .= '<option value="' . $value . '"' . $current . '>' . $user->lang($title) . '</option>';
|
'value' => $value,
|
||||||
|
'label' => $user->lang($title),
|
||||||
|
'selected' => $selected !== false && $value == $selected,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($captchas['unavailable'] as $value => $title)
|
foreach ($captchas['unavailable'] as $value => $title)
|
||||||
{
|
{
|
||||||
$current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
|
$captcha_options[] = [
|
||||||
$captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option">' . $user->lang($title) . '</option>';
|
'value' => $value,
|
||||||
|
'label' => $user->lang($title),
|
||||||
|
'selected' => $selected !== false && $value == $selected,
|
||||||
|
'class' => 'disabled-option',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$demo_captcha = $factory->get_instance($selected);
|
$demo_captcha = $factory->get_instance($selected);
|
||||||
|
@ -166,8 +173,12 @@ class acp_captcha
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'CAPTCHA_PREVIEW_TPL' => $demo_captcha->get_demo_template($id),
|
'CAPTCHA_PREVIEW_TPL' => $demo_captcha->get_demo_template($id),
|
||||||
'S_CAPTCHA_HAS_CONFIG' => $demo_captcha->has_config(),
|
'S_CAPTCHA_HAS_CONFIG' => $demo_captcha->has_config(),
|
||||||
'CAPTCHA_SELECT' => $captcha_select,
|
'CAPTCHA_SELECT' => [
|
||||||
'ERROR_MSG' => implode('<br />', $error),
|
'tag' => 'select',
|
||||||
|
'name' => 'select_captcha',
|
||||||
|
'options' => $captcha_options,
|
||||||
|
],
|
||||||
|
'ERRORS' => $errors,
|
||||||
|
|
||||||
'U_ACTION' => $this->u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
));
|
));
|
||||||
|
|
Loading…
Add table
Reference in a new issue