Esempio n. 1
0
 /**
  * Uninstall components
  */
 public function uninstall()
 {
     // Check access
     $user = JFactory::getUser();
     $this->setRedirect(JRoute::_('index.php?option=com_jdeveloper&view=component', false));
     if (!$user->authorise('components.uninstall', 'com_jdeveloper')) {
         $this->setMessage(JText::_('COM_JDEVELOPER_ACTION_NOT_ALLOWED'), 'warning');
         return;
     }
     require_once JDeveloperLIB . DS . 'install.php';
     $app = JFactory::getApplication();
     $ids = $app->input->get('cid', array(), 'array');
     foreach ($ids as $id) {
         $component = $this->getModel()->getItem($id);
         JDeveloperInstall::uninstall("component", "com_" . $component->name);
     }
     $this->setMessage(JText::sprintf('COM_JDEVELOPER_COMPONENT_UNINSTALLED', count($ids)));
 }
Esempio n. 2
0
 /**
  * Uninstall modules
  */
 public function uninstall()
 {
     // Check access
     $user = JFactory::getUser();
     $this->setRedirect(JRoute::_('index.php?option=com_jdeveloper&view=module', false));
     if (!$user->authorise('modules.uninstall', 'com_jdeveloper')) {
         $this->setMessage(JText::_('COM_JDEVELOPER_ACTION_NOT_ALLOWED'), 'warning');
         return;
     }
     // Initialize
     require_once JDeveloperLIB . DS . 'install.php';
     $app = JFactory::getApplication();
     $ids = $app->input->get('cid', array(), 'array');
     // Uninstall modules
     foreach ($ids as $id) {
         $module = $this->getModel()->getItem($id);
         JDeveloperInstall::uninstall("module", "mod_" . $module->name);
     }
     $this->setMessage(JText::sprintf('COM_JDEVELOPER_MODULE_MESSAGE_UNINSTALLED', count($ids)));
 }