i_componentadmindir = mosPathName($p_dirname); } return $this->i_componentadmindir; } /** * Component uninstall method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall( $cid, $option, $client=0 ) { $database =& mamboDatabase::getInstance(); $sql = "SELECT * FROM #__components WHERE id=$cid"; $database->setQuery($sql); if (!$database->loadObject( $row )) { HTML_installer::showInstallMessage($database->stderr(true),'Uninstall - error', "index2.php?option=$option&element=component"); exit(); } if ($row->iscore) { die('Is core component - may not be deleted'); HTML_installer::showInstallMessage("Component $row->name is a core component, and can not be uninstalled.
You need to unpublish it if you don't want to use it", 'Uninstall - error', "index2.php?option=$option&element=component"); exit(); } // Try to find the XML file $here = mosPathName( mamboCore::get('mosConfig_absolute_path').'/administrator/components/'.$row->option ); $filesindir = mosReadDirectory($here, '.xml$'); if (count($filesindir) > 0) { foreach ($filesindir as $file) { $parser = new mosUninstallXML ($here.$file); $parser->uninstall(); if ($parser->terminalError) { var_dump ($parser->errors); return false; } } } else { // no XML file return false; /* HTML_installer::showInstallMessage( 'Could not find XML Setup file in '.$mosConfig_absolute_path.'/administrator/components/'.$row->option, 'Uninstall - error', $option, 'component' ); exit(); */ } return true; } } ?>