public function renderQueue()
 {
     if (!$this->queueExists) {
         return "An error occured when saving to the backend";
     }
     $error = '';
     if (array_key_exists("error", $this->queue)) {
         $error = Utils::translateException($this->queue["error"]);
     }
     return $this->twig->render('RedKiteCms/Resources/views/Queue/queue.html.twig', array("queue" => $this->queue, "queue_file" => $this->queueFile, "error" => $error));
 }
 private function slugifyPermalink(array $values)
 {
     $sluggedPermalink = Utils::slugify($values["permalink"]);
     if ($sluggedPermalink == $values["permalink"]) {
         return $values;
     }
     $event = Dispatcher::dispatch(PageEvents::SLUGGING_PERMALINK, new SluggingPermalinkEvent($values["permalink"], $sluggedPermalink));
     $sluggedText = $event->getChangedText();
     // @codeCoverageIgnoreStart
     if ($sluggedText != $sluggedPermalink) {
         $sluggedPermalink = $sluggedText;
     }
     // @codeCoverageIgnoreEnd
     $values["permalink"] = $sluggedPermalink;
     return $values;
 }
 /**
  * Handles the exceptions
  *
  * @param GetResponseForExceptionEvent $event
  */
 public function onKernelException(GetResponseForExceptionEvent $event)
 {
     $exception = $event->getException();
     if ($exception instanceof AuthenticationCredentialsNotFoundException) {
         return new RedirectResponse("/login");
     }
     $message = $exception->getMessage();
     if ($exception instanceof NotFoundHttpException || $exception instanceof PageNotPublishedException) {
         $this->render404page($event, $message);
         return;
     }
     if (!$exception instanceof RedKiteCmsExceptionInterface) {
         DataLogger::log($message, DataLogger::CRITICAL);
         if ($this->debug) {
             return $event;
         }
         $this->setUpResponse($event, $message);
         return;
     }
     $message = Utils::translateException($message, $exception);
     $this->setUpResponse($event, $message);
     DataLogger::log($message, DataLogger::ERROR);
 }
 private function slugifyPageName(array $values)
 {
     $slugPageName = Utils::slugify($values["name"]);
     if ($slugPageName == $values["name"]) {
         return $values;
     }
     $event = Dispatcher::dispatch(PageCollectionEvents::SLUGGING_PAGE_COLLECTION_NAME, new SluggingPageNameEvent($values["name"], $slugPageName));
     $sluggedText = $event->getChangedText();
     // @codeCoverageIgnoreStart
     if ($sluggedText != $slugPageName) {
         $slugPageName = $sluggedText;
     }
     // @codeCoverageIgnoreEnd
     $values["name"] = $slugPageName;
     return $values;
 }