[ticket/16737] Improvements to in progress form

PHPBB3-16737
This commit is contained in:
rubencm 2021-03-25 10:04:37 +01:00
parent 9b838115c6
commit e84cef8dee
2 changed files with 25 additions and 10 deletions

View file

@ -2,16 +2,29 @@
<a id="maincontent"></a> <a id="maincontent"></a>
<h1>{L_ACP_SEARCH_INDEX}</h1> <script>
// <![CDATA[
/**
* Popup search progress bar
*/
function popup_progress_bar(progress_type)
{
close_waitscreen = 0;
// no scrollbars
popup('{UA_PROGRESS_BAR}&amp;type=' + progress_type, 400, 240, '_index');
}
// ]]>
</script>
<h1>{L_CONTINUE}</h1>
{# todo: check the l_continue that is send from acp_search here #}
<p>{L_CONTINUE_EXPLAIN}</p> <p>{L_CONTINUE_EXPLAIN}</p>
<form id="acp_search_continue" method="post" action="{U_CONTINUE_INDEXING}"> <form id="acp_search_continue" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_ACP_SUBMIT_CHANGES}</legend> <legend>{L_ACP_SUBMIT_CHANGES}</legend>
<p class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" onclick="popup_progress_bar('{S_ACTION}');" />&nbsp;
<input class="button2" type="submit" id="cancel" name="cancel" value="{L_CANCEL}" /> <input class="button2" type="submit" id="cancel" name="cancel" value="{L_CANCEL}" />
</p> </p>
{S_FORM_TOKEN} {S_FORM_TOKEN}

View file

@ -286,7 +286,7 @@ class acp_search
$action = $this->request->variable('action', ''); $action = $this->request->variable('action', '');
$state = !empty($this->config['search_indexing_state']) ? explode(',', $this->config['search_indexing_state']) : []; $state = !empty($this->config['search_indexing_state']) ? explode(',', $this->config['search_indexing_state']) : [];
if ($action) if ($action && !$this->request->is_set_post('cancel'))
{ {
switch ($action) switch ($action)
{ {
@ -305,7 +305,7 @@ class acp_search
} }
else else
{ {
// If clicked to no continue with the indexing progress (acp_search_index_inprogress form) // If clicked to cancel the indexing progress (acp_search_index_inprogress form)
if ($this->request->is_set_post('cancel')) if ($this->request->is_set_post('cancel'))
{ {
$state = []; $state = [];
@ -362,14 +362,16 @@ class acp_search
*/ */
private function index_inprogress(string $id, string $mode, string $action): void private function index_inprogress(string $id, string $mode, string $action): void
{ {
$this->tpl_name = 'acp_search_inprogress'; $this->tpl_name = 'acp_search_index_inprogress';
$this->page_title = 'ACP_SEARCH_INDEX'; $this->page_title = 'ACP_SEARCH_INDEX';
$this->template->assign_vars(array( $this->template->assign_vars(array(
'U_CONTINUE_INDEXING' => $this->u_action . '&amp;action=' . $action . '&amp;hash=' . generate_link_hash('acp_search'), 'U_ACTION' => $this->u_action . '&amp;action=' . $action . '&amp;hash=' . generate_link_hash('acp_search'),
'UA_PROGRESS_BAR' => addslashes($this->u_action . '&amp;action=progress_bar'),
'L_CONTINUE' => ($action === 'create') ? $this->language->lang('CONTINUE_INDEXING') : $this->language->lang('CONTINUE_DELETING_INDEX'), 'L_CONTINUE' => ($action === 'create') ? $this->language->lang('CONTINUE_INDEXING') : $this->language->lang('CONTINUE_DELETING_INDEX'),
'L_CONTINUE_EXPLAIN' => ($action === 'create') ? $this->language->lang('CONTINUE_INDEXING_EXPLAIN') : $this->language->lang('CONTINUE_DELETING_INDEX_EXPLAIN')) 'L_CONTINUE_EXPLAIN' => ($action === 'create') ? $this->language->lang('CONTINUE_INDEXING_EXPLAIN') : $this->language->lang('CONTINUE_DELETING_INDEX_EXPLAIN'),
); 'S_ACTION' => $action,
));
} }
private function index_action(string $id, string $mode, string $action, array $state): void private function index_action(string $id, string $mode, string $action, array $state): void