-
Notifications
You must be signed in to change notification settings - Fork 8
/
uninstall.inc.php
38 lines (31 loc) · 1.38 KB
/
uninstall.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
$myself = 'multinewsletter';
$myself_path = $REX['INCLUDE_PATH'] . '/addons/multinewsletter';
// append lang file
$I18N->appendFile($myself_path . '/lang/');
// Modul Aktion ID holen
$result_action = new rex_sql();
$query_action = "SELECT id FROM ". $REX['TABLE_PREFIX'] ."action WHERE createuser = 'Multinewsletter Addon Installer'";
$result_action -> setQuery($query_action);
$num_rows_action = $result_action -> getRows();
$aktionen_ids = [];
for($i = 0; $i < $num_rows_action; $i++) {
$aktionen_ids[] = $result_action -> getValue("id");
$result_action -> next();
}
// Verknüpfung Aktion und Modul löschen
foreach($aktionen_ids as $aktionen_id) {
$result_anmeldung_action = new rex_sql();
$query_anmeldung_action = "DELETE FROM ". $REX['TABLE_PREFIX'] ."module_action WHERE action_id = ". $aktionen_id;
$result_anmeldung_action -> setQuery($query_anmeldung_action);
}
// Aktion löschen
$result_action = new rex_sql();
$query_action = "DELETE FROM ". $REX['TABLE_PREFIX'] ."action WHERE createuser = 'Multinewsletter Addon Installer'";
$result_action -> setQuery($query_action);
// Module löschen
$result_modul = new rex_sql();
$query_modul = "DELETE FROM ". $REX['TABLE_PREFIX'] ."module WHERE createuser = 'Multinewsletter Addon Installer'";
$result_modul -> setQuery($query_modul);
$messages[] = $I18N->msg('multinewsletter_uninstall_modules_deleted');
$REX['ADDON']['install'][$myself] = 0;