<?php
/**
* @version 1.0.0
* @category Anahita Social Engineª
* @copyright Copyright (C) 2008 - 2010 rmdStudio Inc. and Peerglobe Technology Inc. All rights reserved.
* @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
* @link http://www.anahitapolis.com
*/
function com_uninstall()
{
$db = JFactory::getDBO();
$query = "SELECT * FROM #__plugins WHERE ( folder = 'system' OR folder = 'user' ) AND element IN ('socialengine')";
$db->setQuery($query);
$objects = $db->loadObjectList();
foreach($objects as &$object) {
$installer = new JInstaller();
$installer->uninstall('plugin', $object->id);
}
/*
$query = "SELECT id FROM #__component WHERE `option` = 'com_default' AND parent = 0";
$db->setQuery($query, 0, 1);
$id = $db->loadResult();
if ( $id )
{
$installer = new JInstaller();
$installer->uninstall('component', $id);
}*/
$query = "DELETE FROM #__templates_menu WHERE `name` = 'anahita'"; //delete default template
$db->setQuery($query);
$db->query();
if ( file_exists(JPATH_ROOT.DS.'templates'.DS.'anahita') )
{
$installer = new JInstaller();
$installer->uninstall('template', 'anahita', 0);
}
print '<h2>Please don\'t forget to:
<ol>
<li>Uninstall the koowa system plugin</li>
<li>Remove the anahita_assets folder from Joomla Root or Amazon cloud storage</li>
</ol>
</h2>';
}