Skip to content

Commit

Permalink
Move hooks filter above table
Browse files Browse the repository at this point in the history
Signed-off-by: Bugo <cheetah@bk.ru>
  • Loading branch information
dragomano committed Feb 20, 2024
1 parent 83db36f commit d16e221
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Sources/ManageMaintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ function AdminBoardRecount()
validateToken(!isset($_REQUEST['step']) ? 'admin-maint' : 'admin-boardrecount');
$context['not_done_token'] = 'admin-boardrecount';
createToken($context['not_done_token']);

$context['page_title'] = $txt['not_done_title'];
$context['continue_post_data'] = '';
$context['continue_countdown'] = 3;
Expand Down Expand Up @@ -1867,13 +1867,6 @@ function($hook) use ($current_filter)
foreach ($hooks as $hook => $functions)
$hooks_filters[] = '<option' . ($current_filter == $hook ? ' selected ' : '') . ' value="' . $hook . '">' . $hook . '</option>';

if (!empty($hooks_filters))
$context['insert_after_template'] .= '
<script>
var hook_name_header = document.getElementById(\'header_list_integration_hooks_hook_name\');
hook_name_header.innerHTML += ' . JavaScriptEscape('<select style="margin-left:15px;" onchange="window.location=(\'' . $scripturl . '?action=admin;area=maintain;sa=hooks\' + (this.value ? \';filter=\' + this.value : \'\'));"><option value="">' . $txt['hooks_reset_filter'] . '</option>' . implode('', $hooks_filters) . '</select>') . ';
</script>';

if (!empty($_REQUEST['do']) && isset($_REQUEST['hook']) && isset($_REQUEST['function']))
{
checkSession('request');
Expand Down Expand Up @@ -2019,6 +2012,15 @@ function($accumulator, $functions)
<li><span class="main_icons error"></span> ' . $txt['hooks_disable_legend_temp_missing'] . '</li>
</ul>'
),
array(
'position' => 'above_column_headers',
'value' => '
<select onchange="window.location=(\'' . $scripturl . '?action=admin;area=maintain;sa=hooks\' + (this.value ? \';filter=\' + this.value : \'\'));">
<option value="">' . $txt['hooks_reset_filter'] . '</option>
' . implode('', $hooks_filters) . '
</select>',
'class' => 'floatright',
),
),
);

Expand Down

0 comments on commit d16e221

Please sign in to comment.