Mage_Newsletter_ManageController Class Reference

Inheritance diagram for Mage_Newsletter_ManageController:

Mage_Core_Controller_Front_Action Mage_Core_Controller_Varien_Action

List of all members.

Public Member Functions

 preDispatch ()
 indexAction ()
 saveAction ()


Detailed Description

Definition at line 35 of file ManageController.php.


Member Function Documentation

indexAction (  ) 

Definition at line 50 of file ManageController.php.

00051     {
00052             $this->loadLayout();
00053             $this->_initLayoutMessages('customer/session');
00054             $this->_initLayoutMessages('catalog/session');
00055 
00056         if ($block = $this->getLayout()->getBlock('customer_newsletter')) {
00057             $block->setRefererUrl($this->_getRefererUrl());
00058         }
00059         $this->getLayout()->getBlock('head')->setTitle($this->__('Newsletter Subscription'));
00060         $this->renderLayout();
00061     }

preDispatch (  ) 

Action predispatch

Check customer authentication for some actions

Reimplemented from Mage_Core_Controller_Front_Action.

Definition at line 42 of file ManageController.php.

00043     {
00044         parent::preDispatch();
00045         if (!Mage::getSingleton('customer/session')->authenticate($this)) {
00046             $this->setFlag('', 'no-dispatch', true);
00047         }
00048     }

saveAction (  ) 

Definition at line 63 of file ManageController.php.

00064     {
00065         if (!$this->_validateFormKey()) {
00066             return $this->_redirect('customer/account/');
00067         }
00068         try {
00069             Mage::getSingleton('customer/session')->getCustomer()
00070                 ->setStoreId(Mage::app()->getStore()->getId())
00071                 ->setIsSubscribed((boolean)$this->getRequest()->getParam('is_subscribed', false))
00072                 ->save();
00073             Mage::getSingleton('customer/session')->addSuccess($this->__('The subscription was successfully saved'));
00074         }
00075         catch (Exception $e) {
00076             Mage::getSingleton('customer/session')->addError($this->__('There was an error while saving your subscription'));
00077         }
00078         $this->_redirect('customer/account/');
00079     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:29 2009 for Magento by  doxygen 1.5.8