-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
uninstall.php
30 lines (27 loc) · 1.32 KB
/
uninstall.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
<?php
// Delete Media Manager media types
$sql = rex_sql::factory();
$sql->setQuery('SELECT id FROM '. \rex::getTablePrefix() ."media_manager_type WHERE name = 'd2u_helper_yfeed_small'");
if ($sql->getRows() > 0) {
$id = $sql->getValue('id');
$sql->setQuery('DELETE FROM '. \rex::getTablePrefix() .'media_manager_type_effect WHERE `type_id` = '. $id);
$sql->setQuery('DELETE FROM '. \rex::getTablePrefix() .'media_manager_type WHERE `type_id` = '. $id);
}
$sql->setQuery('SELECT id FROM '. \rex::getTablePrefix() ."media_manager_type WHERE name = 'd2u_helper_yfeed_large'");
if ($sql->getRows() > 0) {
$id = $sql->getValue('id');
$sql->setQuery('DELETE FROM '. \rex::getTablePrefix() .'media_manager_type_effect WHERE `type_id` = '. $id);
$sql->setQuery('DELETE FROM '. \rex::getTablePrefix() .'media_manager_type WHERE `type_id` = '. $id);
}
// Delete Metainfo fields
rex_metainfo_delete_field('art_file');
rex_metainfo_delete_field('art_slogan');
rex_metainfo_delete_field('cat_d2u_helper_icon');
rex_metainfo_delete_field('clang_icon');
// Delete language replacements
if (!class_exists(\TobiasKrais\D2UHelper\LangHelper::class)) {
// Load class in case addon is deactivated
require_once 'lib/ALangHelper.php';
require_once 'lib/LangHelper.php';
}
\TobiasKrais\D2UHelper\LangHelper::factory()->uninstall();