SMF 2.1 compatibility
Jeremy D

Jeremy D commited on 2022-02-06 13:07:34
Showing 6 changed files, with 50 additions and 19 deletions.

... ...
@@ -0,0 +1,4 @@
1
+<?php
2
+// Version: 2.1; Alternate Email customization
3
+
4
+$txt['mail_from'] = 'Notifications Email Address';
0 5
\ No newline at end of file
... ...
@@ -0,0 +1,22 @@
1
+<?php
2
+
3
+function alternateemail_general_settings(array &$config_vars): void
4
+{
5
+	global $txt;
6
+
7
+	loadLanguage('AlternateEmail');
8
+
9
+	// Find the last password setting.
10
+	foreach ($config_vars as $id => $val)
11
+		if (is_array($val) && $val[0] == 'webmaster_email')
12
+			break;
13
+
14
+	$varsA = array_slice($config_vars, 0, $id + 1);
15
+	$varsB = array_slice($config_vars, $id + 1);
16
+
17
+	$new_vars = array(
18
+		array('mail_from', $txt['mail_from'], 'db', 'text', null),
19
+	);
20
+
21
+	$config_vars = array_merge($varsA, $new_vars, $varsB);
22
+}
0 23
\ No newline at end of file
... ...
@@ -1,19 +0,0 @@
1
-<?xml version="1.0"?>
2
-<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
3
-<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
4
-	<id>SimpleDeskTeam:AlternateEmail</id>
5
-	<name>Alternate Email</name>
6
-	<version>1.1</version>
7
-	<type>modification</type>
8
-
9
-	<install for="2.0 RC3, 2.0 RC4, 2.0 RC5, 2.0, 2.0.1">
10
-		<modification format="xml" type="file">install20.xml</modification>
11
-		<modification format="xml" type="file">english.xml</modification>
12
-	</install>
13
-	
14
-	<uninstall for="2.0 RC3, 2.0 RC4, 2.0 RC5, 2.0, 2.0.1">
15
-		<modification format="xml" type="file" reverse="true">install20.xml</modification>
16
-		<modification format="xml" type="file" reverse="true">english.xml</modification>
17
-	</uninstall>
18
-
19
-</package-info>
20 0
\ No newline at end of file
... ...
@@ -0,0 +1,24 @@
1
+<?xml version="1.0"?>
2
+<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
3
+<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
4
+	<id>SimpleDeskTeam:AlternateEmail</id>
5
+	<name>Alternate Email</name>
6
+	<version>2.0</version>
7
+	<type>modification</type>
8
+
9
+	<install for="2.1.*">
10
+		<require-file name="AlternateEmail.php" destination="$sourcedir" />
11
+		<require-file name="AlternateEmail.english.php" destination="$themes_dir/default/languages" />
12
+
13
+		<hook function="alternateemail_general_settings" hook="integrate_general_settings" file="$sourcedir/AlternateEmail.php" />
14
+
15
+		<redirect url="?action=admin;area=serversettings;sa=general" />
16
+	</install>
17
+	
18
+	<uninstall for="2.1.*">
19
+		<remove-file name="AlternateEmail.php" destination="$sourcedir" />
20
+		<remove-file name="AlternateEmail.english.php" destination="$themes_dir/default/languages" />
21
+
22
+		<hook function="alternateemail_general_settings" hook="integrate_general_settings" file="$sourcedir/AlternateEmail.php" reverse="true" />
23
+	</uninstall>
24
+</package-info>
0 25
\ No newline at end of file
1 26