View of /mambo/branches/4.6/administrator/components/com_installer/module/module.class.php
Parent Directory
|
Revision Log
Revision 151 -
(download)
(annotate)
Thu Jan 19 14:24:56 2006 UTC (7 years, 4 months ago) by csouza
File size: 1814 byte(s)
Thu Jan 19 14:24:56 2006 UTC (7 years, 4 months ago) by csouza
File size: 1814 byte(s)
csouza - Merging 4.5.4 changes (revisions 139 to 148) into 4.6.
<?php /** * @version $Id: module.class.php,v 1.1 2005/07/22 01:52:34 eddieajau Exp $ * @package Mambo * @subpackage Installer * @copyright (C) 2000 - 2005 Miro International Pty Ltd * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL * Mambo is Free Software * */ /** ensure this file is being included by a parent file */ defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); /** * Module installer * @package Mambo */ class mosInstallerModule extends mosInstaller { /** * Module uninstall method * @param int The id of the module * @param string The URL option * @param int The client id */ function uninstall( $id, $option, $client=0 ) { $database = mamboDatabase::getInstance(); $mosConfig_absolute_path = mamboCore::get('mosConfig_absolute_path'); $query = "SELECT module, iscore, client_id FROM #__modules WHERE id = '$id'"; $database->setQuery( $query ); $database->loadObject( $row ); if ($row->iscore) { HTML_installer::showInstallMessage( $row->title .'is a core module, and can not be uninstalled.<br />You need to unpublish it if you don\'t want to use it', 'Uninstall - error', $this->returnTo( $option, 'module', $row->client_id ? '' : 'admin' ) ); exit(); } $query = "DELETE FROM #__modules_menu WHERE moduleid=$id"; $database->setQuery( $query ); if (!$database->query()) { $msg = $database->stderr; die( $msg ); } if ( $row->client_id ) $basepath = $mosConfig_absolute_path . '/administrator/modules/'; else $basepath = $mosConfig_absolute_path . '/modules/'; $xmlfile = $basepath . $row->module . '.xml'; $parser = new mosUninstallXML ($xmlfile); $parser->uninstall(); if ($parser->terminalError) { var_dump($parser->errors); die('Uninstall failed'); } return true; } } ?>
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

