Example #1
0
 public function save($aData)
 {
     $aResult = array();
     $parent = $aData['parent_id'];
     $objectId = $aData['guid'];
     $name = $aData['name'];
     $email = $aData['email'];
     $title = $aData['title'];
     $comment = $aData['comment'];
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $userId = $auth->getIdentity()->kopel;
     } else {
         $userId = 0;
     }
     $modelComment = new App_Model_Db_Table_Comment();
     $catalogGuid = $modelComment->addComment(array('parent' => $parent, 'object_id' => $objectId, 'userid' => $userId, 'name' => $name, 'email' => $email, 'title' => $title, 'comment' => $comment, 'ip' => Pandamp_Lib_Formater::getRealIpAddr(), 'date' => new Zend_Db_Expr('NOW()')));
     return $catalogGuid;
 }
Example #2
0
 function statusAction()
 {
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout->disableLayout();
     $urlReferer = $_SERVER['HTTP_REFERER'];
     $status = $this->_getParam('st') ? $this->_getParam('st') : '';
     $id = $this->_getParam('id') ? $this->_getParam('id') : '';
     $modelComment = new App_Model_Db_Table_Comment();
     $row = $modelComment->find($id)->current();
     if ($status == 0) {
         $row->published = 0;
     } else {
         $row->published = 99;
     }
     $row->save();
     $sessHistory = new Zend_Session_Namespace('BROWSER_HISTORY');
     $sessHistory->urlReferer = $urlReferer;
     $this->_redirect($sessHistory->urlReferer);
 }
Example #3
0
 protected function _delete()
 {
     $modelComment = new App_Model_Db_Table_Comment();
     $modelComment->delete("parent=" . $this->id);
 }