public function searchAction()
 {
     if ($this->getRequest()->isXmlHttpRequest()) {
         $request = $this->getRequest();
         $sm = $this->getServiceLocator();
         $oFormModel = $sm->get('FormsElementTable');
         $aFormModel = $oFormModel->getPolaFormularza(8);
         if ($request->isPost()) {
             $oPost = $request->getPost();
             $aPost = $oPost->toArray();
             $container = new \Zend\Session\Container($this->sSessionNameSpace);
             foreach ($aPost as $klucz => $wartosc) {
                 $container->offsetSet($klucz, $wartosc);
             }
             $ind = $this->params()->fromQuery('orderby', 0);
             $direction = $this->params()->fromQuery('direction', 'desc');
             $container->offsetSet('direction', $direction);
             $container->offsetSet('orderby', $ind);
             $xml = '<info>Ok</info>';
             $this->getResponse()->getHeaders()->addHeaders(array('Content-type' => 'text/xml'));
             return $this->getResponse()->setContent($xml);
         }
         $oForm = new Form();
         $oForm->setPokazPrzyciskZapisz(false);
         $xml = $oForm->getXMLForm($aFormModel);
         $this->getResponse()->getHeaders()->addHeaders(array('Content-type' => 'text/xml'));
         return $this->getResponse()->setContent($xml);
     }
 }
 public function infoAction()
 {
     $id = $this->getEvent()->getRouteMatch()->getParam('id');
     if ($this->getRequest()->isXmlHttpRequest()) {
         $sm = $this->getServiceLocator();
         $oFormModel = $sm->get('FormsElementTable');
         $aFormModel = $oFormModel->getPolaFormularza(3);
         $oForm = new Form();
         $oForm->setPokazPrzyciskZapisz(false);
         $xml = $oForm->getXMLForm($aFormModel);
         $this->getResponse()->getHeaders()->addHeaders(array('Content-type' => 'text/xml'));
         return $this->getResponse()->setContent($xml);
     }
 }
 public function infoAction()
 {
     $id = $this->getEvent()->getRouteMatch()->getParam('id');
     if ($this->getRequest()->isXmlHttpRequest()) {
         $sm = $this->getServiceLocator();
         $oFormModel = $sm->get('FormsElementTable');
         $aFormModel = $oFormModel->getPolaFormularza(3);
         $oForm = new Form();
         $oForm->setPokazPrzyciskZapisz(false);
         $oContainerTable = $sm->get('ContainerTable');
         $aData = $oContainerTable->getContainer($id);
         $aDataGrid = Grid::polaczFromularzZPelnymDanymiDoGrida($aFormModel, $aData);
         $oGrid = new Grid($aDataGrid, 'id');
         $xml = $oGrid->createXml();
         $this->getResponse()->getHeaders()->addHeaders(array('Content-type' => 'text/xml'));
         return $this->getResponse()->setContent($xml);
     }
 }