FundacionLQDVI_WebCongresos/www/administrator/components/com_alpharegistration/uninstall.alpharegistration.php

95 lines
2.5 KiB
PHP

<?php
/**
* @version 2.0.12 alpharegistration $
* @package alpharegistration
* @copyright Copyright © 2009-2010 - Bernard Gilly - All rights reserved.
* @license GNU/GPL
* @author Bernard Gilly
* @author mail contact@alphaplug.com
* @website www.alphaplug.com
*/
defined('_JEXEC') or die('Restricted access');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
class Status {
var $STATUS_FAIL = 'Failed';
var $STATUS_SUCCESS = 'Success';
var $infomsg = array();
var $errmsg = array();
var $status;
}
$db =& JFactory::getDBO();
$install_status = array();
// Uninstall plugin system
$query = "SELECT id FROM #__plugins WHERE element='alpharegistration' AND folder='system' LIMIT 1";
$db->setQuery($query);
$argplugin = $db->loadObject();
$plugin_installer = new JInstaller;
$status = new Status();
$status->status = $status->STATUS_FAIL;
if(@$plugin_installer->uninstall('plugin', $argplugin->id))
{
$status->status = $status->STATUS_SUCCESS;
}
$install_status['AlphaRegistration - System'] = $status;
// delete all older plugins
$query = "DELETE FROM #__plugins WHERE element LIKE 'alpharegistration'";
$db->setQuery( $query );
$db->query();
function com_uninstall() {
echo( "AlphaRegistration has been successfully uninstalled." );
}
?>
<h1>AlphaRegistration Uninstallation</h1>
<table class="adminlist">
<thead>
<tr>
<th width="20">&nbsp;</th>
<th class="title"><?php echo JText::_('Plugins'); ?></th>
<th width="60%"><?php echo JText::_('Status'); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
</tfoot>
<tbody>
<?php
$i=0;
foreach ( $install_status as $component => $status ) {
$alerticon = ($status->status == $status->STATUS_SUCCESS)? 'tick.png' : 'publish_x.png';
?>
<tr class="row<?php echo $i; ?>">
<td class="key"><?php echo '<img src="images/'.$alerticon.'" alt="" />'; ?></td>
<td class="key"><?php echo $component; ?></td>
<td>
<?php echo ($status->status == $status->STATUS_SUCCESS)? '<strong>'.JText::_('Uninstalled').'</strong>' : '<em>'.JText::_('NOT Uninstalled').'</em>'?>
<?php if (count($status->errmsg) > 0 ) {
foreach ( $status->errmsg as $errmsg ) {
echo '<br />Error: ' . $errmsg;
}
} ?>
<?php if (count($status->infomsg) > 0 ) {
foreach ( $status->infomsg as $infomsg ) {
echo '<br />Info: ' . $infomsg;
}
} ?>
</td>
</tr>
<?php
if ($i=0){ $i=1;} else {$i = 0;};
}?>
</tbody>
</table>