-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.php
More file actions
84 lines (69 loc) · 2.69 KB
/
uninstall.php
File metadata and controls
84 lines (69 loc) · 2.69 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
$msgtext ='';
jimport('joomla.installer.helper');
$msgtext ='<div style=" font-size:14px; ">UNINSTALL FieldsAttach in content article for Joomla</div>';
$msgtext .= '<div style="border:1px dashed #cccccc; font-size:14px; margin:8px 0 8px 0; padding:5px;" >';
$msgtext .= 'Component uninstall FieldsAttach success';
$msgtext .= '</div>';
$db =& JFactory::getDBO();
$sql = "UPDATE #__extensions SET enabled = 0 WHERE folder = 'fieldsattachment'";
$db->setQuery($sql);
$db->query();
$db =& JFactory::getDBO();
$sql = "UPDATE #__extensions SET enabled = 0 WHERE element = 'fieldsattachment'";
$db->setQuery($sql);
$db->query();
$db =& JFactory::getDBO();
$sql = "UPDATE #__extensions SET enabled = 0 WHERE element = 'fieldsattachmentadvanced'";
$db->setQuery($sql);
$db->query();
$db =& JFactory::getDBO();
$db->setQuery("select extension_id , name from #__extensions where folder = 'fieldsattachment'");
$plugins = $db->loadObjectList();
if($plugins)
{
foreach($plugins as $plugin)
{
$plugin_uninstaller = new JInstaller;
$msgtext .= '<div style="border:1px dashed #cccccc; font-size:14px; margin:8px 0 8px 0; padding:5px;" >';
if($plugin_uninstaller->uninstall('plugin', $plugin->extension_id))
$msgtext .= 'Plugin '.$plugin->name.' uninstall fieldsattachment success <br />';
else
$msgtext .= 'Plugin '.$plugin->name.' uninstall fieldsattachment failed<br />';
$msgtext .= '</div>';
}
}
//******************
$db->setQuery("select extension_id , name from #__extensions where element = 'fieldsattachment'");
$plugins = $db->loadObjectList();
if($plugins)
{
foreach($plugins as $plugin)
{
$plugin_uninstaller = new JInstaller;
$msgtext .= '<div style="border:1px dashed #cccccc; font-size:14px; margin:8px 0 8px 0; padding:5px;" >';
if($plugin_uninstaller->uninstall('plugin', $plugin->extension_id))
$msgtext .= 'Plugin '.$plugin->name.' uninstall fieldsattachment success <br />';
else
$msgtext .= 'Plugin '.$plugin->name.' uninstall fieldsattachment failed<br />';
$msgtext .= '</div>';
}
}
//******************
$db->setQuery("select extension_id , name from #__extensions where element = 'fieldsattachmentadvanced'");
$plugins = $db->loadObjectList();
if($plugins)
{
foreach($plugins as $plugin)
{
$plugin_uninstaller = new JInstaller;
$msgtext .= '<div style="border:1px dashed #cccccc; font-size:14px; margin:8px 0 8px 0; padding:5px;" >';
if($plugin_uninstaller->uninstall('plugin', $plugin->extension_id))
$msgtext .= 'Plugin '.$plugin->name.' uninstall fieldsattachment success <br />';
else
$msgtext .= 'Plugin '.$plugin->name.' uninstall fieldsattachment failed<br />';
$msgtext .= '</div>';
}
}
?>
<?php echo $msgtext; ?>