jdarwood007 commited on 2017-09-17 10:28:05
Showing 3 changed files, with 105 additions and 42 deletions.
Signed-off-by: jdarwood007 <unmonitored+github@sleepycode.com>
... | ... |
@@ -19,7 +19,7 @@ function add_ts_adminmenu(&$admin_areas) |
19 | 19 |
|
20 | 20 |
// If this is 2.1, we don't check admin_features |
21 | 21 |
if (function_exists('loadCacheAccelerator')) |
22 |
- $admin_areas['maintenance']['areas']['logs']['subsections']['solvelog'] = array($txt['modlog_solve_log'], 'moderate_forum', 'enabled' => !empty($modSettings['enable_solved_log']), 'url' => $scripturl . '?action=moderate;area=modlog;sa=solvelog'); |
|
22 |
+ $admin_areas['maintenance']['areas']['logs']['subsections']['solvelog'] = array($txt['modlog_solve_log'], 'moderate_forum', 'enabled' => !empty($modSettings['enable_solved_log']), 'url' => $scripturl . '?action=moderate;area=solvelog'); |
|
23 | 23 |
else |
24 | 24 |
$admin_areas['maintenance']['areas']['logs']['subsections']['solvelog'] = array($txt['modlog_solve_log'], 'moderate_forum', 'enabled' => !empty($modSettings['enable_solved_log']) && in_array('ml', $context['admin_features']), 'url' => $scripturl . '?action=moderate;area=modlog;sa=solvelog'); |
25 | 25 |
$admin_areas['config']['areas']['modsettings']['subsections']['topicsolved'] = array($txt['topic_solved_title']); |
... | ... |
@@ -86,9 +86,9 @@ function ModifyTopicSolvedSettings($return_config = false) |
86 | 86 |
* |
87 | 87 |
* @since 2.0 |
88 | 88 |
*/ |
89 |
-function integrate_viewModLog_solveTopic(&$listOptions, $moderation_menu_name) |
|
89 |
+function integrate_viewModLog_solveTopic(&$listOptions, &$moderation_menu_name) |
|
90 | 90 |
{ |
91 |
- global $context, $modSettings, $scripturl, $txt, $settings; |
|
91 |
+ global $context, $modSettings, $scripturl, $txt, $settings, $smcFunc; |
|
92 | 92 |
|
93 | 93 |
// Topic solved log |
94 | 94 |
$context['log_type'] = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'solvelog' ? 4 : $context['log_type']; |
... | ... |
@@ -101,11 +101,90 @@ function integrate_viewModLog_solveTopic(&$listOptions, $moderation_menu_name) |
101 | 101 |
|
102 | 102 |
// At this point, we are certain to be on the solved topic section. |
103 | 103 |
$context['page_title'] = $txt['modlog_solve_log']; |
104 |
- $context['url_start'] = '?action=moderate;area=modlog;sa=solvelog;type=4'; |
|
104 |
+ $context['url_start'] = '?action=moderate;area=solvelog;type=4'; |
|
105 | 105 |
|
106 |
+ // Fix up the tab data. |
|
107 |
+ $moderation_menu_name = array( |
|
108 |
+ 'title' => $txt['modlog_solve_log'], |
|
109 |
+ 'help' => 'solve_log', |
|
110 |
+ 'description' => $txt['modlog_solve_log_desc'] |
|
111 |
+ ); |
|
112 |
+ |
|
113 |
+ // Fix up the list options. |
|
106 | 114 |
$listOptions['title'] = '<a href="' . $scripturl . '?action=helpadmin;help=solve_log_help" onclick="return reqWin(this.href);" class="help"><img src="' . $settings['images_url'] . '/helptopics.gif" alt="' . $txt['help'] . '" align="top" /></a> ' . $txt['modlog_solve_log']; |
107 |
- $listOptions['additional_rows'][0]['value'] = $txt['modlog_solve_log_desc']; |
|
115 |
+ $listOptions['additional_rows'][0]['value'] = ' |
|
116 |
+ ' . $txt['modlog_search'] . ' (' . $txt['modlog_by'] . ': ' . $context['search']['label'] . '): |
|
117 |
+ <input type="text" name="search" size="18" value="' . $smcFunc['htmlspecialchars']($context['search']['string']) . '"> |
|
118 |
+ <input type="submit" name="is_search" value="' . $txt['modlog_go'] . '" class="button" style="float:none"> |
|
119 |
+ ' . ($context['can_delete'] ? ' |
|
120 |
+ <input type="submit" name="remove_Solved" value="' . $txt['modlog_remove'] . '" data-confirm="' . $txt['modlog_remove_selected_confirm'] . '" class="button you_sure"> |
|
121 |
+ <input type="submit" name="removeall_Solved" value="' . $txt['modlog_removeall'] . '" data-confirm="' . $txt['modlog_remove_all_confirm'] . '" class="button you_sure">' : ''); |
|
122 |
+ |
|
108 | 123 |
$listOptions['no_items_label'] = $txt['modlog_solve_log_no_entries_found']; |
124 |
+ |
|
125 |
+ // List Urls. |
|
126 |
+ $listOptions['base_href'] = $scripturl . $context['url_start'] . (!empty($context['search_params']) ? ';params=' . $context['search_params'] : ''); |
|
127 |
+ $listOptions['form']['href'] = $scripturl . $context['url_start']; |
|
128 |
+ |
|
129 |
+ // List Paramters. |
|
130 |
+ $listOptions['get_items']['params'][2] = $context['log_type']; |
|
131 |
+ $listOptions['get_count']['params'][2] = $context['log_type']; |
|
132 |
+ |
|
133 |
+ // Hold on, we have deletions to handle! |
|
134 |
+ // Handle deletion... |
|
135 |
+ if (isset($_POST['removeall_Solved']) && $context['can_delete']) |
|
136 |
+ { |
|
137 |
+ checkSession(); |
|
138 |
+ validateToken('mod-ml'); |
|
139 |
+ |
|
140 |
+ $smcFunc['db_query']('', ' |
|
141 |
+ DELETE FROM {db_prefix}log_actions |
|
142 |
+ WHERE id_log = {int:moderate_log}', |
|
143 |
+ array( |
|
144 |
+ 'moderate_log' => $context['log_type'], |
|
145 |
+ ) |
|
146 |
+ ); |
|
147 |
+ |
|
148 |
+ logAction('clearlog_' . $context['log_type'], array(), $context['log_type']); |
|
149 |
+ } |
|
150 |
+ elseif (!empty($_POST['remove_Solved']) && isset($_POST['delete']) && $context['can_delete']) |
|
151 |
+ { |
|
152 |
+ checkSession(); |
|
153 |
+ validateToken('mod-ml'); |
|
154 |
+ |
|
155 |
+ // No sneaky removing the 'cleared the log' entries. |
|
156 |
+ $smcFunc['db_query']('', ' |
|
157 |
+ DELETE FROM {db_prefix}log_actions |
|
158 |
+ WHERE id_log = {int:moderate_log} |
|
159 |
+ AND id_action IN ({array_string:delete_actions}) |
|
160 |
+ AND action NOT LIKE {string:clearlog}', |
|
161 |
+ array( |
|
162 |
+ 'delete_actions' => array_unique($_POST['delete']), |
|
163 |
+ 'moderate_log' => $context['log_type'], |
|
164 |
+ 'clearlog' => 'clearlog_%', |
|
165 |
+ ) |
|
166 |
+ ); |
|
167 |
+ } |
|
168 |
+} |
|
169 |
+ |
|
170 |
+/** |
|
171 |
+ * Adds Topic Solved to our Moderation Menu. |
|
172 |
+ * |
|
173 |
+ * @param string &$menuData The menu data. |
|
174 |
+ * |
|
175 |
+ * @since 1.1 |
|
176 |
+*/ |
|
177 |
+function integrate_moderate_areas_solveTopic(&$menuData) |
|
178 |
+{ |
|
179 |
+ global $modSettings, $txt, $scripturl; |
|
180 |
+ |
|
181 |
+ $menuData['logs']['areas']['solvelog'] = array( |
|
182 |
+ 'enabled' => !empty($modSettings['enable_solved_log']), |
|
183 |
+ 'label' => $txt['modlog_solve_log'], |
|
184 |
+ 'file' => 'Modlog.php', |
|
185 |
+ 'function' => 'ViewModlog', |
|
186 |
+ 'custom_url' => $scripturl . '?action=moderate;area=solvelog', |
|
187 |
+ ); |
|
109 | 188 |
} |
110 | 189 |
|
111 | 190 |
?> |
112 | 191 |
\ No newline at end of file |
... | ... |
@@ -158,7 +158,7 @@ function integrate_display_topic_solveTopic(&$topic_selects, &$topic_tables, &$t |
158 | 158 |
} |
159 | 159 |
|
160 | 160 |
/** |
161 |
- * Adds Topic Solved to our Actionn Log as its own section. |
|
161 |
+ * Adds Topic Solved to our Action Log as its own section. |
|
162 | 162 |
* |
163 | 163 |
* @param string &$log_types The log types. |
164 | 164 |
* |
... | ... |
@@ -169,26 +169,6 @@ function integrate_log_types_solveTopic(&$log_types) |
169 | 169 |
$log_types['solve'] = 4; |
170 | 170 |
} |
171 | 171 |
|
172 |
-/** |
|
173 |
- * Adds Topic Solved to our Moderation Menu. |
|
174 |
- * |
|
175 |
- * @param string &$menuData The menu data. |
|
176 |
- * |
|
177 |
- * @since 1.1 |
|
178 |
-*/ |
|
179 |
-function integrate_moderate_areas_solveTopic(&$menuData) |
|
180 |
-{ |
|
181 |
- global $modSettings, $txt, $scripturl; |
|
182 |
- |
|
183 |
- $menuData['main']['areas']['solvelog'] = array( |
|
184 |
- 'enabled' => !empty($modSettings['enable_solved_log']), |
|
185 |
- 'label' => $txt['modlog_solve_log'], |
|
186 |
- 'file' => 'Modlog.php', |
|
187 |
- 'function' => 'ViewModlog', |
|
188 |
- 'custom_url' => $scripturl . '?action=moderate;area=modlog;sa=solvelog', |
|
189 |
- ); |
|
190 |
-} |
|
191 |
- |
|
192 | 172 |
/** |
193 | 173 |
* Adds Topic Solved column to the Message Index Query. |
194 | 174 |
* |
... | ... |
@@ -38,25 +38,26 @@ |
38 | 38 |
<database>install-2.1.php</database> |
39 | 39 |
<redirect url="?action=admin;area=modsettings;sa=topicsolved" /> |
40 | 40 |
|
41 |
+ <!-- Core Startup --> |
|
41 | 42 |
<hook function="integrate_pre_load_solveTopic" hook="integrate_pre_load" file="$sourcedir/SolveTopic.php" /> |
42 |
- <hook hook="integrate_admin_include" file="$sourcedir/SolveTopic-Admin.php" /> |
|
43 |
- <hook function="add_ts_settings_menu" hook="integrate_modify_modifications" file="$sourcedir/SolveTopic-Admin.php" /> |
|
44 |
- <hook function="add_ts_adminmenu" hook="integrate_admin_areas" file="$sourcedir/SolveTopic-Admin.php" /> |
|
45 |
- <hook function="add_ts_permissions" hook="integrate_load_permissions" file="$sourcedir/SolveTopic.php" /> |
|
46 |
- |
|
47 | 43 |
<hook function="integrate_actions_solveTopic" hook="integrate_actions" file="$sourcedir/SolveTopic.php" /> |
48 |
- <hook function="integrate_moderate_areas_solveTopic" hook="integrate_moderate_areas" file="$sourcedir/SolveTopic.php" /> |
|
44 |
+ <hook function="integrate_log_types_solveTopic" hook="integrate_log_types" file="$sourcedir/SolveTopic.php" /> |
|
49 | 45 |
|
46 |
+ <!-- Display hooks --> |
|
50 | 47 |
<hook function="integrate_display_buttons_solveTopic" hook="integrate_display_buttons" file="$sourcedir/SolveTopic.php" /> |
51 | 48 |
<hook function="integrate_display_topic_solveTopic" hook="integrate_display_topic" file="$sourcedir/SolveTopic.php" /> |
52 | 49 |
|
53 |
- |
|
50 |
+ <!-- Message index hooks --> |
|
54 | 51 |
<hook function="integrate_message_index_solveTopic" hook="integrate_message_index" file="$sourcedir/SolveTopic.php" /> |
55 | 52 |
<hook function="integrate_messageindex_buttons_solveTopic" hook="integrate_messageindex_buttons" file="$sourcedir/SolveTopic.php" /> |
56 | 53 |
|
57 |
- <hook function="integrate_log_types_solveTopic" hook="integrate_log_types" file="$sourcedir/SolveTopic.php" /> |
|
54 |
+ <!-- Admin/Moderation Sections --> |
|
55 |
+ <hook hook="integrate_admin_include" file="$sourcedir/SolveTopic-Admin.php" /> |
|
56 |
+ <hook function="add_ts_adminmenu" hook="integrate_admin_areas" file="$sourcedir/SolveTopic-Admin.php" /> |
|
57 |
+ <hook function="add_ts_settings_menu" hook="integrate_modify_modifications" file="$sourcedir/SolveTopic-Admin.php" /> |
|
58 |
+ <hook function="add_ts_permissions" hook="integrate_load_permissions" file="$sourcedir/SolveTopic-Admin.php" /> |
|
59 |
+ <hook function="integrate_moderate_areas_solveTopic" hook="integrate_moderate_areas" file="$sourcedir/SolveTopic-Admin.php" /> |
|
58 | 60 |
<hook function="integrate_viewModLog_solveTopic" hook="integrate_viewModLog" file="$sourcedir/SolveTopic-Admin.php" /> |
59 |
- |
|
60 | 61 |
</install> |
61 | 62 |
<uninstall for="2.1 Beta 3, 2.1 Beta 4, 2.1 RC1"> |
62 | 63 |
<database>uninstall-optional.php</database> |
... | ... |
@@ -67,22 +68,25 @@ |
67 | 68 |
<remove-file name="$imagesdir/post/solved.png" /> |
68 | 69 |
<remove-file name="$themes_dir/default/SolveTopic-Display.template.php" /> |
69 | 70 |
|
71 |
+ <!-- Core Startup --> |
|
70 | 72 |
<hook function="integrate_pre_load_solveTopic" hook="integrate_pre_load" file="$sourcedir/SolveTopic.php" reverse="true" /> |
71 |
- <hook hook="integrate_admin_include" file="$sourcedir/SolveTopic-Admin.php" reverse="true" /> |
|
72 |
- <hook function="add_ts_settings_menu" hook="integrate_modify_modifications" file="$sourcedir/SolveTopic-Admin.php" reverse="true" /> |
|
73 |
- <hook function="add_ts_adminmenu" hook="integrate_admin_areas" file="$sourcedir/SolveTopic-Admin.php" reverse="true" /> |
|
74 |
- <hook function="add_ts_permissions" hook="integrate_load_permissions" file="$sourcedir/SolveTopic.php" reverse="true" /> |
|
75 |
- |
|
76 | 73 |
<hook function="integrate_actions_solveTopic" hook="integrate_actions" file="$sourcedir/SolveTopic.php" reverse="true" /> |
77 |
- <hook function="integrate_moderate_areas_solveTopic" hook="integrate_moderate_areas" file="$sourcedir/SolveTopic.php" reverse="true" /> |
|
74 |
+ <hook function="integrate_log_types_solveTopic" hook="integrate_log_types" file="$sourcedir/SolveTopic.php" reverse="true" /> |
|
78 | 75 |
|
76 |
+ <!-- Display hooks --> |
|
79 | 77 |
<hook function="integrate_display_buttons_solveTopic" hook="integrate_display_buttons" file="$sourcedir/SolveTopic.php" reverse="true" /> |
80 | 78 |
<hook function="integrate_display_topic_solveTopic" hook="integrate_display_topic" file="$sourcedir/SolveTopic.php" reverse="true" /> |
81 | 79 |
|
80 |
+ <!-- Message index hooks --> |
|
82 | 81 |
<hook function="integrate_message_index_solveTopic" hook="integrate_message_index" file="$sourcedir/SolveTopic.php" reverse="true" /> |
83 | 82 |
<hook function="integrate_messageindex_buttons_solveTopic" hook="integrate_messageindex_buttons" file="$sourcedir/SolveTopic.php" reverse="true" /> |
84 | 83 |
|
85 |
- <hook function="integrate_log_types_solveTopic" hook="integrate_log_types" file="$sourcedir/SolveTopic.php" reverse="true" /> |
|
84 |
+ <!-- Admin/Moderation Sections --> |
|
85 |
+ <hook hook="integrate_admin_include" file="$sourcedir/SolveTopic-Admin.php" reverse="true" /> |
|
86 |
+ <hook function="add_ts_settings_menu" hook="integrate_modify_modifications" file="$sourcedir/SolveTopic-Admin.php" reverse="true" /> |
|
87 |
+ <hook function="add_ts_adminmenu" hook="integrate_admin_areas" file="$sourcedir/SolveTopic-Admin.php" reverse="true" /> |
|
88 |
+ <hook function="add_ts_permissions" hook="integrate_load_permissions" file="$sourcedir/SolveTopic.php" reverse="true" /> |
|
89 |
+ <hook function="integrate_moderate_areas_solveTopic" hook="integrate_moderate_areas" file="$sourcedir/SolveTopic.php" reverse="true" /> |
|
86 | 90 |
<hook function="integrate_viewModLog_solveTopic" hook="integrate_viewModLog" file="$sourcedir/SolveTopic-Admin.php" reverse="true" /> |
87 | 91 |
</uninstall> |
88 | 92 |
|
89 | 93 |