示例#1
0
 /**
  * Deletes plugin.
  *
  * @param array $params
  */
 public function uninstall(array $params)
 {
     if (empty($params['key'])) {
         OW::getFeedback()->error(OW::getLanguage()->text('admin', 'manage_plugins_uninstall_error_message'));
         $this->redirectToAction('index');
     }
     $pluginDto = $this->getPluginDtoByKey($params);
     if ($pluginDto === null) {
         OW::getFeedback()->error(OW::getLanguage()->text('admin', 'manage_plugins_uninstall_error_message'));
         $this->redirectToAction('index');
     }
     try {
         $this->pluginService->uninstall($pluginDto->getKey());
     } catch (Exception $e) {
         if (OW_DEBUG_MODE) {
             throw $e;
         }
         OW::getFeedback()->error(OW::getLanguage()->text('admin', 'manage_plugins_uninstall_error_message'));
         $this->redirectToAction('index');
     }
     OW::getFeedback()->info(OW::getLanguage()->text('admin', 'manage_plugins_uninstall_success_message', array('plugin' => $pluginDto->getTitle())));
     $this->redirectToAction('index');
 }