Various Fixes and cleanup Add ability to collapse additional options. Convert over to using Hooks for Package-Info
jdarwood007

jdarwood007 commited on 2018-07-18 11:13:59
Showing 7 changed files, with 220 additions and 432 deletions.


Fixes #55
Fixes #25
Fixes #21
... ...
@@ -122,7 +122,6 @@ h3.ticketheader img {
122 122
 .shd_customfields {
123 123
 	width: 66%;
124 124
 	margin-bottom: 0;
125
-	float: left;
126 125
 	margin-top: 5px;
127 126
 }
128 127
 .shd_additional_details {
... ...
@@ -75,10 +75,6 @@ foreach (sd_get_install_rows() as $row)
75 75
 foreach (sd_get_install_columns() as $column)
76 76
 	$smcFunc['db_add_column']($column['table_name'], $column['column_info'], $column['parameters'], $column['if_exists'], $column['error']);
77 77
 
78
-// Add integration hooks, if any
79
-foreach (sd_get_install_hooks() as $hook)
80
-	add_integration_function($hook['hook'], $hook['function'], $hook['perm'], !isset($hook['file']) ? '' : $hook['file'], !isset($hook['object']) ? false : $hook['object']);
81
-
82 78
 // SimpleDesk specific, after schema changes
83 79
 sd_upgrade_create_depts();
84 80
 sd_upgrade_recreate_search();
... ...
@@ -244,195 +240,6 @@ function sd_get_install_columns()
244 240
 	return $columns;
245 241
 }
246 242
 
247
-/*
248
- * Gets a list of all the hooks we need during install
249
- *
250
- * @since 1.0
251
-*/
252
-function sd_get_install_hooks()
253
-{
254
-	// Hook references to be added.
255
-	$hooks = array();
256
-
257
-	// SMF Core stuff
258
-	$hooks[] = array(
259
-		'hook' => 'integrate_pre_include',
260
-		'function' => '$sourcedir/sd_source/Subs-SimpleDesk.php',
261
-		'perm' => true,
262
-	);
263
-	$hooks[] = array(
264
-		'hook' => 'integrate_user_info',
265
-		'function' => 'shd_init',
266
-		'perm' => true,
267
-	);
268
-	$hooks[] = array(
269
-		'hook' => 'integrate_actions',
270
-		'function' => 'shd_init_actions',
271
-		'perm' => true,
272
-	);
273
-	$hooks[] = array(
274
-		'hook' => 'integrate_buffer',
275
-		'function' => 'shd_buffer_replace',
276
-		'perm' => true,
277
-	);
278
-	$hooks[] = array(
279
-		'hook' => 'integrate_menu_buttons',
280
-		'function' => 'shd_main_menu',
281
-		'perm' => true,
282
-	);
283
-	$hooks[] = array(
284
-		'hook' => 'integrate_load_permissions',
285
-		'function' => 'shd_admin_smf_perms',
286
-		'perm' => true,
287
-	);
288
-	$hooks[] = array(
289
-		'hook' => 'integrate_error_types',
290
-		'function' => 'shd_error_types',
291
-		'file' => '$sourcedir/sd_source/Subs-SimpleDesk.php',
292
-		'perm' => true,
293
-	);
294
-	$hooks[] = array(
295
-		'hook' => 'integrate_bbc_codes',
296
-		'function' => 'shd_bbc_codes',
297
-		'file' => '$sourcedir/sd_source/Subs-SimpleDesk.php',
298
-		'perm' => true,
299
-	);
300
-	$hooks[] = array(
301
-		'hook' => 'integrate_post_parsebbc',
302
-		'function' => 'shd_parse_wikilinks',
303
-		'file' => '$sourcedir/sd_source/Subs-SimpleDesk.php',
304
-		'perm' => true,
305
-	);
306
-
307
-	// Admin Section Stuff
308
-	// Core
309
-	$hooks[] = array(
310
-		'hook' => 'integrate_admin_include',
311
-		'function' => '$sourcedir/sd_source/Subs-SimpleDeskAdmin.php',
312
-		'perm' => true,
313
-	);
314
-	$hooks[] = array(
315
-		'hook' => 'integrate_admin_areas',
316
-		'function' => 'shd_admin_bootstrap',
317
-		'perm' => true,
318
-	);
319
-	$hooks[] = array(
320
-		'hook' => 'integrate_admin_search',
321
-		'function' => 'shd_admin_search',
322
-		'perm' => true,
323
-	);
324
-	// Attachments
325
-	$hooks[] = array(
326
-		'hook' => 'integrate_remove_attachments',
327
-		'function' => 'shd_remove_attachments',
328
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskAdmin.php',
329
-		'perm' => true,
330
-	);
331
-	$hooks[] = array(
332
-		'hook' => 'integrate_repair_attachments_nomsg',
333
-		'function' => 'shd_repair_attachments_nomsg',
334
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php',
335
-		'perm' => true,
336
-	);
337
-	$hooks[] = array(
338
-		'hook' => 'integrate_attachments_browse',
339
-		'function' => 'shd_attachments_browse',
340
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php',
341
-		'perm' => true,
342
-	);
343
-	$hooks[] = array(
344
-		'hook' => 'integrate_attachment_remove',
345
-		'function' => 'shd_attachment_remove',
346
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php',
347
-		'perm' => true,
348
-	);
349
-	// Packages
350
-	$hooks[] = array(
351
-		'hook' => 'integrate_packages_sort_id',
352
-		'function' => 'shd_packages_sort_id',
353
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
354
-		'perm' => true,
355
-	);
356
-	$hooks[] = array(
357
-		'hook' => 'integrate_package_download',
358
-		'function' => 'shd_package_download',
359
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
360
-		'perm' => true,
361
-	);
362
-	$hooks[] = array(
363
-		'hook' => 'integrate_package_upload',
364
-		'function' => 'shd_package_upload',
365
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
366
-		'perm' => true,
367
-	);
368
-	$hooks[] = array(
369
-		'hook' => 'integrate_modification_types',
370
-		'function' => 'shd_modification_types',
371
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
372
-		'perm' => true,
373
-	);
374
-	// Other
375
-	$hooks[] = array(
376
-		'hook' => 'integrate_convert_msgbody',
377
-		'function' => 'shd_convert_msgbody',
378
-		'perm' => true,
379
-	);
380
-	$hooks[] = array(
381
-		'hook' => 'integrate_modifylanguages',
382
-		'function' => 'shd_modifylanguages',
383
-		'perm' => true,
384
-	);
385
-
386
-	// Display
387
-	$hooks[] = array(
388
-		'hook' => 'integrate_display_buttons',
389
-		'function' => 'shd_display_btn_mvtopic',
390
-		'perm' => true,
391
-	);
392
-	$hooks[] = array(
393
-		'hook' => 'integrate_download_request',
394
-		'function' => 'shd_download_request',
395
-		'perm' => true,
396
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskDisplay.php',
397
-	);
398
-
399
-	// BoardIndex
400
-	$hooks[] = array(
401
-		'hook' => 'integrate_getboardtree',
402
-		'function' => 'shd_add_to_boardindex',
403
-		'perm' => true,
404
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskBoardIndex.php',
405
-	);
406
-
407
-	// Profile
408
-	$hooks[] = array(
409
-		'hook' => 'integrate_pre_profile_areas',
410
-		'function' => 'shd_profile_areas',
411
-		'perm' => true,
412
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskProfile.php',
413
-	);
414
-	$hooks[] = array(
415
-		'hook' => 'integrate_profile_profileSaveGroups',
416
-		'function' => 'shd_clear_active_tickets',
417
-		'perm' => true,
418
-	);
419
-	$hooks[] = array(
420
-		'hook' => 'integrate_profile_trackip',
421
-		'function' => 'shd_profile_trackip',
422
-		'perm' => true,
423
-	);
424
-
425
-	// Other
426
-	$hooks[] = array(
427
-		'hook' => 'integrate_SSI',
428
-		'function' => false,
429
-		'file' => '$sourcedir/sd_source/SimpleDesk-SSI.php',
430
-		'perm' => true,
431
-	);
432
-
433
-	return $hooks;
434
-}
435
-
436 243
 /*
437 244
  * Gets a list of all the tables we need to install SimpleDesk
438 245
  *
... ...
@@ -6,11 +6,11 @@
6 6
 	<version>2.1</version>
7 7
 	<type>modification</type>
8 8
 
9
-	<install for="1.1.*, 2.0 RC2, 2.0 RC3, 2.0 RC4, 2.0 RC5">
10
-		<readme lang="english" parsebbc="true" type="inline">This mod is [b]not compatible[/b] with your version of SMF, it requires 2.0 final or later.</readme>
9
+	<install for="1.1.*, 2.0.*">
10
+		<readme lang="english" parsebbc="true" type="inline">This mod is [b]not compatible[/b] with your version of SMF, it requires 2.1 or later.</readme>
11 11
 	</install>
12 12
 
13
-	<install for="2.0, 2.0.1-2.0.99, 2.1 Beta 1, 2.1 Beta 2">
13
+	<install for="2.1 Beta 1, 2.1 Beta 2">
14 14
 		<readme lang="english" parsebbc="true" type="inline">This package is for SMF 2.1, to install SimpleDesk on your version of SMF use the proper package.</readme>
15 15
 	</install>
16 16
 
... ...
@@ -47,6 +47,55 @@
47 47
 		<require-dir name="sd_plugins_template" destination="$themes_dir/default" />
48 48
 		<require-dir name="sd_plugins_lang" destination="$languagedir" />
49 49
 
50
+		<!-- All the hooks -->
51
+			<!-- SMF Core -->
52
+		<hook hook="integrate_pre_include" function="$sourcedir/sd_source/Subs-SimpleDesk.php" />
53
+		<hook hook="integrate_user_info" function="shd_init" />
54
+		<hook hook="integrate_actions" function="shd_init_actions" />
55
+		<hook hook="integrate_buffer" function="shd_buffer_replace" />
56
+		<hook hook="integrate_menu_buttons" function="shd_main_menu" />
57
+		<hook hook="integrate_load_permissions" function="shd_admin_smf_perms" />
58
+		<hook hook="integrate_error_types" function="shd_error_types" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
59
+		<hook hook="integrate_bbc_codes" function="shd_bbc_codes" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
60
+		<hook hook="integrate_post_parsebbc" function="shd_parse_wikilinks" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
61
+
62
+			<!-- Admin Section: Core -->
63
+		<hook hook="integrate_admin_include" function="$sourcedir/sd_source/Subs-SimpleDeskAdmin.php" />
64
+		<hook hook="integrate_admin_areas" function="shd_admin_bootstrap" />
65
+		<hook hook="integrate_admin_search" function="shd_admin_search" />
66
+
67
+			<!-- Admin Section: Attachments -->
68
+		<hook hook="integrate_remove_attachments" function="shd_remove_attachments" file="$sourcedir/sd_source/Subs-SimpleDeskAdmin.php" />
69
+		<hook hook="integrate_attachments_browse" function="shd_attachments_browse" file="$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php" />
70
+		<hook hook="integrate_attachment_remove" function="shd_attachment_remove" file="$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php" />
71
+
72
+			<!-- Admin Section: Packages -->
73
+		<hook hook="integrate_packages_sort_id" function="shd_packages_sort_id" file="$sourcedir/sd_source/Subs-SimpleDeskPackages.php" />
74
+		<hook hook="integrate_package_download" function="shd_package_download" file="$sourcedir/sd_source/Subs-SimpleDeskPackages.php" />
75
+		<hook hook="integrate_package_upload" function="shd_package_upload" file="$sourcedir/sd_source/Subs-SimpleDeskPackages.php" />
76
+		<hook hook="integrate_modification_types" function="shd_modification_types" file="$sourcedir/sd_source/Subs-SimpleDeskPackages.php" />
77
+
78
+			<!-- Admin Section: Other -->
79
+		<hook hook="integrate_convert_msgbody" function="shd_convert_msgbody" />
80
+		<hook hook="integrate_modifylanguages" function="shd_modifylanguages" />
81
+
82
+			<!-- Display -->
83
+		<hook hook="integrate_display_buttons" function="shd_display_btn_mvtopic" />
84
+
85
+			<!-- ShowAttachments -->
86
+		<hook hook="integrate_download_request" function="shd_download_request" file="$sourcedir/sd_source/Subs-SimpleDeskDisplay.php" />
87
+
88
+			<!-- BoardIndex -->
89
+		<hook hook="integrate_getboardtree" function="shd_add_to_boardindex" file="$sourcedir/sd_source/Subs-SimpleDeskBoardIndex.php" />
90
+
91
+			<!-- Profile -->
92
+		<hook hook="integrate_pre_profile_areas" function="shd_profile_areas" file="$sourcedir/sd_source/Subs-SimpleDeskProfile.php" />
93
+		<hook hook="integrate_profile_profileSaveGroups" function="shd_clear_active_tickets" />
94
+		<hook hook="integrate_profile_trackip" function="shd_profile_trackip" />
95
+
96
+			<!-- Other -->
97
+		<hook hook="integrate_SSI" function="$sourcedir/SimpleDesk-SSI.php" />
98
+
50 99
 		<!-- database changes -->
51 100
 		<database>install.php</database>
52 101
 
... ...
@@ -58,6 +107,55 @@
58 107
 		<database>uninstall-optional.php</database>
59 108
 		<code type="file">uninstall-required.php</code>
60 109
 
110
+		<!-- All the hooks -->
111
+			<!-- SMF Core -->
112
+		<hook hook="integrate_pre_include" function="$sourcedir/sd_source/Subs-SimpleDesk.php" reverse="true" />
113
+		<hook hook="integrate_user_info" function="shd_init" reverse="true" />
114
+		<hook hook="integrate_actions" function="shd_init_actions" reverse="true" />
115
+		<hook hook="integrate_buffer" function="shd_buffer_replace" reverse="true" />
116
+		<hook hook="integrate_menu_buttons" function="shd_main_menu" reverse="true" />
117
+		<hook hook="integrate_load_permissions" function="shd_admin_smf_perms" reverse="true" />
118
+		<hook hook="integrate_error_types" function="shd_error_types" file="$sourcedir/sd_source/Subs-SimpleDesk.php" reverse="true" />
119
+		<hook hook="integrate_bbc_codes" function="shd_bbc_codes" file="$sourcedir/sd_source/Subs-SimpleDesk.php" reverse="true" />
120
+		<hook hook="integrate_post_parsebbc" function="shd_parse_wikilinks" file="$sourcedir/sd_source/Subs-SimpleDesk.php" reverse="true" />
121
+
122
+			<!-- Admin Section: Core -->
123
+		<hook hook="integrate_admin_include" function="$sourcedir/sd_source/Subs-SimpleDeskAdmin.php" reverse="true" />
124
+		<hook hook="integrate_admin_areas" function="shd_admin_bootstrap" reverse="true" />
125
+		<hook hook="integrate_admin_search" function="shd_admin_search" reverse="true" />
126
+
127
+			<!-- Admin Section: Attachments -->
128
+		<hook hook="integrate_remove_attachments" function="shd_remove_attachments" file="$sourcedir/sd_source/Subs-SimpleDeskAdmin.php" reverse="true" />
129
+		<hook hook="integrate_attachments_browse" function="shd_attachments_browse" file="$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php" reverse="true" />
130
+		<hook hook="integrate_attachment_remove" function="shd_attachment_remove" file="$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php" reverse="true" />
131
+
132
+			<!-- Admin Section: Packages -->
133
+		<hook hook="integrate_packages_sort_id" function="shd_packages_sort_id" file="$sourcedir/sd_source/Subs-SimpleDeskPackages.php" reverse="true" />
134
+		<hook hook="integrate_package_download" function="shd_package_download" file="$sourcedir/sd_source/Subs-SimpleDeskPackages.php" reverse="true" />
135
+		<hook hook="integrate_package_upload" function="shd_package_upload" file="$sourcedir/sd_source/Subs-SimpleDeskPackages.php" reverse="true" />
136
+		<hook hook="integrate_modification_types" function="shd_modification_types" file="$sourcedir/sd_source/Subs-SimpleDeskPackages.php" reverse="true" />
137
+
138
+			<!-- Admin Section: Other -->
139
+		<hook hook="integrate_convert_msgbody" function="shd_convert_msgbody" reverse="true" />
140
+		<hook hook="integrate_modifylanguages" function="shd_modifylanguages" reverse="true" />
141
+
142
+			<!-- Display -->
143
+		<hook hook="integrate_display_buttons" function="shd_display_btn_mvtopic" reverse="true" />
144
+
145
+			<!-- ShowAttachments -->
146
+		<hook hook="integrate_download_request" function="shd_download_request" file="$sourcedir/sd_source/Subs-SimpleDeskDisplay.php" reverse="true" />
147
+
148
+			<!-- BoardIndex -->
149
+		<hook hook="integrate_getboardtree" function="shd_add_to_boardindex" file="$sourcedir/sd_source/Subs-SimpleDeskBoardIndex.php" reverse="true" />
150
+
151
+			<!-- Profile -->
152
+		<hook hook="integrate_pre_profile_areas" function="shd_profile_areas" file="$sourcedir/sd_source/Subs-SimpleDeskProfile.php" reverse="true" />
153
+		<hook hook="integrate_profile_profileSaveGroups" function="shd_clear_active_tickets" reverse="true" />
154
+		<hook hook="integrate_profile_trackip" function="shd_profile_trackip" reverse="true" />
155
+
156
+			<!-- Other -->
157
+		<hook hook='integrate_SSI' function='$sourcedir/SimpleDesk-SSI.php' reverse='true' />
158
+
61 159
 		<!-- language files, removed -->
62 160
 		<remove-dir name="$themes_dir/default/languages/sd_language" />
63 161
 
... ...
@@ -78,7 +176,8 @@
78 176
 		<remove-file name="$themedir/css/helpdesk_icons.css" />
79 177
 
80 178
 		<!-- bundled plugins removed (NOTE: done one by one to avoid eating existing plugins on upgrade) -->
81
-		<remove-dir name="$languagedir/sd_plugin_lang" />
179
+		<remove-dir name="$languagedir/sd_plugins_lang/SDPluginFrontPage.english.php" />
180
+		<remove-dir name="$languagedir/sd_plugins_lang/SDPluginStats.english.php" />
82 181
 
83 182
 		<!-- scripts, removed -->
84 183
 		<remove-file name="$themedir/scripts/helpdesk_admin.js" />
... ...
@@ -71,28 +71,27 @@ function shd_ajax()
71 71
 	$context['ajax_raw'] = '';
72 72
 
73 73
 	if (!empty($_REQUEST['op']) && !empty($subactions[$_REQUEST['op']]))
74
-		$subactions[$_REQUEST['op']]();
74
+		$result = $subactions[$_REQUEST['op']]();
75
+
76
+	if (empty($context['ajax_return']) && empty($context['ajax_raw']) && !empty($result))
77
+		$context['ajax_return'] = $result;
75 78
 
76 79
 	// Json support.
77 80
 	if (isset($context['ajax_type']) && $context['ajax_type'] == 'json')
78
-	{
79
-		header('Content-Type: application/json; charset=UTF8');
80
-
81
-		if (empty($context['ajax_raw']) && is_array($context['ajax_return']) && isset($context['ajax_return']['success']))
82
-			echo json_encode($context['ajax_return']);
83
-		elseif (empty($context['ajax_raw']) && is_array($context['ajax_return']))
84
-			echo json_encode(array_merge(array('success' => true), $context['ajax_return']));
85
-		elseif (!empty($context['ajax_raw']) && is_array($context['ajax_raw']))
86
-			echo json_encode($context['ajax_return']);
87
-		elseif (!empty($context['ajax_raw']))
88
-			echo $context['ajax_raw'];
81
+		return shd_ajax_json_response();
89 82
 	else
90
-			echo json_encode(array('success' => false));
91
-
92
-		obExit(false);
83
+		return shd_ajax_xml_response();
93 84
 }
94
-	else
85
+
86
+/**
87
+ *	Handles returning a response in XML format
88
+ *
89
+ *  @since 2.1
90
+*/
91
+function shd_ajax_xml_response()
95 92
 {
93
+	global $context;
94
+
96 95
 	header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
97 96
 	echo '<?xml version="1.0" encoding="', $context['character_set'], '"?' . '>';
98 97
 
... ...
@@ -121,11 +120,33 @@ function shd_ajax()
121 120
 </response>';
122 121
 	}
123 122
 	else
124
-		{
125 123
 		echo $context['ajax_raw']; // assumed to be just well formed XML sans the header
126
-		}
127 124
 	obExit(false);
128 125
 }
