public function editAction() { SxCms_Acl::requireAcl('sheets', 'sheets.edit'); $proxy = new SxModule_Sheets_Type_Proxy(); $type = $proxy->getTypeById((int) $this->_getParam('type'), $_SESSION['System']['lng']); $this->view->type = $type; $proxy = new SxModule_Sheets_Subtype_Proxy(); $subtype = $proxy->getTypeById((int) $this->_getParam('id'), $_SESSION['System']['lng']); if ($this->getRequest()->isPost()) { $mapper = new SxModule_Sheets_Subtype_Mapper(); $fields = $mapper->fromInput($this->_getAllParams(), $this->_editablefields()); $data = $mapper->toObject($fields, $subtype); $validator = new SxModule_Sheets_Subtype_Validator(); if ($validator->validate($data)) { $data->save((int) $this->_getParam('type')); $cache = Zend_Registry::get('cache'); $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('SxModule_Sheets_Subtype')); $flashMessenger = $this->_helper->getHelper('FlashMessenger'); $flashMessenger->addMessage($this->admin_tmx->_('itemedited')); $this->_helper->redirector->gotoSimple('index', 'sheets_subtype', 'admin', array('type' => $this->_getParam('type'))); } $subtype = $data; } $this->view->messages = Sanmax_MessageStack::getInstance('SxModule_Sheets_Subtype'); $this->view->subtype = $subtype; }