Browse Source

Merge pull request #743 from Arantor/release-2.1

! Rework hook filtering to be based on an onchange event rather than an ...
Arantor 11 years ago
parent
commit
cf4fc5a19c
2 changed files with 3 additions and 3 deletions
  1. 2 2
      Sources/ManageMaintenance.php
  2. 1 1
      Themes/default/languages/Admin.english.php

+ 2 - 2
Sources/ManageMaintenance.php

@@ -2415,7 +2415,7 @@ function get_integration_hooks_data($start, $per_page, $sort)
 
 	foreach ($hooks as $hook => $functions)
 	{
-		$hooks_filters[] = '<option ' . ($context['current_filter'] == $hook ? 'selected="selected" ' : '') . 'onclick="window.location = \'' . $scripturl . '?action=admin;area=maintain;sa=hooks;filter=' . $hook . '\';">' . $hook . '</option>';
+		$hooks_filters[] = '<option ' . ($context['current_filter'] == $hook ? 'selected="selected" ' : '') . ' value="' . $hook . '">' . $hook . '</option>';
 		foreach ($functions as $function)
 		{
 			$enabled = strstr($function, ']') === false;
@@ -2442,7 +2442,7 @@ function get_integration_hooks_data($start, $per_page, $sort)
 		$context['insert_after_template'] .= '
 		<script type="text/javascript"><!-- // --><![CDATA[
 			var hook_name_header = document.getElementById(\'header_list_integration_hooks_hook_name\');
-			hook_name_header.innerHTML += ' . JavaScriptEscape('<select style="margin-left:15px;"><option>---</option><option onclick="window.location = \'' . $scripturl . '?action=admin;area=maintain;sa=hooks\';">' . $txt['hooks_reset_filter'] . '</option>' . implode('', $hooks_filters) . '</select>'). ';
+			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>';
 
 	$temp_data = array();

+ 1 - 1
Themes/default/languages/Admin.english.php

@@ -718,7 +718,7 @@ $txt['hooks_disable_legend'] = 'Legend';
 $txt['hooks_disable_legend_exists'] = 'the hook exists and is active';
 $txt['hooks_disable_legend_disabled'] = 'the hook exists but has been disabled';
 $txt['hooks_disable_legend_missing'] = 'the hook has not been found';
-$txt['hooks_reset_filter'] = 'Reset filter';
+$txt['hooks_reset_filter'] = 'No filter';
 
 $txt['board_perms_allow'] = 'Allow';
 $txt['board_perms_ignore'] = 'Ignore';