case "plg":
            $info = explode("_", $package);
            if (count($info) >= 3) {
                $info[2] = str_replace($info[0] . "_" . $info[1] . "_", "", $package);
                $db->setQuery("SELECT extension_id, `name` FROM #__extensions WHERE `type` = 'plugin' AND `element` = '" . $info[2] . "' AND `folder` = '" . $info[1] . "' ");
                $el = $db->loadObject();
                if ($el) {
                    $eids[] = $el->extension_id;
                    $messages[] = JText::_('Uninstalling plugin "' . $el->name . '" was successful.');
                }
            }
            break;
    }
}
if (count($arrPackages) > 0 && count($eids) > 0) {
    $model = new InstallerModelManage();
    $result = $model->remove($eids);
    if (!$result) {
        $messages = array('Uninstalling modules and plugins were not successful!');
    }
}
?>
 <div style="text-align:left;">
  	<table width="100%" border="0" style="line-height:200%; font-weight:bold;">
	    <tr>
	      <td align="center">
	      		Uninstalling JA K2 Filter
				<?php 
if (count($messages) > 1) {
    echo ' and all related modules, plugins were';
} else {
Example #2
0
 public function remove()
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $cid = $app->input->get('cid', array(), 'array');
     require_once JPATH_ADMINISTRATOR . '/components/com_installer/models/manage.php';
     $lang = JFactory::getLanguage();
     $lang->load('com_installer');
     $model = new InstallerModelManage();
     JArrayHelper::toInteger($cid, array());
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('plg.id, plg.title');
     $query->from('#__judownload_plugins AS plg');
     $query->join('', '#__judownload_templates AS tpl ON tpl.plugin_id = plg.id');
     $query->join('', '#__judownload_template_styles AS style ON style.template_id = tpl.id');
     $query->where('style.home = 1');
     $query->where('plg.id IN(' . implode(',', $cid) . ')');
     $db->setQuery($query);
     $templateHomeId = $db->loadObject();
     if ($templateHomeId) {
         JError::raiseWarning(500, JText::sprintf('COM_JUDOWNLOAD_CAN_NOT_DELETE_PLUGIN_X_BECAUSE_IT_IS_EXTENDED_BY_DEFAULT_TEMPLATE_STYLE', $templateHomeId->title));
         $cid = array_diff($cid, array($templateHomeId->id));
     }
     if ($cid) {
         $query = $db->getQuery(true);
         $query->select('extension_id')->from('#__judownload_plugins')->where('id IN(' . implode(',', $cid) . ')');
         $db->setQuery($query);
         $eid = $db->loadColumn();
         $model->remove($eid);
     }
     $this->setRedirect(JRoute::_('index.php?option=com_judownload&view=plugins', false));
 }