english/administrator/components/com_installer/models/manage.php
/**
	 * Remove (uninstall) an extension
	 *
	 * @param	array	An array of identifiers
	 * @return	boolean	True on success
	 * @since	1.5
	 */
Remove (uninstall) an extension
@param       array   An array of identifiers
@return      boolean True on success
@since       1.5
Remove ( uninstall ) an extension @param array An array of identifiers @return boolean True on success @since 1 . 5
function remove($eid = array())
	{
		$user = JFactory::getUser();
		if ($user->authorise('core.delete', 'com_installer')) {
			$failed = array();
			if (!is_array($eid)) {
				$eid = array($eid => 0);
			}
			$db = JFactory::getDBO();
			jimport('joomla.installer.installer');
			$installer = JInstaller::getInstance();
			$row = JTable::getInstance('extension');
			foreach($eid as $id) {
				$id = trim($id);
				$row->load($id);
				if ($row->type) {
					$result = $installer->uninstall($row->type, $id);
					if ($result === false) {
						$failed[] = $id;
					}
				}
				else {
					$failed[] = $id;
				}
			}
			$langstring = 'COM_INSTALLER_TYPE_TYPE_'. strtoupper($row->type);
			$rowtype = JText::_($langstring);
			if(strpos($rowtype, $langstring) !== false) {
				$rowtype = $row->type;
			}
			if (count($failed)) {
				$msg = JText::sprintf('COM_INSTALLER_UNINSTALL_ERROR', $rowtype);
				$result = false;
			} else {
				$msg = JText::sprintf('COM_INSTALLER_UNINSTALL_SUCCESS', $rowtype);
				$result = true;
			}
			$app = JFactory::getApplication();
			$app->enqueueMessage($msg);
			$this->setState('action', 'remove');
			$this->setState('name', $installer->get('name'));
			$app->setUserState('com_installer.message', $installer->message);
			$app->setUserState('com_installer.extension_message', $installer->get('extension_message'));
			return $result;
		} else {
			$result = false;
			JError::raiseWarning(403, JText::_('JERROR_CORE_DELETE_NOT_PERMITTED'));
		}
	}
function remove ( $ eid = array ( ) ) { $ user = JFactory :: getUser ( ) ; if ( $ user -> authorise ( 'core.delete' , 'com_installer' ) ) { $ failed = array ( ) ; if ( ! is_array ( $ eid ) ) { $ eid = array ( $ eid => 0 ) ; } $ db = JFactory :: getDBO ( ) ; jimport ( 'joomla.installer.installer' ) ; $ installer = JInstaller :: getInstance ( ) ; $ row = JTable :: getInstance ( 'extension' ) ; foreach ( $ eid as $ id ) { $ id = trim ( $ id ) ; $ row -> load ( $ id ) ; if ( $ row -> type ) { $ result = $ installer -> uninstall ( $ row -> type , $ id ) ; if ( $ result === false ) { $ failed [ ] = $ id ; } } else { $ failed [ ] = $ id ; } } $ langstring = 'COM_INSTALLER_TYPE_TYPE_' . strtoupper ( $ row -> type ) ; $ rowtype = JText :: _ ( $ langstring ) ; if ( strpos ( $ rowtype , $ langstring ) !== false ) { $ rowtype = $ row -> type ; } if ( count ( $ failed ) ) { $ msg = JText :: sprintf ( 'COM_INSTALLER_UNINSTALL_ERROR' , $ rowtype ) ; $ result = false ; } else { $ msg = JText :: sprintf ( 'COM_INSTALLER_UNINSTALL_SUCCESS' , $ rowtype ) ; $ result = true ; } $ app = JFactory :: getApplication ( ) ; $ app -> enqueueMessage ( $ msg ) ; $ this -> setState ( 'action' , 'remove' ) ; $ this -> setState ( 'name' , $ installer -> get ( 'name' ) ) ; $ app -> setUserState ( 'com_installer.message' , $ installer -> message ) ; $ app -> setUserState ( 'com_installer.extension_message' , $ installer -> get ( 'extension_message' ) ) ; return $ result ; } else { $ result = false ; JError :: raiseWarning ( 403 , JText :: _ ( 'JERROR_CORE_DELETE_NOT_PERMITTED' ) ) ; } }
Remove (uninstall) an extension
 @param       array   An array of identifiers
 @return      boolean True on success
 @since       1.5
Remove ( uninstall ) an extension @param array An array of identifiers @return boolean True on success @since 1 . 5
// Initialise variables. // Initialise variables. /*
			* Ensure eid is an array of extension ids in the form id => client_id
			* TODO: If it isn't an array do we want to set an error and fail?
			*/ // Get a database connector // Get an installer object for the extension type // Uninstall the chosen extensions // Build an array of extensions that failed to uninstall // There was an error in uninstalling the package // Package uninstalled sucessfully