public function deletemailAction() { $data = new SxModule_Subscribe_Email(); if ($this->getRequest()->isGet()) { $data->delete((int) $this->_getParam('id')); $cache = Zend_Registry::get('cache'); $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('SxModule_Subscribe')); } $flashMessenger = $this->_helper->getHelper('FlashMessenger'); $flashMessenger->addMessage($this->admin_tmx->_('itemdeleted')); $this->_helper->redirector->gotoSimple('indexmail', 'subscribe'); }
public function toArray(SxModule_Subscribe_Email $item, $type = '*') { $data = array('id' => $item->getId(), 'from_email' => $item->getFromEmail(), 'from_name' => $item->getFromName(), 'reply' => $item->getReply(), 'reply_name' => $item->getReplyName()); $tsl = array('subject' => $item->getSubject(), 'content' => $item->getContent()); if ($type == 'item') { return $data; } elseif ($type == 'tsl') { return $tsl; } return array_merge($data, $tsl); }
public function validate(SxModule_Subscribe_Email $object) { //var_dump($object); exit; $this->validateTextRequired($object->getSubject(), 'subject', 'content', $this->_namespace); $this->validateTextRequired($object->getContent(), 'content', 'content', $this->_namespace); $this->validateTextRequired($object->getFromName(), 'from_name', 'content', $this->_namespace); $this->validateTextRequired($object->getReplyName(), 'reply_name', 'content', $this->_namespace); $this->validateEmail($object->getFromEmail(), 'from_email', 'content', $this->_namespace); $this->validateEmail($object->getReply(), 'reply', 'content', $this->_namespace); $msgr = Sanmax_MessageStack::getInstance($this->_namespace); if (!$msgr->getNamespaceMessages()) { return true; } else { return false; } }