2.1 RC3 support Cleanup of files 2.1 does not use modifications language, but a dedicated language file
jdarwood007

jdarwood007 commited on 2020-11-01 10:20:18
Showing 15 changed files, with 74 additions and 24 deletions.

... ...
@@ -0,0 +1,32 @@
1
+<?php
2
+// Version: 2.1; Topic solved mod
3
+
4
+$txt['topic_solved_title'] = 'Topic Solved mod';
5
+$txt['solve_topic'] = '<strong style="color: green">Mark topic solved</strong>';
6
+$txt['unsolve_topic'] = '<strong style="color: red">Mark topic not solved</strong>';
7
+$txt['modlog_ac_solve'] = 'Solved &quot;{topic}&quot; by {member}';
8
+$txt['modlog_ac_unsolve'] = 'Unsolved &quot;{topic}&quot; by {member}';
9
+$txt['modlog_solve_log'] = 'Topic solved log';
10
+$txt['modlog_solve_log_desc'] = 'Below is a list of all topics that have been solved or unsolved by your users.<br /><strong>Please note:</strong> Entries cannot be removed from this log until they are at least twenty-four hours old.';
11
+$txt['modlog_solve_log_no_entries_found'] = 'There are currently no entries in the topic solved log.';
12
+$txt['solve_log_help'] = '<strong>Topic solved log</strong><br />This section allows members of the moderation team to track all usage of the topic solved/not solved feature. To ensure that moderators cannot remove references to the actions they have performed, entries may not be deleted until 24 hours after the action was taken.';
13
+
14
+$txt['permissionname_solve_topic'] = 'Mark topics solved/not solved';
15
+$txt['permissionhelp_solve_topic'] = 'This permission will allow the user to mark topics as solved and not solved.';
16
+$txt['permissionname_solve_topic_any'] = 'Any topic';
17
+$txt['permissionname_solve_topic_own'] = 'Own topic';
18
+$txt['permissionname_simple_solve_topic_own'] = 'Mark their own topics solved';
19
+$txt['permissionname_simple_solve_topic_any'] = 'Mark any topics solved';
20
+
21
+$txt['cannot_solve_topic_any'] = 'You do not have permission to mark topics solved.';
22
+$txt['cannot_solve_topic_own'] = 'You do not have permission to mark topics solved.';
23
+$txt['enable_solved_log'] = 'Enable logging of topic solving (Requires moderation logging to be enabled)';
24
+$txt['topicsolved_board_desc'] = '<span class="smalltext">Please select the boards you wish to enable the topic solved feature in.</span>';
25
+$txt['topicsolved_highlight'] = 'Highlight solved topics on the message index';
26
+$txt['topicsolved_highlight_col1'] = 'Color for highlighted solved topics (lighter columns, such as replies/view)';
27
+$txt['topicsolved_highlight_col2'] = 'Color for highlighted solved topics (darker columns, such as subject/started by)';
28
+$txt['topicsolved_display_notice'] = 'Display a notice inside of solved topics';
29
+$txt['topicsolved_is_solved'] = '<strong style="color: green;">Topic solved</strong><br />This topic is marked as solved and as such require no attention unless you want to bump this issue.';
30
+$txt['topicsolved_not_enabled'] = 'Topic solved is not enabled on this board.';
31
+$txt['cannot_solve_own'] = 'You can not mark your own topics as solved';
32
+$txt['cannot_solve_any'] = 'You can not mark just any topic as solved';
0 33
\ No newline at end of file
... ...
@@ -6,36 +6,36 @@
6 6
 	<version>1.1</version>
7 7
 	<type>modification</type>
8 8
 	<install for="2.0-2.0.99">
