_comment_form_submit

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

modules/comment/comment.module, строка 1640

Версии
5
_comment_form_submit($form_values)
6
_comment_form_submit(&$comment_values)

▾ 2 функции вызывают _comment_form_submit()

comment_form_add_preview in modules/comment/comment.module
Конструктор формы; Формирует и проверяет форму предпросмотра комментария.
comment_form_submit in modules/comment/comment.module

Код

<?php
function _comment_form_submit($form_values) {
  if (!isset($form_values['date'])) {
    $form_values['date'] = 'now';
  }
  $form_values['timestamp'] = strtotime($form_values['date']);
  if (isset($form_values['author'])) {
    $account = user_load(array('name' => $form_values['author']));
    $form_values['uid'] = $account->uid;
    $form_values['name'] = $form_values['author'];
  }
  // Validate the comment's subject. If not specified, extract
  // one from the comment's body.
  if (trim($form_values['subject']) == '') {
    // The body may be in any format, so we:
    // 1) Filter it into HTML
    // 2) Strip out all HTML tags
    // 3) Convert entities back to plain-text.
    // Note: format is checked by check_markup().
    $form_values['subject'] = truncate_utf8(trim(decode_entities(strip_tags(check_markup($form_values['comment'], $form_values['format'])))), 29, TRUE);
    // Edge cases where the comment body is populated only by HTML tags will
    // require a default subject.
    if ($form_values['subject'] == '') {
      $form_values['subject'] = t('(No subject)');
    }
  }

  return $form_values;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему