Revisión | a784fa95a43b05371ca11747ef3e2012f44715bd (tree) |
---|---|
Tiempo | 2017-09-06 07:58:31 |
Autor | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2348 Remove limitation of Search box count
@@ -16,15 +16,8 @@ define('PLUGIN_SEARCH_MAX_BASE', 16); // #search(1,2,3,...,15,16) | ||
16 | 16 | // Show a search box on a page |
17 | 17 | function plugin_search_convert() |
18 | 18 | { |
19 | - static $done; | |
20 | - | |
21 | - if (isset($done)) { | |
22 | - return '#search(): You already view a search box<br />' . "\n"; | |
23 | - } else { | |
24 | - $done = TRUE; | |
25 | - $args = func_get_args(); | |
26 | - return plugin_search_search_form('', '', $args); | |
27 | - } | |
19 | + $args = func_get_args(); | |
20 | + return plugin_search_search_form('', '', $args); | |
28 | 21 | } |
29 | 22 | |
30 | 23 | function plugin_search_action() |
@@ -83,21 +76,18 @@ function plugin_search_search_form($s_word = '', $type = '', $bases = array()) | ||
83 | 76 | foreach($bases as $base) { |
84 | 77 | ++$_num; |
85 | 78 | if (PLUGIN_SEARCH_MAX_BASE < $_num) break; |
86 | - $label_id = '_p_search_base_id_' . $_num; | |
87 | 79 | $s_base = htmlsc($base); |
88 | 80 | $base_str = '<strong>' . $s_base . '</strong>'; |
89 | 81 | $base_label = str_replace('$1', $base_str, $_search_pages); |
90 | 82 | $base_msg .=<<<EOD |
91 | 83 | <div> |
92 | - <input type="radio" name="base" id="$label_id" value="$s_base" $check /> | |
93 | - <label for="$label_id">$base_label</label> | |
84 | + <label><input type="radio" name="base" value="$s_base" $check /> $base_label</label> | |
94 | 85 | </div> |
95 | 86 | EOD; |
96 | 87 | $check = ''; |
97 | 88 | } |
98 | 89 | $base_msg .=<<<EOD |
99 | - <input type="radio" name="base" id="_p_search_base_id_all" value="" /> | |
100 | - <label for="_p_search_base_id_all">$_search_all</label> | |
90 | + <label><input type="radio" name="base" value="" /> $_search_all</label> | |
101 | 91 | EOD; |
102 | 92 | $base_option = '<div class="small">' . $base_msg . '</div>'; |
103 | 93 | } |
@@ -106,10 +96,8 @@ EOD; | ||
106 | 96 | <form action="$script?cmd=search" method="post"> |
107 | 97 | <div> |
108 | 98 | <input type="text" name="word" value="$s_word" size="20" /> |
109 | - <input type="radio" name="type" id="_p_search_AND" value="AND" $and_check /> | |
110 | - <label for="_p_search_AND">$_btn_and</label> | |
111 | - <input type="radio" name="type" id="_p_search_OR" value="OR" $or_check /> | |
112 | - <label for="_p_search_OR">$_btn_or</label> | |
99 | + <label><input type="radio" name="type" value="AND" $and_check /> $_btn_and</label> | |
100 | + <label><input type="radio" name="type" value="OR" $or_check /> $_btn_or</label> | |
113 | 101 | <input type="submit" value="$_btn_search" /> |
114 | 102 | </div> |
115 | 103 | $base_option |