Ejemplo n.º 1
0
 public function approve_submit()
 {
     if (empty($this->params['id'])) {
         flash('error', gt('No ID supplied for comment to approve'));
         expHistory::back();
     }
     /* The global constants can be overriden by passing appropriate params */
     //sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
     $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];
     $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];
     $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];
     $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];
     $comment = new expComment($this->params['id']);
     $comment->body = $this->params['body'];
     $comment->approved = $this->params['approved'];
     $comment->save();
     expHistory::back();
 }