/**
  * Application action display page content
  * @param Contentinum\Options\PageOptions $pageOptions Contentinum\Options\PageOptions
  * @param array $page
  * @param string $defaultRole
  * @param Zend\Permissions\Acl\Acl $acl Zend\Permissions\Acl\Acl
  */
 public function application($pageOptions, $role = null, $acl = null)
 {
     $viewHelperManager = $this->getServiceLocator()->get('viewHelperManager');
     $dateFormat = $viewHelperManager->get('dateFormat');
     $dateFormat->setTimezone("Europa/Berlin")->setLocale("de_DE");
     $variables = array();
     $variables['host'] = $pageOptions->getHost();
     $variables['protocol'] = $pageOptions->getProtocol();
     $variables['entries'] = $this->worker->fetchContent($pageOptions->getParams());
     $variables['parameter'] = $pageOptions->getParams();
     return $this->buildView($variables, $pageOptions->template);
 }
 /**
  * @todo translation
  * 
  * Process action processed a request form
  * @param Contentinum\Options\PageOptions $pageOptions Contentinum\Options\PageOptions
  * @param string $role
  * @param Zend\Permissions\Acl\Acl $acl Zend\Permissions\Acl\Acl
  * @return \Zend\View\Model\ViewModel
  */
 public function process($pageOptions, $role = null, $acl = null)
 {
     $viewHelperManager = $this->getServiceLocator()->get('viewHelperManager');
     $dateFormat = $viewHelperManager->get('dateFormat');
     $dateFormat->setTimezone("Europa/Berlin")->setLocale("de_DE");
     $variables = array();
     $variables['host'] = $pageOptions->getHost();
     $variables['protocol'] = $pageOptions->getProtocol();
     $variables['xmlHttpRequest'] = $this->getXmlHttpRequest();
     $entry = $this->worker->fetchContent($pageOptions->getParams());
     $formFactory = $this->getServiceLocator()->get('recommendation_forms');
     $datas = $this->getRequest()->getPost();
     $form = $formFactory->getForm();
     $form->setInputFilter($form->getInputFilter());
     $form->setData($datas);
     $jsonVar = array();
     if ($form->isValid()) {
         $configuration = $this->getServiceLocator()->get('contentinum_customer');
         /**
          * @var \Contentinum\Model\Sendmail $mail
          */
         $mail = $this->getServiceLocator()->get('contentinum_sendmail');
         $mail->setFormDatas($form->getData());
         $mail->setConfigure($configuration->default->support_mail);
         $mail->sendRecommendation($datas, $entry, $variables);
         $variables['success'] = 'success';
         $jsonVar['success'] = 'Ihre Empfehlung wurde erfolgreich versandt.';
     } else {
         $variables['error'] = array('fields' => $form->getMessages());
         $jsonVar['error'] = array('fields' => $form->getMessages());
     }
     if ($this->getXmlHttpRequest()) {
         echo json_encode($jsonVar);
         exit;
     }
     return $this->buildView($variables, $pageOptions->template);
 }