9
-		<readme type="file" parsebbc="true">readme.txt</readme>	
10
-		<modification>install2.0.xml</modification>
11
-		<modification>english.xml</modification>
12
-		<require-file name="SolveTopic.php" destination="$sourcedir" />
13
-		<require-file name="SolveTopic-Admin.php" destination="$sourcedir" />
14
-		<require-file name="solved.gif" destination="$imagesdir/post" />
15
-		<require-file name="SolveTopic-Display.template.php" destination="$themes_dir/default" />
16
-		<database>install-2.0.php</database>
9
+		<readme type="file" parsebbc="true">readme/readme-install.english.txt</readme>	
10
+		<modification>install/install2.0.xml</modification>
11
+		<modification>language/english.xml</modification>
12
+		<require-file name="sources/SolveTopic.php" destination="$sourcedir" />
13
+		<require-file name="sources/SolveTopic-Admin.php" destination="$sourcedir" />
14
+		<require-file name="images/solved.gif" destination="$imagesdir/post" />
15
+		<require-file name="templates/SolveTopic-Display.template.php" destination="$themes_dir/default" />
16
+		<database>install/install-2.0.php</database>
17 17
 		<redirect url="?action=admin;area=modsettings;sa=topicsolved" />
18 18
 	</install>
19 19
 	<uninstall for="2.0-2.0.99">
20
-		<database>uninstall-optional.php</database>
21
-		<code>uninstall-required-2.0.php</code>
22
-		<readme type="inline">This will uninstall the Topic Solved Mod. Thanks for using this customization.</readme>			
23
-		<modification reverse="true">install2.0.xml</modification>	
24
-		<modification reverse="true">english.xml</modification>
20
+		<database>install/uninstall-optional.php</database>
21
+		<code>install/uninstall-required-2.0.php</code>
22
+		<readme type="file" parsebbc="true">readme/readme-uninstall.english.txt</readme>	
23
+		<modification reverse="true">install/install2.0.xml</modification>	
24
+		<modification reverse="true">language/english.xml</modification>
25 25
 		<remove-file name="$sourcedir/SolveTopic.php" />
26 26
 		<remove-file name="$sourcedir/SolveTopic-Admin.php" />
27 27
 		<remove-file name="$imagesdir/post/solved.gif" />
28 28
 		<remove-file name="$themes_dir/default/SolveTopic-Display.template.php" />
29 29
 	</uninstall>	
30 30
 
31
-	<install for="2.1 RC2, 2.1 RC3, 2.1-2.1.99">
32
-		<readme type="file" parsebbc="true">readme.txt</readme>	
33
-		<modification>english.xml</modification>
34
-		<require-file name="SolveTopic.php" destination="$sourcedir" />
35
-		<require-file name="SolveTopic-Admin.php" destination="$sourcedir" />
36
-		<require-file name="solved.png" destination="$imagesdir/post" />
37
-		<require-file name="SolveTopic-Display.template.php" destination="$themes_dir/default" />
38
-		<database>install-2.1.php</database>
31
+	<install for="2.1 RC3, 2.1 RC4, 2.1-2.1.99">
32
+		<readme type="file" parsebbc="true">readme/readme-install.english.txt</readme>	
33
+		<require-file name="sources/SolveTopic.php" destination="$sourcedir" />
34
+		<require-file name="sources/SolveTopic-Admin.php" destination="$sourcedir" />
35
+		<require-file name="images/solved.png" destination="$imagesdir/post" />
36
+		<require-file name="templates/SolveTopic-Display.template.php" destination="$themes_dir/default" />
37
+		<require-file name="language/SolveTopic.english.php" destination="$themes_dir/default/languages" />
38
+		<database>install/install-2.1.php</database>
39 39
 		<redirect url="?action=admin;area=modsettings;sa=topicsolved" />
40 40
 
41 41
 		<!-- Core Startup -->
... ...
@@ -59,14 +59,15 @@
59 59
 		<hook function="integrate_moderate_areas_solveTopic" hook="integrate_moderate_areas" file="$sourcedir/SolveTopic-Admin.php" />
60 60
 		<hook function="integrate_viewModLog_solveTopic" hook="integrate_viewModLog" file="$sourcedir/SolveTopic-Admin.php" />
61 61
 	</install>
62
-	<uninstall for="2.1 RC2, 2.1 RC3, 2.1-2.1.99">
63
-		<database>uninstall-optional.php</database>
64
-		<readme type="inline">This will uninstall the Topic Solved Mod. Thanks for using this customization.</readme>			
62
+	<uninstall for="2.1 RC3, 2.1 RC4, 2.1-2.1.99">
63
+		<database>install/uninstall-optional.php</database>
64
+		<readme type="file" parsebbc="true">readme/readme-uninstall.english.txt</readme>	
65 65
 		<modification reverse="true">english.xml</modification>
