public function validate()
 {
     if (!isset($this->_data['status'])) {
         $text = $this->data . ' ' . $this->title . ' ' . $this->author_name;
         if (is_array($this->_fields)) {
             $tfields = cgfb_comment_ops::get_fielddefs();
             foreach ($this->_fields as $fid => $value) {
                 if (!isset($tfields[$fid])) {
                     continue;
                 }
                 if ($tfields[$fid]['type'] != CGFEEDBACK_TYPE_TEXT && $tfields[$fid]['type'] != CGFEEDBACK_TYPE_TEXTAREA) {
                     continue;
                 }
                 $text .= ' ' . $value;
             }
         }
         $this->status = cgfb_comment_ops::text_needs_moderation($text) ? CGFEEDBACK_STATUS_DRAFT : CGFEEDBACK_STATUS_PUBLISHED;
     }
     return TRUE;
 }
    $this->SetError($this->Lang('error_missingparam'));
    $this->RedirectToTab($id);
}
$cid = (int) $params['cid'];
$spamcheck_module_name = $this->GetPreference('spamcheck_module', -1);
if ($spamcheck_module_name != -1) {
    $spamcheck_module =& $this->GetModuleInstance($spamcheck_module_name);
    if (is_object($spamcheck_module)) {
        $spamcheck_enabled = 1;
    }
}
#
# Get the data
#
$comment = cgfb_comment_ops::load($cid);
$tfields = cgfb_comment_ops::get_fielddefs();
foreach ($tfields as $fid => &$tfield) {
    $tfield['value'] = $comment->get_field_by_id($tfield['id']);
    switch ($tfield['type']) {
        case 2:
            $tfield['input'] = $this->CreateTextArea(isset($tfield['attribs']['usewysiwyg']) && $tfield['attribs']['usewysiwyg'] == 1 && $this->GetPreference('allow_comment_wysiwyg', 0), $id, $tfield['value'], 'field_' . $tfield['id']);
            break;
    }
}
$orig_status = $comment->status;
#
# Process form data
#
if (isset($params['cancel'])) {
    $this->RedirectToTab($id);
} else {