Beispiel #1
0
 /**
  * @access 	public
  * @return 	void
  */
 public function editProfileAction()
 {
     $form = new Default_Form_Profile();
     $mapperUser = new Admin_Model_Mapper_SysUser();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $mapperUser->setData($form->getValues());
             $return = $mapperUser->editProfile();
             $message = $mapperUser->getMessage()->toArray();
             $result = array('status' => (bool) $return, 'id' => $return, 'description' => $message, 'data' => $form->getValues());
         } else {
             $config = Zend_Registry::get('config');
             $message = new App_Message();
             $message->addMessage($config->messages->warning, App_Message::WARNING);
             $result = array('status' => false, 'description' => $message->toArray(), 'errors' => $form->getMessages());
         }
     } else {
         $this->_helper->redirector->goToSimple('index', 'index');
     }
     $this->_helper->json($result);
 }