Mage_Adminhtml_Newsletter_ProblemController Class Reference

Inheritance diagram for Mage_Adminhtml_Newsletter_ProblemController:

Mage_Adminhtml_Controller_Action Mage_Core_Controller_Varien_Action

List of all members.

Public Member Functions

 indexAction ()
 gridAction ()

Protected Member Functions

 _isAllowed ()


Detailed Description

Definition at line 34 of file ProblemController.php.


Member Function Documentation

_isAllowed (  )  [protected]

Reimplemented from Mage_Adminhtml_Controller_Action.

Definition at line 98 of file ProblemController.php.

00099     {
00100         return Mage::getSingleton('admin/session')->isAllowed('newsletter/problem');
00101     }

gridAction (  ) 

Definition at line 59 of file ProblemController.php.

00060     {
00061         if($this->getRequest()->getParam('_unsubscribe')) {
00062             $problems = (array) $this->getRequest()->getParam('problem', array());
00063             if (count($problems)>0) {
00064                 $collection = Mage::getResourceModel('newsletter/problem_collection');
00065                 $collection
00066                     ->addSubscriberInfo()
00067                     ->addFieldToFilter($collection->getResource()->getIdFieldName(),
00068                                        array('in'=>$problems))
00069                     ->load();
00070 
00071                 $collection->walk('unsubscribe');
00072             }
00073 
00074             Mage::getSingleton('adminhtml/session')
00075                 ->addSuccess(Mage::helper('newsletter')->__('Selected problem subscribers successfully unsubscribed'));
00076         }
00077 
00078         if($this->getRequest()->getParam('_delete')) {
00079             $problems = (array) $this->getRequest()->getParam('problem', array());
00080             if (count($problems)>0) {
00081                 $collection = Mage::getResourceModel('newsletter/problem_collection');
00082                 $collection
00083                     ->addFieldToFilter($collection->getResource()->getIdFieldName(),
00084                                        array('in'=>$problems))
00085                     ->load();
00086                 $collection->walk('delete');
00087             }
00088 
00089             Mage::getSingleton('adminhtml/session')
00090                 ->addSuccess(Mage::helper('newsletter')->__('Selected problems successfully deleted'));
00091         }
00092                 $this->getLayout()->getMessagesBlock()->setMessages(Mage::getSingleton('adminhtml/session')->getMessages(true));
00093 
00094         $grid = $this->getLayout()->createBlock('adminhtml/newsletter_problem_grid');
00095         $this->getResponse()->setBody($grid->toHtml());
00096     }

indexAction (  ) 

Definition at line 36 of file ProblemController.php.

00037     {
00038         if ($this->getRequest()->getQuery('ajax')) {
00039             $this->_forward('grid');
00040             return;
00041         }
00042 
00043         $this->getLayout()->getMessagesBlock()->setMessages(
00044             Mage::getSingleton('adminhtml/session')->getMessages(true)
00045         );
00046         $this->loadLayout();
00047 
00048         $this->_setActiveMenu('newsletter/problem');
00049 
00050         $this->_addBreadcrumb(Mage::helper('newsletter')->__('Newsletter Problem Reports'), Mage::helper('newsletter')->__('Newsletter Problem Reports'));
00051 
00052         $this->_addContent(
00053             $this->getLayout()->createBlock('adminhtml/newsletter_problem', 'problem')
00054         );
00055 
00056         $this->renderLayout();
00057     }


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

Generated on Sat Jul 4 17:23:14 2009 for Magento by  doxygen 1.5.8