public function homeAction()
 {
     $this->_helper->layout->setLayout('full');
     $doctorProxy = new SxModule_Doctor_Proxy();
     $doctors = $doctorProxy->getAll($this->_getParam('lng', 'nl'), true);
     $this->view->items = $doctors;
 }
 public function addAction()
 {
     if ($this->getRequest()->isGet()) {
         $this->_doc = new SxModule_Doctor();
     }
     if ($this->getRequest()->isPost()) {
         $proxyAll = new SxModule_Doctor_Proxy();
         $pos = count($proxyAll->getAll($_SESSION['System']['lng']));
         $pos++;
         $this->_doc = new SxModule_Doctor();
         $this->_doc->setLastName($this->_getParam('last_name'));
         $this->_doc->setLng($_SESSION['System']['lng']);
         $this->_doc->setRank($pos);
         $this->_doc->setDescription($this->_getParam('description'));
         $this->_doc->setUni($this->_getParam('uni'));
         $this->_doc->setLink($this->_getParam('link'));
         $this->resizeAndSave();
         $active = $this->_getParam('active');
         if (null !== $active) {
             $this->_doc->setActive($active);
         } else {
             $this->_doc->setActive(0);
         }
         /* validate post */
         $validator = new SxModule_Doctor_BaseValidator();
         if ($validator->validate($this->_doc)) {
             //die('valid');
             $this->_doc->save();
             $flashMessenger = $this->_helper->getHelper('FlashMessenger');
             $flashMessenger->addMessage('Item werd succesvol aangemaakt!');
             $this->_helper->redirector->gotoSimple('index', 'doctor');
         }
     }
     $this->view->messages = Sanmax_MessageStack::getInstance('SxModule_Doctor');
     $this->view->item = $this->_doc;
 }