/**
  * @param array $params
  * @param EasyMinerTranslator $translator
  */
 public function __construct($params, EasyMinerTranslator $translator = null)
 {
     $this->transformationsDirectory = __DIR__ . '/../../../' . $params['directory'];
     $this->templates['guhaPMML'] = $params['guhaPMML'];
     $this->templates['DRL'] = $params['DRL'];
     if ($translator instanceof EasyMinerTranslator) {
         $this->language = $translator->getLang();
     }
 }
 /**
  * Metoda volaná při spuštění presenteru, v rámci které je řešeno oprávnění přístupu ke zvolenému zdroji
  */
 protected function startup()
 {
     $user = $this->getUser();
     $action = $this->request->parameters['action'] ? $this->request->parameters['action'] : '';
     if (!$user->isAllowed($this->request->presenterName, $action)) {
         if ($user->isLoggedIn()) {
             throw new ForbiddenRequestException($this->translator->translate('You are not authorized to access the required resource!'));
         } else {
             $this->flashMessage('For access to the required resource, you have to log in!', 'warn');
             $this->redirect('User:login', ['backlink' => $this->storeRequest()]);
         }
     }
     parent::startup();
 }