Fixes issues with menu icons not loading (#148)
Jeremy D

Jeremy D commited on 2021-09-04 10:52:49
Showing 2 changed files, with 18 additions and 4 deletions.

... ...
@@ -50,6 +50,7 @@
50 50
 		<hook hook="integrate_actions" function="shd_init_actions" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
51 51
 		<hook hook="integrate_buffer" function="shd_buffer_replace" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
52 52
 		<hook hook="integrate_menu_buttons" function="shd_main_menu" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
53
+		<hook hook="integrate_current_action" function="shd_init_current_action" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
53 54
 		<hook hook="integrate_load_permissions" function="shd_admin_smf_perms" file="$sourcedir/sd_source/Subs-SimpleDeskAdmin.php" />
54 55
 		<hook hook="integrate_error_types" function="shd_error_types" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
55 56
 		<hook hook="integrate_bbc_codes" function="shd_bbc_codes" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
... ...
@@ -113,6 +114,7 @@
113 114
 		<hook reverse="true" hook="integrate_actions" function="shd_init_actions" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
114 115
 		<hook reverse="true" hook="integrate_buffer" function="shd_buffer_replace" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
115 116
 		<hook reverse="true" hook="integrate_menu_buttons" function="shd_main_menu" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
117
+		<hook reverse="true" hook="integrate_current_action" function="shd_init_current_action" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
116 118
 		<hook reverse="true" hook="integrate_load_permissions" function="shd_admin_smf_perms" file="$sourcedir/sd_source/Subs-SimpleDeskAdmin.php" />
117 119
 		<hook reverse="true" hook="integrate_error_types" function="shd_error_types" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
118 120
 		<hook reverse="true" hook="integrate_bbc_codes" function="shd_bbc_codes" file="$sourcedir/sd_source/Subs-SimpleDesk.php" />
... ...
@@ -1585,10 +1585,25 @@ function scheduled_simpledesk()
1585 1585
 	return true;
1586 1586
 }
1587 1587
 
1588
+/**
1589
+ *	Load the CSS file for the icons.
1590
+ *
1591
+ *	@param array &$current_action The current action.
1592
+ *
1593
+ *	@since 2.1
1594
+*/
1595
+function shd_init_current_action(&$current_action)
1596
+{
1597
+	global $context;
1598
+
1599
+	// Load some extra CSS
1600
+	loadCSSFile('helpdesk_icons.css', array('minimize' => empty($context['shd_developer_mode']), 'seed' => $context['shd_css_version']), 'helpdesk_icons');
1601
+}
1602
+
1588 1603
 /**
1589 1604
  *	Adds the SimpleDesk action to the action list, and also handles most of the shutting down of forum items in helpdesk-only mode.
1590 1605
  *
1591
- *	@param string &$actionArray The master list of actions from index.php
1606
+ *	@param array &$actionArray The master list of actions from index.php
1592 1607
  *
1593 1608
  *	@since 2.0
1594 1609
 */
... ...
@@ -1599,9 +1614,6 @@ function shd_init_actions(&$actionArray)
1599 1614
 	if (empty($modSettings['helpdesk_active']))
1600 1615
 		return;
1601 1616
 
1602
-	// Load some extra CSS
1603
-	loadCSSFile('helpdesk_icons.css', array('minimize' => empty($context['shd_developer_mode']), 'seed' => $context['shd_css_version']), 'helpdesk_icons');
1604
-
1605 1617
 	// Deal with SimpleDesk. If we're enabling HD only mode, rebuild everything, otherwise just add it to the array.
1606 1618
 	$actionArray['helpdesk'] = array('sd_source/SimpleDesk.php', 'shd_main');
1607 1619
 
1608 1620