コード例 #1
0
 /**
  * @see Mage_Adminhtml_Controller_Action::preDispatch
  */
 public function preDispatch()
 {
     parent::preDispatch();
     $actions = array('massActivate', 'massDeactivate', 'massDelete');
     $action = $this->getRequest()->getActionName();
     if (in_array($action, $actions)) {
         if ($this->getRequest()->isPost()) {
             $post = $this->getRequest()->getPost();
             $users = isset($post['facebook_user']) ? $post['facebook_user'] : array();
             if (!is_array($users) || empty($users)) {
                 $this->getSession()->addError('There was a problem updating users.');
                 $this->_redirect('*/*/');
             }
             $this->facebookCollection = $this->getFacebookUserCollection()->addFieldToFilter('entity_id', $users);
             $this->collectionCount = $this->facebookCollection->count();
         }
     }
 }