コード例 #1
0
ファイル: GroupsController.php プロジェクト: valizr/MMA
 public function deleteAction()
 {
     $userId = NULL;
     $auth = Zend_Auth::getInstance();
     $authAccount = $auth->getStorage()->read();
     if (null != $authAccount) {
         if (null != $authAccount->getId()) {
             $userId = $authAccount->getId();
         }
     }
     $id = $this->getRequest()->getParam('id');
     $model = new Default_Model_Groups();
     if ($model->find($id)) {
         if ($groupId = $model->delete()) {
             Needs_Tools::DeleteLegaturibyGroup($groupId);
             $this->_flashMessenger->addMessage("<div class='success  canhide'><p>Group was deleted successfully!<a href='javascript:;'></a></p></div>");
         } else {
             $this->_flashMessenger->addMessage("<div class='failure canhide'><p>Group was not deleted!<a href='javascript:;'></a></p></div>");
         }
         $this->_redirect('groups');
     }
 }