Exemple #1
0
 /**
  * Checks if the wizard is visible for this request.
  *
  * @return boolean If visible
  */
 protected function isVisible()
 {
     $masterRequest = $this->requestStack->getMasterRequest();
     if ($masterRequest->query->get('modal', false)) {
         return false;
     }
     $route = $masterRequest->attributes->get('_route');
     return !$this->wizardRoutes->isWizardHidden($route);
 }
 /**
  * Handles the event redirecting to the wizard if the user is visiting the
  * dashboard
  *
  * @param GetResponseEvent $event The response event
  */
 public function handle(GetResponseEvent $event)
 {
     if ($this->plugin->isEnabled() && !$this->wizardStatus->isWizardFinished()) {
         $request = $event->getRequest();
         $currentRoute = $this->getCurrentRequestRoute($request);
         if ('admin_homepage' == $currentRoute) {
             $event->setResponse(new RedirectResponse($this->urlGenerator->generate($this->wizardRoutes->getDefaultWizardRoute())));
         }
     }
 }