126
+
127
+/**
128
+ *	Handles returning a response in JSON format
129
+ *
130
+ *  @since 2.1
131
+*/
132
+function shd_ajax_json_response()
133
+{
134
+	global $context;
135
+
136
+	header('Content-Type: application/json; charset=UTF8');
137
+
138
+	if (empty($context['ajax_raw']) && is_array($context['ajax_return']) && isset($context['ajax_return']['success']))
139
+		echo json_encode($context['ajax_return']);
140
+	elseif (empty($context['ajax_raw']) && is_array($context['ajax_return']))
141
+		echo json_encode(array_merge(array('success' => true), $context['ajax_return']));
142
+	elseif (!empty($context['ajax_raw']) && is_array($context['ajax_raw']))
143
+		echo json_encode($context['ajax_return']);
144
+	elseif (!empty($context['ajax_raw']))
145
+		echo $context['ajax_raw'];
146
+	else
147
+		echo json_encode(array('success' => false));
148
+
149
+	obExit(false);
129 150
 }
130 151
 
131 152
 /**
... ...
@@ -142,7 +163,7 @@ function shd_ajax()
142 163
  *	- clear the cache of tickets for the Helpdesk menu item
143 164
  *	- return $context['ajax_return']['message'] as the new privacy item
144 165
  *
145
- *	@return bool|null Ignored by the main handler, but returns true.
166
+ *	@return array Response data for Ajax.
146 167
  *  @since 1.0
147 168
 */
