On branch master
[event_calendar.git] / uninstall.eventcalendar.php
blob8581ea952f164008e352f0addf76c136d4656f37
1 <?php
3 /*
4 * Event Calendar for Elxis CMS 2008.x and 2009.x
6 * Installer Handler
8 * @version 1.1
9 * @package eventCalendar
10 * @author Apostolos Koutsoulelos <akoutsoulelos@yahoo.gr>
11 * @copyright Copyright (C) 2009-2010 Apostolos Koutsoulelos. All rights reserved.
12 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
13 * @link
16 // Prevent direct inclusion of this file
17 defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
19 // Function automatically triggered by Elxis to fire the uninstall process
20 function com_uninstall() {
21 global $database, $fmanager, $mainframe;
23 // Drop components table
24 $tbl = $database->_table_prefix.'eventcalendar';
25 if (in_array($database->_resource->databaseType, array('oci8', 'oci805', 'oci8po', 'oracle'))) { $tbl = strtoupper($tpl); }
26 $dict = NewDataDictionary($database->_resource);
27 $sql = $dict->DropTableSQL($tbl);
28 $database->_resource->Execute($sql[0]);
30 // Clear components categories
31 $database->setQuery("DELETE FROM #__categories WHERE section = 'com_eventcalendar'");
32 $database->query();
34 //Remove the SEO PRO extension from the includes/seopro/ directory
35 $seofile = $mainframe->getCfg('absolute_path').'/includes/seopro/com_eventcalendar.php';
36 if (file_exists($seofile)) { $fmanager->deleteFile($seofile); }
38 //Remove the IOS Sitemap extension from the IOS Sitemap extensions directory
39 $sitemapfile = $mainframe->getCfg('absolute_path').'/administrator/components/com_sitemap/extensions/eventcalendar.sitemap.php';
40 if (file_exists($sitemapfile)) { $fmanager->deleteFile($sitemapfile); }