fileupload_validate

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

developer/examples/fileupload.module, строка 162

Версии
5
fileupload_validate(&$node)

Implementation of hook_validate().

Verify that there is a file attached to the node.

Код

<?php
function fileupload_validate(&$node) {
  // Check for a new file upload.
  if ($file = file_check_upload('file')) {
    $node->file = $file;
  }

  // Make sure there is an upload or an existing file.
  if (!$file && !file_exists($node->current_file)) {
    form_set_error('file', t('A file must be provided.'));
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

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