148 169
 function shd_ajax_privacy()
... ...
@@ -154,17 +175,11 @@ function shd_ajax_privacy()
154 175
 
155 176
 	$session_check = checkSession('get', '', false); // check the session but don't die fatally.
156 177
 	if (!empty($session_check))
157
-	{
158
-		$context['ajax_return'] = array('success' => false, 'error' => $txt[$session_check]);
159
-		return;
160
-	}
178
+		return array('success' => false, 'error' => $txt[$session_check]);
161 179
 
162 180
 	// First, figure out the state of the ticket - is it private or not? Can we even see it?
163 181
 	if (empty($context['ticket_id']))
164
-	{
165
-		$context['ajax_return'] = array('success' => false, 'error' => $txt['shd_no_ticket']);
166
-		return;
167
-	}
182
+		return array('success' => false, 'error' => $txt['shd_no_ticket']);
168 183
 
169 184
 	$query = shd_db_query('', '
170 185
 		SELECT id_member_started, subject, private, status, id_dept
... ...
@@ -179,10 +194,7 @@ function shd_ajax_privacy()
179 194
 	if ($row = $smcFunc['db_fetch_assoc']($query))
180 195
 	{
181 196
 		if (in_array($row['status'], array(TICKET_STATUS_CLOSED, TICKET_STATUS_DELETED)) || !shd_allowed_to('shd_alter_privacy_any', $row['id_dept']) && (!shd_allowed_to('shd_alter_privacy_own', $row['id_dept']) || $row['id_member_started'] != $user_info['id']))
182
-		{
183
-			$context['ajax_return'] = array('success' => false, 'error' => $txt['shd_cannot_change_privacy']);
184
-			return;
185
-		}
197
+			return array('success' => false, 'error' => $txt['shd_cannot_change_privacy']);
186 198
 
187 199
 		$smcFunc['db_free_result']($query);
188 200
 
... ...
@@ -209,13 +221,10 @@ function shd_ajax_privacy()
209 221
 		// Make sure we recalculate the number of tickets on next page load
210 222
 		shd_clear_active_tickets($row['id_dept']);
211 223
 
212
-		$context['ajax_return'] = array('success' => true, 'message' => $new ? $txt['shd_ticket_private'] : $txt['shd_ticket_notprivate']);
224
+		return array('success' => true, 'message' => $new ? $txt['shd_ticket_private'] : $txt['shd_ticket_notprivate']);
213 225
 	}
214 226
 	else
215
-	{
216
-		$context['ajax_return'] = array('success' => false, 'error' => $txt['shd_no_ticket']);
217
-		return;
218
-	}
227
+		return array('success' => false, 'error' => $txt['shd_no_ticket']);
219 228
 }
