Committer: Apostolos Koutsoulelos <apostolos@desktop.(none)>
[arthrology.git] / uninstall.arthrology.php
blob9f82c908f5ca673488056a56570682698257198d
1 <?php
3 /*
4 * Arthrology for Elxis CMS 2008.x and 2009.x
6 * Uninstall Handler
8 * @version 1.3
9 * @package Arthrology
10 * @author Apostolos Koutsoulelos <akoutsoulelos@yahoo.gr>
11 * @authorurl http://www.bitcraft-labs.gr
12 * @copyright Copyright (C) 2009-2011 Apostolos Koutsoulelos. All rights reserved.
13 * @license GNU/GPL (http://www.gnu.org/copyleft/gpl.html)
15 * @link http://www.elxis-downloads.com/downloads/miscellaneous/204.html
18 // Prevent direct inclusion of this file
19 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
21 // Function automatically triggered by Elxis to fire the uninstall process
22 function com_uninstall() {
23 global $database, $fmanager, $mainframe;
25 // Drop components table
26 $tbl = $database->_table_prefix.'arthrology';
27 if (in_array($database->_resource->databaseType, array('oci8', 'oci805', 'oci8po', 'oracle'))) { $tbl = strtoupper($tpl); }
28 $dict = NewDataDictionary($database->_resource);
29 $sql = $dict->DropTableSQL($tbl);
30 $database->_resource->Execute($sql[0]);
32 // Clear components categories
33 $database->setQuery("DELETE FROM #__categories WHERE section='com_arthrology'");
34 $database->query();
36 // Remove the SEO PRO extension from the includes/seopro/ directory
37 $seofile = $mainframe->getCfg('absolute_path').'/includes/seopro/com_arthrology.php';
38 if (file_exists($seofile)) { $fmanager->deleteFile($seofile); }
40 //Remove the IOS Sitemap extension from the IOS Sitemap extensions directory
41 $sitemapfile = $mainframe->getCfg('absolute_path').'/administrator/components/com_sitemap/extensions/arthrology.sitemap.php';
42 if (file_exists($sitemapfile)) { $fmanager->deleteFile($sitemapfile); }
44 // Remove toolbar icons
45 $toolbar = $mainframe->getCfg('absolute_path').'/administrator/images/arthrology_articles.png';
46 if (file_exists($toolbar)) { $fmanager->deleteFile($toolbar); }
47 $toolbar = $mainframe->getCfg('absolute_path').'/administrator/images/arthrology_articles_f2.png';
48 if (file_exists($toolbar)) { $fmanager->deleteFile($toolbar); }
49 $toolbar = $mainframe->getCfg('absolute_path').'/administrator/images/arthrology_magazines.png';
50 if (file_exists($toolbar)) { $fmanager->deleteFile($toolbar); }
51 $toolbar = $mainframe->getCfg('absolute_path').'/administrator/images/arthrology_magazines_f2.png';
52 if (file_exists($toolbar)) { $fmanager->deleteFile($toolbar); }
53 $toolbar = $mainframe->getCfg('absolute_path').'/administrator/images/arthrology_config.png';
54 if (file_exists($toolbar)) { $fmanager->deleteFile($toolbar); }
55 $toolbar = $mainframe->getCfg('absolute_path').'/administrator/images/arthrology_config_f2.png';
56 if (file_exists($toolbar)) { $fmanager->deleteFile($toolbar); }
58 // Remove admin language
59 $adlang = $mainframe->getCfg('absolute_path').'/administrator/language/english/english.com_arthrology.php';
60 if (file_exists($adlang)) { $fmanager->deleteFile($adlang); }
61 $adlang = $mainframe->getCfg('absolute_path').'/administrator/language/greek/greek.com_arthrology.php';
62 if (file_exists($adlang)) { $fmanager->deleteFile($adlang); }
63 $adlang = $mainframe->getCfg('absolute_path').'/administrator/language/italian/italian.com_arthrology.php';
64 if (file_exists($adlang)) { $fmanager->deleteFile($adlang); }