comment_form(); $form->get(null, false); // Was this a FormUI form, or a regular comment form? if($form->submitted) { if($form->success) { $this->add_comment( $post->id, $form->commenter->value, $form->email->value, $form->url->value, $form->content->value ); } else { Session::error(_t('There was a problem submitting your comment.')); foreach($form->validate() as $error) { Session::error($error); } $form->bounce(); } } else { // make sure all our default values are set so we don't throw undefined index errors foreach ( $defaults as $k => $v ) { if ( !isset( $this->handler_vars[ $k ] ) ) { $this->handler_vars[ $k ] = $v; } } $this->add_comment( $this->handler_vars['id'], $this->handler_vars['name'], $this->handler_vars['email'], $this->handler_vars['url'], $this->handler_vars['content'] ); }