220 229
 
221 230
 /**
... ...
@@ -233,7 +242,7 @@ function shd_ajax_privacy()
233 242
  *	- identify whether the new urgency continues to allow the current user to change urgency or not
234 243
  *	- put the button links if appropriate into $context['ajax_return']['increase'] and $context['ajax_return']['decrease'] and return
235 244
  *
236
- *	@return bool|null Ignored by the main handler, but returns true.
245
+ *	@return array Response data for Ajax.
237 246
  *  @since 1.0
238 247
 */
239 248
 function shd_ajax_urgency()
... ...
@@ -245,17 +254,11 @@ function shd_ajax_urgency()
245 254
 
246 255
 	$session_check = checkSession('get', '', false); // check the session but don't die fatally.
247 256
 	if (!empty($session_check))
248
-	{
249
-		$context['ajax_return'] = array('success' => false, 'error' => $txt[$session_check]);
250
-		return;
251
-	}
257
+		return array('success' => false, 'error' => $txt[$session_check]);
252 258
 
253 259
 	// First, figure out the state of the ticket - is it private or not? Can we even see it?
254 260
 	if (empty($context['ticket_id']))
255
-	{
256
-		$context['ajax_return'] = array('success' => false, 'error' => $txt['shd_no_ticket']);
257
-		return;
258
-	}
261
+		return array('success' => false, 'error' => $txt['shd_no_ticket']);
259 262
 