66 66
 		<remove-file name="$sourcedir/SolveTopic.php" />
67 67
 		<remove-file name="$sourcedir/SolveTopic-Admin.php" />
68 68
 		<remove-file name="$imagesdir/post/solved.png" />
69 69
 		<remove-file name="$themes_dir/default/SolveTopic-Display.template.php" />
70
+		<remove-file name="$themes_dir/default/language/SolveTopic.english.php" />
70 71
 
71 72
 		<!-- Core Startup -->
72 73
 		<hook function="integrate_pre_load_solveTopic" hook="integrate_pre_load" file="$sourcedir/SolveTopic.php" reverse="true" />
... ...
@@ -0,0 +1 @@
1
+This will uninstall the Topic Solved Mod. Thanks for using this customization.
0 2
\ No newline at end of file
... ...
@@ -19,7 +19,11 @@ 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
+	{
23
+		loadLanguage('SolveTopic');
24
+
22 25
 		$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');
26
+	}
23 27
 	else
24 28
 		$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 29
 	$admin_areas['config']['areas']['modsettings']['subsections']['topicsolved'] = array($txt['topic_solved_title']);
... ...
@@ -29,6 +33,8 @@ function ModifyTopicSolvedSettings($return_config = false)
29 33
 {
30 34
 	global $txt, $scripturl, $context, $settings, $sc, $modSettings, $smcFunc;
31 35
 
36
+	loadLanguage('SolveTopic');
37
+
32 38
 	$query = $smcFunc['db_query']('', '
33 39
 		SELECT id_board, id_cat, child_level, name FROM {db_prefix}boards ORDER BY board_order ASC
34 40
 	');
... ...
@@ -90,6 +96,8 @@ function integrate_viewModLog_solveTopic(&$listOptions, &$moderation_menu_name)
90 96
 {
91 97
 	global $context, $modSettings, $scripturl, $txt, $settings, $smcFunc;
92 98
 
99
+	loadLanguage('SolveTopic');
100
+
93 101
 	// Topic solved log
94 102
 	$context['log_type'] = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'solvelog' ? 4 : $context['log_type'];
95 103
 	
... ...
@@ -178,6 +186,8 @@ function integrate_moderate_areas_solveTopic(&$menuData)
178 186
 {
179 187
 	global $modSettings, $txt, $scripturl;
180 188
 
189
+	loadLanguage('SolveTopic');
190
+
181 191
 	$menuData['logs']['areas']['solvelog'] = array(
182 192
 		'enabled' => !empty($modSettings['enable_solved_log']),
183 193
 		'label' => $txt['modlog_solve_log'],
... ...
@@ -30,6 +30,8 @@ function SolveTopic()
30 30
 {
31 31
 	global $topic, $user_info, $sourcedir, $board, $smcFunc, $modSettings;
32 32
 
33
+	loadLanguage('SolveTopic');
34
+
33 35
 	// See if its enabled in this board.
34 36
 	$solve_boards = array();
35 37
 	$boardsettings = array_keys($modSettings);
... ...
@@ -119,6 +121,8 @@ function integrate_display_buttons_solveTopic(&$buttons)
119 121
 {
120 122
 	global $modSettings, $context, $board, $scripturl;
121 123
 
124
+	loadLanguage('SolveTopic');
125
+
122 126
 	// Can you solve this?
123 127
 	$context['can_solve'] = allowedTo('solve_topic_any') || ($context['user']['started'] && allowedTo('solve_topic_own'));
124 128
 		
... ...
@@ -194,6 +198,8 @@ function integrate_messageindex_buttons_solveTopic(&$buttons)
194 198
 {
195 199
 	global $context, $modSettings, $board;
196 200
 
201
+	loadLanguage('SolveTopic');
202
+
197 203
 	// Is this board solvable?
198 204
 	$context['board_solve'] = !empty($modSettings['topicsolved_board_' . $board]);
199 205