Skip to content

Commit

Permalink
Merge pull request #8111 from dragomano/integration_hooks_filter
Browse files Browse the repository at this point in the history
[2.1] Move hooks filter above table
  • Loading branch information
Sesquipedalian authored Feb 11, 2025
2 parents 938503e + ef1f81b commit bd3f465
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 9 additions & 7 deletions Sources/ManageMaintenance.php
Original file line number Diff line number Diff line change
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
3 changes: 2 additions & 1 deletion Themes/default/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,8 @@ ul li.greeting {
#display_jump_to_select,
#message_index_jump_to_select,
#search_jump_to_select,
#quick_mod_jump_to_select {
#quick_mod_jump_to_select,
#list_integration_hooks select {
width: 29ch;
overflow: hidden;
}
Expand Down

0 comments on commit bd3f465

Please sign in to comment.