260 263
 	$query = shd_db_query('', '
261 264
 		SELECT id_member_started, subject, urgency, status, id_dept
... ...
@@ -272,10 +275,7 @@ function shd_ajax_urgency()
272 275
 		$can_urgency = shd_can_alter_urgency($row['urgency'], $row['id_member_started'], ($row['status'] == TICKET_STATUS_CLOSED), ($row['status'] == TICKET_STATUS_DELETED), $row['id_dept']);
273 276
 
274 277
 		if (empty($_GET['change']) || empty($can_urgency[$_GET['change']]))
275
-		{
276
-			$context['ajax_return'] = array('success' => false, 'error' => $txt['shd_cannot_change_urgency']);
277
-			return;
278
-		}
278
+			return array('success' => false, 'error' => $txt['shd_cannot_change_urgency']);
279 279
 
280 280
 		$new_urgency = $row['urgency'] + ($_GET['change'] == 'increase' ? 1 : -1);
281 281
 		$action = 'urgency_' . $_GET['change'];
... ...
@@ -314,13 +314,10 @@ function shd_ajax_urgency()
314 314
 			if ($can)
315 315
 				$context['ajax_return'][$button] = $array[$button];
316 316
 
317
-		return;
317
+		return $context['ajax_return'];
318 318
 	}
319 319
 	else
320
-	{
321
-		$context['ajax_return'] = array('error' => $txt['shd_no_ticket']);
322
-		return;
323
-	}
320
+		return array('error' => $txt['shd_no_ticket']);
324 321
 }
325 322
 
326 323
 /**
... ...
@@ -335,7 +332,7 @@ function shd_ajax_urgency()
335 332
  *	- Do other XML sanitising
336 333
  *	- Return via $context['ajax_raw'] for {@link shd_ajax()} to output
337 334
  *
338
- *	@return bool|null Ignored by the main handler, but returns true.
335
+ *	@return array Response data for Ajax.
339 336
  *  @since 1.0
340 337
 */
341 338
 function shd_ajax_quote()
... ...
@@ -398,7 +395,7 @@ function shd_ajax_quote()
398 395
 		}
399 396
 	}
400 397
 
401
-	$context['ajax_return'] = array('success' => true, 'message' => $message);
398
+	return array('success' => true, 'message' => $message);
402 399
 }
403 400
 
404 401
 /**
... ...
@@ -412,7 +409,7 @@ function shd_ajax_quote()
412 409
  *	- Do other XML sanitising
413 410
  *	- Return via $context['ajax_raw'] for {@link shd_ajax()} to output
414 411
  *
415
- *	@return bool|null Ignored by the main handler, but returns true.
412
+ *	@return array Response data for Ajax.
416 413
  *  @since 2.0
417 414
 */
418 415
 function shd_ajax_canned()
... ...
@@ -449,7 +446,7 @@ function shd_ajax_canned()
449 446
 		if ($smcFunc['db_num_rows']($query) == 0)
450 447
 		{
451 448
 			$smcFunc['db_free_result']($query);
452
-			return $context['ajax_raw'] = '<quote>' . $message . '</quote>';
449
+			return array('success' => true, 'message' => $message);
453 450
 		}
454 451
 
455 452
 		$row = $smcFunc['db_fetch_assoc']($query);
... ...
@@ -457,19 +454,19 @@ function shd_ajax_canned()
457 454
 
458 455
 		// Check ability to reply to this ticket. No ability to reply at all, no canned reply.
459 456
 		if (!shd_allowed_to('shd_reply_ticket_own', $row['id_dept']) && !shd_allowed_to('shd_reply_ticket_any', $row['id_dept']))
460
-			return $context['ajax_raw'] = '<quote>' . $message . '</quote>';
457
+			return array('success' => true, 'message' => $message);
461 458
 
462 459
 		// Now check for can-reply-to-own (reply to any will pass this check correctly anyway)
463 460
 		if (!shd_allowed_to('shd_reply_ticket_any', $row['id_dept']) && shd_allowed_to('shd_reply_ticket_own', $row['id_dept']) && $row['id_member_started'] != $user_info['id'])
464
-			return $context['ajax_raw'] = '<quote>' . $message . '</quote>';
461
+			return array('success' => true, 'message' => $message);
465 462
 
466 463
 		// Now verify the per-reply visibility. Only applies to non admins anyway...
