english/administrator/components/com_aicontactsafe/uninstall.aicontactsafe.php
// function called when the component is uninstalled
function called when the component is uninstalled
function called when the component is uninstalled
function com_uninstall() {
	$version = new JVersion;
	$joomla = $version->getShortVersion();
	if(substr($joomla,0,3) >= '1.6'){
		$db = &JFactory::getDBO();
		$query = 'DELETE FROM `#__menu` WHERE `link` like \'index.php?option=com_aicontactsafe\' AND client_id = 1';
		$db->setQuery( $query );
		$db->query();
	}
	jimport('joomla.filesystem.file');
	$aicontactsafe_contactinformations = JPath::clean(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_joomfish'.DS.'contentelements'.DS.'aicontactsafe_contactinformations.xml');
	if (is_file($aicontactsafe_contactinformations)) {
		JFile::delete($aicontactsafe_contactinformations);
	}
	$aicontactsafe_fields = JPath::clean(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_joomfish'.DS.'contentelements'.DS.'aicontactsafe_fields.xml');
	if (is_file($aicontactsafe_fields)) {
		JFile::delete($aicontactsafe_fields);
	}
	$aicontactsafe_profiles = JPath::clean(JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_joomfish'.DS.'contentelements'.DS.'aicontactsafe_profiles.xml');
	if (is_file($aicontactsafe_profiles)) {
		JFile::delete($aicontactsafe_profiles);
	}
	$com_aicontactsafe = JPath::clean(JPATH_ROOT.DS.'components'.DS.'com_sef'.DS.'sef_ext'.DS.'com_aicontactsafe.php');
	if (is_file($com_aicontactsafe)) {
		JFile::delete($com_aicontactsafe);
	}
	$com_aicontactsafe = JPath::clean(JPATH_ROOT.DS.'components'.DS.'com_sef'.DS.'sef_ext'.DS.'com_aicontactsafe.xml');
	if (is_file($com_aicontactsafe)) {
		JFile::delete($com_aicontactsafe);
	}
?>
	<div class="header">
		aiContactSafe is now removed from your web page.
	</div><br/>
	<br/>
	If you didn't use the command from Control Panel to remove the tables, you will be able to install it again and use the old records.<br/>
	<br/>
	If you want to completely remove aiContactSafe, install it again, use the command from Control Panel to remove aiContactSafe tables and then uninstall it again.<br/>
	<br/>
	<br/>
<?php
}
function com_uninstall ( ) { $ version = new JVersion ; $ joomla = $ version -> getShortVersion ( ) ; if ( substr ( $ joomla , 0 , 3 ) >= '1.6' ) { $ db = & JFactory :: getDBO ( ) ; $ query = 'DELETE FROM `#__menu` WHERE `link` like \'index.php?option=com_aicontactsafe\' AND client_id = 1' ; $ db -> setQuery ( $ query ) ; $ db -> query ( ) ; } jimport ( 'joomla.filesystem.file' ) ; $ aicontactsafe_contactinformations = JPath :: clean ( JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_joomfish' . DS . 'contentelements' . DS . 'aicontactsafe_contactinformations.xml' ) ; if ( is_file ( $ aicontactsafe_contactinformations ) ) { JFile :: delete ( $ aicontactsafe_contactinformations ) ; } $ aicontactsafe_fields = JPath :: clean ( JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_joomfish' . DS . 'contentelements' . DS . 'aicontactsafe_fields.xml' ) ; if ( is_file ( $ aicontactsafe_fields ) ) { JFile :: delete ( $ aicontactsafe_fields ) ; } $ aicontactsafe_profiles = JPath :: clean ( JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_joomfish' . DS . 'contentelements' . DS . 'aicontactsafe_profiles.xml' ) ; if ( is_file ( $ aicontactsafe_profiles ) ) { JFile :: delete ( $ aicontactsafe_profiles ) ; } $ com_aicontactsafe = JPath :: clean ( JPATH_ROOT . DS . 'components' . DS . 'com_sef' . DS . 'sef_ext' . DS . 'com_aicontactsafe.php' ) ; if ( is_file ( $ com_aicontactsafe ) ) { JFile :: delete ( $ com_aicontactsafe ) ; } $ com_aicontactsafe = JPath :: clean ( JPATH_ROOT . DS . 'components' . DS . 'com_sef' . DS . 'sef_ext' . DS . 'com_aicontactsafe.xml' ) ; if ( is_file ( $ com_aicontactsafe ) ) { JFile :: delete ( $ com_aicontactsafe ) ; } ?> <div class="header">
		aiContactSafe is now removed from your web page.
	</div><br/>
	<br/>
	If you didn't use the command from Control Panel to remove the tables, you will be able to install it again and use the old records.<br/>
	<br/>
	If you want to completely remove aiContactSafe, install it again, use the command from Control Panel to remove aiContactSafe tables and then uninstall it again.<br/>
	<br/>
	<br/>
 <?php }
function called when the component is uninstalled
function called when the component is uninstalled
// get the joomla version // initialize the database // import joomla clases to manage file system // delete joomfish contentelements // delete artio plugin