Skip to content

Commit

Permalink
Move hooks filter above table
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
  • Loading branch information
Sesquipedalian committed Feb 11, 2025
1 parent 9edc98e commit 4732af1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions Sources/Actions/Admin/Maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -1890,14 +1890,6 @@ function ($hook) use ($current_filter) {
$hooks_filters[] = '<option' . ($current_filter == $hook ? ' selected ' : '') . ' value="' . $hook . '">' . $hook . '</option>';
}

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

if (!empty($_REQUEST['do']) && isset($_REQUEST['hook'], $_REQUEST['function'])) {
User::$me->checkSession('request');
SecurityToken::validate('admin-hook', 'request');
Expand Down Expand Up @@ -2033,6 +2025,15 @@ function ($accumulator, $functions) {
<li><span class="main_icons error"></span> ' . Lang::$txt['hooks_disable_legend_temp_missing'] . '</li>
</ul>',
],
[
'position' => 'above_column_headers',
'value' => '
<select onchange="window.location=(\'' . Config::$scripturl . '?action=admin;area=maintain;sa=hooks\' + (this.value ? \';filter=\' + this.value : \'\'));">
<option value="">' . Lang::$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 @@ -1487,7 +1487,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;
}

Expand Down

0 comments on commit 4732af1

Please sign in to comment.