467 464
 		if (!shd_allowed_to('admin_helpdesk', $row['id_dept']) && !$user_info['is_admin'])
468 465
 		{
469 466
 			if (shd_allowed_to('shd_staff', $row['id_dept']) && empty($row['vis_staff']))
470
-				return $context['ajax_raw'] = '<quote>' . $message . '</quote>';
467
+				return array('success' => true, 'message' => $message);
471 468
 			elseif (!shd_allowed_to('shd_staff', $row['id_dept']) && empty($row['vis_user']))
472
-				return $context['ajax_raw'] = '<quote>' . $message . '</quote>';
469
+				return array('success' => true, 'message' => $message);
473 470
 		}
474 471
 
475 472
 		$message = un_preparsecode($row['body']);
... ...
@@ -489,7 +486,7 @@ function shd_ajax_canned()
489 486
 
490 487
 	$message = strtr($message, array('&nbsp;' => '&#160;', '<' => '&lt;', '>' => '&gt;'));
491 488
 
492
-	$context['ajax_return'] = array('success' => true, 'message' => $message);
489
+	return array('success' => true, 'message' => $message);
493 490
 }
494 491
 
495 492
 /**
... ...
@@ -502,7 +499,7 @@ function shd_ajax_canned()
502 499
  *	- Get the list of who can be assigned a ticket.
503 500
  *	- Return that via AJAX.
504 501
  *
505
- *	@return bool|null Ignored by the main handler, but returns true.
502
+ *	@return array Response data for Ajax.
506 503
  *  @since 1.0
507 504
 */
508 505
 function shd_ajax_assign()
... ...
@@ -530,17 +527,17 @@ function shd_ajax_assign()
530 527
 		$smcFunc['db_free_result']($query);
531 528
 	}
532 529
 	if (empty($valid))
533
-		return $context['ajax_return'] = array('success' => false, 'error' => $txt['shd_no_ticket']);
530
+		return array('success' => false, 'error' => $txt['shd_no_ticket']);
534 531
 
535 532
 	require_once($sourcedir . '/sd_source/SimpleDesk-Assign.php');
536 533
 	$assignees = shd_get_possible_assignees($private, $ticket_starter, $dept);
537 534
 	array_unshift($assignees, 0); // add the unassigned option in at the start
538 535
 
539 536
 	if (empty($assignees))
540
-		return $context['ajax_return'] = array('success' => false, 'error' => $txt['shd_no_staff_assign']);
537
+		return array('success' => false, 'error' => $txt['shd_no_staff_assign']);
541 538
 
542 539
 	if (!shd_allowed_to('shd_assign_ticket_any', $dept) || $status == TICKET_STATUS_CLOSED || $status == TICKET_STATUS_DELETED)
543
-		return $context['ajax_return'] = array('success' => false, 'error' => $txt['shd_cannot_assign']);
540
+		return array('success' => false, 'error' => $txt['shd_cannot_assign']);
544 541
 
545 542
 	// OK, so we have the general values we need. Let's get user names, and get ready to kick this back to the user. We'll build the XML here though.
546 543
 	loadMemberData($assignees);
... ...
@@ -570,7 +567,7 @@ function shd_ajax_assign()
570 567
  *	- Get the list of who can be assigned a ticket; if requested user not on that list, bail.
571 568
  *	- Update and build return status, and return via AJAX.
572 569
  *
573
- *	@return bool|null Ignored by the main handler, but returns true.
570
+ *	@return array Response data for Ajax.
574 571
  *  @since 1.0
575 572
  */
576 573
 function shd_ajax_assign2()
... ...
@@ -598,13 +595,13 @@ function shd_ajax_assign2()
598 595
 		$smcFunc['db_free_result']($query);
599 596
 	}
600 597
 	if (empty($valid))
601
-		return $context['ajax_return'] = array('error' => $txt['shd_no_ticket']);
598
+		return array('error' => $txt['shd_no_ticket']);
602 599
 
603 600
 	if (!isset($_GET['to_user']) || !is_numeric($_GET['to_user']))
604
-		return $context['ajax_return'] = array('success' => false, 'error' => $txt['shd_assigned_not_permitted'] . 'line459');
601
+		return array('success' => false, 'error' => $txt['shd_assigned_not_permitted'] . 'line459');
605 602
 
606 603
 	if (!shd_allowed_to('shd_assign_ticket_any', $dept) || $status == TICKET_STATUS_CLOSED || $status == TICKET_STATUS_DELETED)
607
-		return $context['ajax_return'] = array('success' => false, 'error' => $txt['shd_cannot_assign']);
604
+		return array('success' => false, 'error' => $txt['shd_cannot_assign']);
608 605
 
609 606
 	$_GET['to_user'] = isset($_GET['to_user']) ? (int) $_GET['to_user'] : 0;
610 607
 
... ...
@@ -613,7 +610,7 @@ function shd_ajax_assign2()
613 610
 	array_unshift($assignees, 0); // add the unassigned option in at the start
614 611
 
615 612
 	if (!in_array($_GET['to_user'], $assignees))
616
-		return $context['ajax_return'] = array('success' => false, 'error' => $txt['shd_assigned_not_permitted']);
613
+		return array('success' => false, 'error' => $txt['shd_assigned_not_permitted']);
617 614
 
618 615
 	if (!empty($_GET['to_user']))
619 616
 		loadMemberData($_GET['to_user']);
... ...
@@ -633,13 +630,13 @@ function shd_ajax_assign2()
633 630
 		shd_commit_assignment($context['ticket_id'], $_GET['to_user'], true);
634 631
 	}
635 632
 
636
-	return $context['ajax_return'] = array('success' => true, 'assigned' => $user_name);
633
+	return array('success' => true, 'assigned' => $user_name);
637 634
 }
638 635
 
639 636
 /**
640 637
  *	Provide the list of possible notification recipients.
641 638
  *
642
- *	@return bool|null Ignored by the main handler, but returns true.
639
+ *	@return array Response data for Ajax.
643 640
  *	@since 2.0
644 641
 */
645 642
 function shd_ajax_notify()
... ...
@@ -651,7 +648,7 @@ function shd_ajax_notify()
651 648
 
652 649
 	$session_check = checkSession('get', '', false); // check the session but don't die fatally.
653 650
 	if (!empty($session_check))
654
-		return $context['ajax_return'] = array('success' => false, 'error' => $txt[$session_check]);
651
+		return array('success' => false, 'error' => $txt[$session_check]);
655 652
 
656 653
 	shd_load_language('sd_language/SimpleDeskNotifications');
657 654
 	require_once($sourcedir . '/sd_source/SimpleDesk-Notifications.php');
... ...
@@ -672,7 +669,7 @@ function shd_ajax_notify()
672 669
 		$smcFunc['db_free_result']($query);
673 670
 	}
674 671
 	if (empty($ticket) || !shd_allowed_to('shd_singleton_email', $ticket['id_dept']) || $ticket['status'] == TICKET_STATUS_CLOSED || $ticket['status'] == TICKET_STATUS_DELETED)
675
-		return $context['ajax_return'] = array('success' => false, 'error' => $txt['shd_no_ticket']);
672
+		return array('success' => false, 'error' => $txt['shd_no_ticket']);
676 673
 
677 674
 	// So, we need to start figuring out who's going to be notified, who won't be and who we might be interested in notifying.
678 675
 	$notify_list = array(
... ...
@@ -853,7 +850,7 @@ function shd_ajax_notify()
853 850
 					$selected[] = (int) $id;
854 851
 		}
855 852
 
856
-		return $context['ajax_return'] = array(
853
+		return array(
857 854
 			'success' => true,
858 855
 			'being_notified_txt' => !empty($notify_list['being_notified']) ? $txt['shd_ping_already_' . (count($notify_list['being_notified']) == 1 ? '1' : 'n')] : '',
859 856
 			'being_notified' => !empty($notify_list['being_notified']) ? $notify_list['being_notified'] : array(),
... ...
@@ -6,14 +6,14 @@
6 6
  *	customised views for the recycle bin and the list of resolved tickets.
7 7
  *
8 8
  *	@package template
9
- *	@since 1.0
9
+ *	@since 2.1
10 10
 */
11 11
 
12 12
 /**
13 13
  *	Board Index Integration for SimpleDesk Icons.
14 14
  *
15 15
  *  @param array $board Current board information.
16
- *	@since 2.0
16
+ *	@since 2.1
17 17
 */
18 18
 function template_bi_shd_icon($board)
19 19
 {
... ...
@@ -27,6 +27,7 @@ function template_bi_shd_icon($board)
27 27
  *	Board Index Integration for SimpleDesk Stats.
28 28
  *
29 29
  *  @param array $board Current board information.
30
+ *  @since 2.1
30 31
  */
31 32
 function template_bi_shd_stats($board)
32 33
 {
... ...
@@ -150,6 +150,12 @@ function template_ticket_custom_fields()
150 150
 		return;
151 151
 
152 152
 	echo '
153
+				<br class="clear">
154
+				<div class="title_bar"', empty($context['ticket_form']['dept']) ? ' style="display:none;"' : '', '>
155
+					<h3 class="titlebg">
156
+						<a href="#">', $txt['shd_ticket_additional_details'], '</a>
157
+					</h3>
158
+				</div>
153 159
 				<div class="shd_customfields" id="shd_customfields"', empty($context['ticket_form']['dept']) ? ' style="display:none;"' : '', '>';
154 160
 
155 161
 		// Loop through each custom field
... ...
@@ -626,6 +632,13 @@ function template_ticket_additional_options()
626 632
 	global $context, $options, $txt, $modSettings, $settings;
627 633
 
628 634
 	echo '
635
+					<br class="clear">
636
+					<div class="title_bar">
637
+						<h3 class="titlebg">
638
+							<span class="toggle_up floatright" id="shd_additionalOptionsToggle"></span>
639
+							<a href="#" id="shd_additionalOptionsLink">', $txt['shd_ticket_additional_information'], '</a>
640
+						</h3>
641
+					</div>
629 642
 					<div id="postAdditionalOptionsHeader"', !empty($context['shd_display']) ? ' style="display:none;"' : '', ' class="shd_reply_attachments">
630 643
 						<ul class="post_options">';
631 644
 
... ...
@@ -644,7 +657,31 @@ function template_ticket_additional_options()
644 657
 	template_add_attachments();
645 658
 
646 659
 	echo '
647
-					</div>';
660
+					</div>
661
+					<script>
662
+						var oAdditionalOptionsToggle = new smc_Toggle({
663
+							bToggleEnabled: true,
664
+							bCurrentlyCollapsed: ', empty($options['collapse_shd_additionalOptions']) ? 'false' : 'true', ',
665
+							aSwappableContainers: [
666
+								\'postAdditionalOptionsHeader\'
667
+							],
668
+							aSwapImages: [
669
+								{
670
+									sId: \'shd_additionalOptionsToggle\',
671
+								}
672
+							],
673
+							oThemeOptions: {
674
+								bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
675
+								sOptionName: \'collapse_shd_additionalOptions\',
676
+								sSessionId: smf_session_id,
677
+								sSessionVar: smf_session_var,
678
+							},
679
+							oCookieOptions: {
680
+								bUseCookie: false,
681
+								sCookieName: \'shd_additionalOptions\'
682
+							}
683
+						});
684
+					</script>';
648 685
 
649 686
 	template_singleton_email();
650 687
 }
... ...
@@ -45,159 +45,7 @@ elseif (!defined('SMF'))
45 45
 	die('<b>Error:</b> Cannot uninstall - please verify you put this file in the same place as SMF\'s SSI.php.');
46 46
 }
47 47
 
48
-// 2. Removing all the SMF hooks.
49
-$hooks = array();
50
-// SMF Core stuff
51
-	$hooks[] = array(
52
-		'hook' => 'integrate_pre_include',
53
-		'function' => '$sourcedir/sd_source/Subs-SimpleDesk.php',
54
-	);
55
-	$hooks[] = array(
56
-		'hook' => 'integrate_user_info',
57
-		'function' => 'shd_init',
58
-	);
59
-	$hooks[] = array(
60
-		'hook' => 'integrate_actions',
61
-		'function' => 'shd_init_actions',
62
-	);
63
-	$hooks[] = array(
64
-		'hook' => 'integrate_buffer',
65
-		'function' => 'shd_buffer_replace',
66
-	);
67
-	$hooks[] = array(
68
-		'hook' => 'integrate_menu_buttons',
69
-		'function' => 'shd_main_menu',
70
-	);
71
-	$hooks[] = array(
72
-		'hook' => 'integrate_load_permissions',
73
-		'function' => 'shd_admin_smf_perms',
74
-	);
75
-	$hooks[] = array(
76
-		'hook' => 'integrate_error_types',
77
-		'function' => 'shd_error_types',
78
-		'file' => '$sourcedir/sd_source/Subs-SimpleDesk.php',
79
-	);
80
-	$hooks[] = array(
81
-		'hook' => 'integrate_bbc_codes',
82
-		'function' => 'shd_bbc_codes',
83
-		'file' => '$sourcedir/sd_source/Subs-SimpleDesk.php',
84
-	);
85
-	$hooks[] = array(
86
-		'hook' => 'integrate_packages_sort_id',
87
-		'function' => 'shd_packages_sort_id',
88
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
89
-	);
90
-	$hooks[] = array(
91
-		'hook' => 'integrate_post_parsebbc',
92
-		'function' => 'shd_parse_wikilinks',
93
-		'file' => '$sourcedir/sd_source/Subs-SimpleDesk.php',
94
-	);
95
-// Admin Section Stuff
96
-	// Core
97
-	$hooks[] = array(
98
-		'hook' => 'integrate_admin_include',
99
-		'function' => '$sourcedir/sd_source/Subs-SimpleDeskAdmin.php',
100
-	);
101
-	$hooks[] = array(
102
-		'hook' => 'integrate_admin_areas',
103
-		'function' => 'shd_admin_bootstrap',
104
-	);
105
-	$hooks[] = array(
106
-		'hook' => 'integrate_admin_search',
107
-		'function' => 'shd_admin_search',
108
-	);
109
-	// Attachments
110
-	$hooks[] = array(
111
-		'hook' => 'integrate_remove_attachments',
112
-		'function' => 'shd_remove_attachments',
113
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskAdmin.php',
114
-	);
115
-	$hooks[] = array(
116
-		'hook' => 'integrate_repair_attachments_nomsg',
117
-		'function' => 'shd_repair_attachments_nomsg',
118
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php',
119
-	);
120
-	$hooks[] = array(
121
-		'hook' => 'integrate_attachments_browse',
122
-		'function' => 'shd_attachments_browse',
123
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php',
124
-	);
125
-	$hooks[] = array(
126
-		'hook' => 'integrate_attachment_remove',
127
-		'function' => 'shd_attachment_remove',
128
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskManageAttachments.php',
129
-	);
130
-	// Packages
131
-	$hooks[] = array(
132
-		'hook' => 'integrate_packages_sort_id',
133
-		'function' => 'shd_packages_sort_id',
134
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
135
-	);
136
-	$hooks[] = array(
137
-		'hook' => 'integrate_package_download',
138
-		'function' => 'shd_package_download',
139
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
140
-	);
141
-	$hooks[] = array(
142
-		'hook' => 'integrate_package_upload',
143
-		'function' => 'shd_package_upload',
144
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
145
-	);
146
-	$hooks[] = array(
147
-		'hook' => 'integrate_modification_types',
148
-		'function' => 'shd_modification_types',
149
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskPackages.php',
150
-	);
151
-	// Other
152
-	$hooks[] = array(
153
-		'hook' => 'integrate_convert_msgbody',
154
-		'function' => 'shd_convert_msgbody',
155
-	);
156
-	$hooks[] = array(
157
-		'hook' => 'integrate_modifylanguages',
158
-		'function' => 'shd_modifylanguages',
159
-	);
160
-// Display
161
-	$hooks[] = array(
162
-		'hook' => 'integrate_display_buttons',
163
-		'function' => 'shd_display_btn_mvtopic',
164
-	);
165
-	$hooks[] = array(
166
-		'hook' => 'integrate_download_request',
167
-		'function' => 'shd_download_request',
168
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskDisplay.php',
169
-	);
170
-// BoardIndex
171
-	$hooks[] = array(
172
-		'hook' => 'integrate_getboardtree',
173
-		'function' => 'shd_add_to_boardindex',
174
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskBoardIndex.php',
175
-	);
176
-// Profile
177
-	$hooks[] = array(
178
-		'hook' => 'integrate_pre_profile_areas',
179
-		'function' => 'shd_profile_areas',
180
-		'file' => '$sourcedir/sd_source/Subs-SimpleDeskProfile.php',
181
-	);
182
-	$hooks[] = array(
183
-		'hook' => 'integrate_profile_profileSaveGroups',
184
-		'function' => 'shd_clear_active_tickets',
185
-	);
186
-	$hooks[] = array(
187
-		'hook' => 'integrate_profile_trackip',
188
-		'function' => 'shd_profile_trackip',
189
-	);
190
-// Other
191
-	$hooks[] = array(
192
-		'hook' => 'integrate_SSI',
193
-		'function' => 'ssi_shd_called',
194
-		'file' => '$sourcedir/sd_source/SimpleDesk-SSI.php',
195
-	);
196
-
197
-foreach ($hooks as $hook)
198
-	remove_integration_function($hook['hook'], $hook['function'], !isset($hook['perm']) ? true : $hook['perm'], !isset($hook['file']) ? '' : $hook['file'], !isset($hook['object']) ? false : $hook['object']);
199
-
200
-// 3. Removing the scheduled task.
48
+// 2. Removing the scheduled task.
201 49
 $smcFunc['db_query']('', '
202 50
 	DELETE FROM {db_prefix}scheduled_tasks
203 51
 	WHERE task = {string:simpledesk}',
... ...
@@ -206,7 +54,7 @@ $smcFunc['db_query']('', '
206 54
 	)
207 55
 );
208 56
 
209
-// 4. Forcing all SD plugin hooks to be disabled.
57
+// 3. Forcing all SD plugin hooks to be disabled.
210 58
 $shd_hooks = array(
211 59
 	'shd_enabled_plugins',
212 60
 );
213 61